Toybox
Opinionated TALL stack starter kit for Laravel solopreneurs
Install / Use
/learn @nikspyratos/ToyboxREADME
Toybox is archived
With the advent of Laravel Cloud, and starter kits with more dedicated support (like Wave and Larafast) alongside the first party ones, I feel like this project has served its purpose.
For me, the most useful parts of this project were the simplified server setup. I may come back with a set of simple tools in a new project that will serve the same purpose. I'd sitll heartily recommend Forge, Ploi, Cloud and others, but I do believe there is value in having simplified (i.e. no Docker, Ansible, etc) and independent (no 3rd party service) infrastructure tooling for simple apps.
Toybox - A TALL SaaS starter kit

<!-- TOC -->
- Support this project
- Project Status - can you use this yet?
- Features
- Components
- Installation/Usage
- 3rd-party Services/Tools
- How to scale
- Other recommendations for business operations, launching, etc.
- Roadmap
- Contributing
Toybox is an enhanced TALL stack installer for Laravel, aimed for experienced developers and solopreneurs.
Even if you don't need another boilerplate, perhaps the list of recommended services will still give you a path forward, or the scripts will give you something to work with.
Alternatively if you're looking for more functionality out of your boilerplate, take a look at Sergey Karakhanyan's Larafast.
This project is intended mostly for use as a solo Laravel developer who wants to rapidly develop and deploy indie SaaS projects. This is not intended for junior developers - having worked with the modern Laravel ecosystem is ideal to use this project. This is also not intended for "professional" commercial use, i.e. for freelance clients - it's intended for use by indie developer-entrepreneurs.
Principles
- Free, both ways: There's no need to pay anything for this - I built it because I use it! You can also do whatever you'd like.
- Self-containment: With minimal extra requirements, you should be able to clone this repo and get something running.
- Tiny but mighty: Minimising the different technologies used, using simpler & standardised alternatives to common tools.
- Don't reinvent the wheel: Use as much of the official & unofficial Laravel ecosystem where applicable. Use popular (i.e. sustainable, gets regular updates) tools & packages where applicable instead of rewriting boilerplate logic from scratch. We're in Laravel, not JS!
- Quality code: Strict types. Automated linting & code analysis
- Simplified Scaling: It's cheaper to scale with load balancing & bigger servers, and with minor manual input instead of full automation.
- Bleeding edge: Let's play around with the latest tools out there!
Support this project
- Buy me a coffee
- Use my affiliate links for Larafast, OhDear and Paystack (found all over this README).
- I also consult in the Laravel & payments space
- Post what you've built using the Toybox and tag me!
Project Status - can you use this yet?
Toybox is currently stable.
Features
- Self-initialising, self-provisioning, self-deploying project using bash scripts.
- Admin panel with Filament, great starting point for managing your application.
- Terms of Service and Privacy Policy derived from Basecamp
- Security enhancements included from Securing Laravel
- Laravel ecosystem included - auth scaffolding, websockets, performance monitoring, webserver runtime, API authentication, feature flags, social login
- Basic Landing page, including a Cookie Consent banner
All of this is done while keeping package dependencies minimal outside of trusted third parties like Filament or Spatie.
Components
- OS: Ubuntu 22.04 LTS
- Webserver: FrankenPHP's Caddy, configured to run through Laravel Octane
- Database: SQLite, optimised for performance & stability
- Application: Laravel (duh)
- Admin Panel: Filament
- UI: Livewire (including Alpine.js). Laravel Folio for content pages. Laravel Jetstream for authentication, session management, 2FA and much more (Socialstream included to augment Jetstream with social logins). Some features may also use Filamnent components.
- API: Laravel Sanctum
- Testing: PestPHP
- Observability/Metrics: Laravel Pulse and Laravel Telescope
- Linting, Code Quality, Static Analysis: Duster for linting, with Pint configuration compatible with PHP Insights. Rustywind for Tailwind classes. for Tailwind classes. Larastan, PHP Insights with custom configuration focused on compatibility.
- Asset bundling: Bun is supported by default, otherwise this uses a standard Laravel installation of Vite & Tailwind.
- CI/CD: Good old Bash scripts.
- Cache, queues, etc.: For some "easy" scaling and portability with SQLite and database drivers, Cache, Queue, Pulse & Telescope have their own separate SQLite database connections. This should theoretically avoid any potential write issues if one of the databases needs more frequent writes than others, and makes the app a little more portable (e.g. you can retain your cache as easily as copying a file when moving server).
Installation/Usage
Requirements
You will need PHP 8.3 alongside some extensions (at least the Laravel defaults and intl)
A good starting point of extensions that should cover most apps is:
bcmath
ctype
curl
dba
dom
fileinfo
filter
gd
gettext
gmp
iconv
intl
libxml
mbstring
mysqli
openssl
pcntl
PDO
Phar
posix
session
soap
sockets
tokenizer
zlib
Local Development
Environment Setup
Cross-platform
macOS
- (Valet & PHPMon) OR Laravel Herd
- DBngin for Databases & Redis (Or Herd)
- Takeout for many more extra services (e.g. ElasticSearch, Mailhog/Mailpit)
Note: Favicons with Valet-hosted sites are a bit broken. To fix it, edit your /opt/homebrew/etc/nginx/valet/valet.conf using one of simensen's workarounds, or just remove the favicon & robot.text handlers entirely.
Linux
- Valet Linux AND install PHP on your system.
- Install your DB of choice locally, or Takeout supports both Redis and MySQL/MariaDB, so it can act as a DBNgin alternative for Linux and more.
Windows
- Herd is an all-in-one development solution, including database, redis, and other services (if you pay for Pro).
- WSL2 is still required, as all the scripts in
binare built for Linux/Mac.
Note: If using Herd, you won't be able to use Horizon and Pail, as they require the pcntl extension which does not work on Windows. If you really need these tools, you'll need a WSL2/Docker/VM based development environment.
Third party packages using Prompts may also fail, as while Prompts has a fallback for Windows, this has to be implemented manually for other OSes.
Installing Toybox
- Clone/fork this repository into a new repository.
- Run
./bin/init.sh(remember to do so from WSL2 on Windows). It will:- Set up pre-commit linting,
- Replace template names,
- Conduct Laravel boilerplate setup (package installs, key generate, migrate, etc.).
- The script will ask you for some basic environment variables (app name, domain, database name) and edit your
.envaccordingly.
Note: By default init.sh assumes your production server username is ubuntu. If it is not, you need to replace ubuntu in your Caddyfile.prod, templates/octane.conf and templates/reverb.conf with the correct username, once init.sh is finished.
Once the script completes, you can commit the changes to the edited files.
For details, look in bin/init.sh.
The sections below outline the recommended way to work with Toybox on your local system. Please note the included Caddyfile.prod is intended for production use and Caddyfile.dev for local testing..
Laravel Octane
The default Octane config will start with one worker per core, and restart workers every 500 requests. To account for this project's dependencies and any potential leaks, Toybox's config is a bit more conservative and will restart workers every 250 requests. You can change this in templates/octane.conf.
To use Octane with Valet/Herd, yo
