SkillAgentSearch skills...

Toybox

Opinionated TALL stack starter kit for Laravel solopreneurs

Install / Use

/learn @nikspyratos/Toybox
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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

Toybox cover image


<!-- TOC --> <!-- TOC -->

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

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)
  • 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

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 bin are 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

  1. Clone/fork this repository into a new repository.
  2. 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 .env accordingly.

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

View on GitHub
GitHub Stars147
CategoryData
Updated3d ago
Forks14

Languages

PHP

Security Score

100/100

Audited on Apr 1, 2026

No findings