rajtik76 / nette

Laravel's developer experience, the Nette way

A console with generators, migrations, route middleware and a starter kit with authentication, built as small Nette packages that stay idiomatic Nette.

composer create-project rajtik76/nette-tailwind-starter-kit my-app

Why this exists

From Nette to Laravel and back

I started with Nette: from 2016 to 2021 I built dating platforms for twelve countries and a CMS for an international company on it. In 2021 I switched to Laravel and have worked in it ever since. Now I am coming back to Nette, bringing along the Laravel workflows I came to rely on.

Nette is a great framework: a strict DI container, Latte with context-aware escaping, presenters and components that keep things explicit. What I missed after the Laravel years were the everyday tools that Laravel gives you before you write the first line of your own code:

  • one command line for the project, where installed packages add their own commands,
  • migrations, seeders and factories that work the same on SQLite in tests and on MySQL or PostgreSQL in production,
  • access rules written next to the routes: auth, guest, verified, password.confirm,
  • a fresh project with Tailwind CSS and Vite already wired in,
  • a starter kit where login, registration, password reset and email verification work on day one.

So I built them. Not a port of Laravel: each package solves one gap with Nette's own building blocks (DI extensions, NEON configuration, presenters, Latte), runs on PHP 8.4, passes PHPStan level 8 and has tests. Everything is MIT licensed.

The chain

Small packages, one stack

Start with the starter kit if you want authentication, or with the skeleton for an empty project. The three packages also work in any existing Nette application.

  1. nette-console Artisan-like console with package discovery and generators
  2. nette-migrations Migrations, schema builder, seeders and factories nette-middleware Laravel-style route middleware
  3. nette-tailwind nette/web-project with Tailwind CSS 4 and Vite nette-tailwind-starter-kit Authentication, dashboard and settings, the Laravel starter kit way

The packages

nette-console

README Packagist

Artisan-like console with package discovery and generators

What I missed

In Laravel, php artisan is the centre of the project. Generators create classes for you, and when you composer require a package, its commands are simply there. In Nette I had to register every package's DI extension in the configuration by hand, and there were no generators.

What it does

php nette is Symfony Console wired into the DI container. Packages declare their extensions in composer.json and register themselves after composer require (package discovery). It comes with make:command, cache:clear and package:discover, and a base class for your own generators.

composer require rajtik76/nette-console

nette-migrations

README Packagist

Migrations, schema builder, seeders and factories

What I missed

Laravel migrations: a schema builder in PHP, one file for every database, batches with rollback, migrate:fresh --seed, and seeders with factories for test data. I wanted the same workflow on top of nette/database, without bringing in another database layer.

What it does

Migrations, a schema builder for SQLite, MySQL, MariaDB and PostgreSQL, seeders and factories resolved from the DI container (Faker optional). Commands migrate, migrate:rollback, migrate:fresh, migrate:status, db:seed and the make:* generators. Destructive commands ask for confirmation in production.

composer require rajtik76/nette-migrations

nette-middleware

README Packagist

Laravel-style route middleware

What I missed

In Laravel I read the routes file and see who can open what: ->middleware(['auth', 'verified']). In Nette these checks usually live in presenters, in startup() or in a base presenter, spread across the class hierarchy, and a new action can easily slip through.

What it does

Each route lists its middleware in the router, and the middleware runs before the action. Middleware is an ordinary DI service, read only from the router, never from the URL. Redirects work for AJAX requests too (Naja), and IntendedRequest brings the user back to the page they wanted after signing in, the Nette way (restoreRequest()).

composer require rajtik76/nette-middleware

nette-tailwind

README Packagist

nette/web-project with Tailwind CSS 4 and Vite

What I missed

A new Laravel project comes with Vite and Tailwind CSS ready. I wanted the same starting point for Nette, without spending the first hour on build configuration.

What it does

The official nette/web-project skeleton with Tailwind CSS 4 wired into Vite, nette-console with package discovery, Latte and NEON linting, PHPStan level 8, Nette Tester and CI on PHP 8.4 and 8.5. The welcome page and the error pages share the blueprint look of this site.

composer create-project rajtik76/nette-tailwind my-app

nette-tailwind-starter-kit

README Packagist

Authentication, dashboard and settings, the Laravel starter kit way

What I missed

Laravel's starter kits give you a working application in minutes: login, registration, password reset, email verification, password confirmation, a dashboard and account settings. In Nette I wrote this part again for every project.

What it does

The Nette counterpart of the Laravel Livewire Starter Kit, built on nette-tailwind, nette-migrations and nette-middleware: the same pages, routes, validation messages and rate limits, with the authentication logic kept apart from the UI like Fortify. Read more about the starter kit

composer create-project rajtik76/nette-tailwind-starter-kit my-app