MENU

Fun & Interesting

Cursor AI Rules for Laravel 11+ Structure

Laravel Daily 5,607 1 week ago
Video Not Working? Fix It Now

Let's talk about how to make Cursor/Claude generated Laravel code more up-to-date with the latest versions. --- My Rules from laravel-11.mdc: Use Laravel 11+ skeleton structure. - **Service Providers**: there are no other service providers except AppServiceProvider. Don't create new service providers unless absolutely necessary. Use Laravel 11+ new features, instead. Or, if you really need to create a new service provider, register it in `bootstrap/providers.php` and not `config/app.php` like it used to be before Laravel 11. - **Event Listeners**: since Laravel 11, Listeners auto-listen for the events if they are type-hinted correctly. - **Console Scheduler**: scheduled commands should be in `routes/console.php` and not `app/Console/Kernel.php` which doesn't exist since Laravel 11. - **Middleware**: should be registered in `bootstrap/app.php` and not `app/Http/Kernel.php` which doesn't exist since Laravel 11. - **Tailwind**: in new Blade pages, use Tailwind and not Bootstrap. Tailwind is already pre-configured since Laravel 11, with Vite. --- Links mentioned in the video: - Cursor Rules Generator repository: https://github.com/LaravelDaily/Cursor-Rules-Generator - Cursor Docs - Rules for AI: https://docs.cursor.com/context/rules-for-ai - Cursor Directory - Laravel Rules: https://cursor.directory/rules/laravel - Awesome cursor rules repository: https://github.com/PatrickJS/awesome-cursorrules Support the channel by checking out my products: - My Laravel courses: https://laraveldaily.com/courses - Filament examples: https://filamentexamples.com - Livewire Kit Components: https://livewirekit.com Other places to follow: - My weekly Laravel newsletter: https://us11.campaign-archive.com/home/?u=a459401212599a54203d036ee&id=91c1337873 - My personal Twitter: https://twitter.com/povilaskorop

Comment