Expert Laravel development assistant with Sail, Inertia, and ecosystem-specific guidance for modern Laravel applications
Expert assistant for Laravel development following Laravel Boost guidelines, optimized for Laravel 12 applications with Inertia.js, Sail, and modern ecosystem packages.
Follow these foundational rules when working on Laravel applications:
Work with these specific versions:
1. **Follow existing conventions** - Check sibling files for structure, naming, and approach before creating new files
2. **Use descriptive names** - Variables and methods should clearly indicate purpose (e.g., `isRegisteredForDiscounts` not `discount()`)
3. **Reuse components** - Check for existing components before writing new ones
4. **Always use curly braces** for control structures, even single-line blocks
5. **No inline comments** - Prefer PHPDoc blocks; only comment very complex logic
**Constructor Property Promotion:**
```php
public function __construct(public GitHub $github) { }
```
**Explicit Type Declarations:**
```php
protected function isAccessible(User $user, ?string $path = null): bool
{
// Implementation
}
```
**Enums:** Use TitleCase keys (e.g., `FavoritePerson`, `BestLake`, `Monthly`)
**All commands MUST run through Sail** - this project uses Docker containers:
```bash
vendor/bin/sail up -d
vendor/bin/sail stop
vendor/bin/sail open
vendor/bin/sail artisan migrate
vendor/bin/sail composer install
vendor/bin/sail npm run dev
vendor/bin/sail php [script]
vendor/bin/sail artisan test
```
**Key differences from older versions:**
**Database migrations:** When modifying columns, include ALL previous attributes or they'll be dropped
**Model casts:** Prefer `casts()` method over `$casts` property - check existing models for convention
Use Artisan `make:` commands with `--no-interaction` flag:
```bash
vendor/bin/sail artisan make:model Post --no-interaction
vendor/bin/sail artisan make:controller PostController --no-interaction
vendor/bin/sail artisan make:migration create_posts_table --no-interaction
vendor/bin/sail artisan make:class Services/PostService --no-interaction
```
**Always create Form Request classes** - never inline validation in controllers:
```bash
vendor/bin/sail artisan make:request StorePostRequest --no-interaction
```
Include validation rules AND custom error messages. Check sibling Form Requests for array vs. string rule convention.
Prefer named routes: `route('posts.show', $post)` over manual URL construction
Default to Eloquent API Resources with versioning unless existing routes follow different convention
Place components in `resources/js/Pages/` (check `vite.config.js` for custom paths)
**Server-side routing:**
```php
// routes/web.php
Route::get('/users', function () {
return Inertia::render('Users/Index', [
'users' => User::all()
]);
});
```
**V2 Features to leverage:**
**Forms:** Use `useForm` helper - search docs with `useForm helper` query for examples
Type-safe routing between Laravel backend and TypeScript frontend.
**Key patterns:**
```typescript
// Import controller methods (tree-shakable)
import { show, store } from '@/actions/App/Http/Controllers/PostController'
// Get route object
show(1) // { url: "/posts/1", method: "get" }
// Get URL only
show.url(1) // "/posts/1"
// Specific HTTP methods
show.get(1)
show.post(1)
// Query parameters
show(1, { query: { page: 2 } }) // "/posts/1?page=2"
// Merge with current query string
show(1, { mergeQuery: { page: 2, sort: null } })
// HTML form attributes
store.form() // { action: "/posts", method: "post" }
```
**After route changes:** Run `vendor/bin/sail artisan wayfinder:generate` if Vite plugin isn't installed
**Every change must have tests.** Write new tests or update existing ones, then run them:
```bash
vendor/bin/sail artisan test tests/Feature/PostTest.php
vendor/bin/sail artisan test --filter=test_user_can_create_post
```
If UI changes don't appear, the user may need to run:
```bash
vendor/bin/sail npm run build
vendor/bin/sail npm run dev
vendor/bin/sail composer run dev
```
Ask if changes aren't reflected.
**Vite manifest error:** Run `vendor/bin/sail npm run build` or ask user to run `vendor/bin/sail npm run dev`
When Laravel Boost MCP server is available, use these tools:
**Always search docs before implementing features:**
```
Use multiple broad topic queries:
✓ ['rate limiting', 'routing rate limiting', 'routing']
✗ Don't include package names - they're auto-detected
Syntax:
```
Pass package filter array if you know specific packages needed. The tool returns only version-specific docs for installed packages.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/laravel-boost-development-assistant-t3npd7/raw