Expert guidance for Laravel 12 + Sail development with Inertia v2, Wayfinder, and modern PHP/Vue best practices. Includes uptime monitoring patterns, Docker workflow, and testing enforcement.
Expert assistant for Laravel 12 applications running in Sail containers with Inertia v2, Wayfinder, and Vue 3. Optimized for uptime monitoring applications with modern PHP practices.
You are an expert in this stack:
**CRITICAL:** All commands MUST run through Sail. This application runs in 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.php
vendor/bin/sail artisan test
```
```php
public function __construct(public GitHub $github) { }
```
```php
protected function isAccessible(User $user, ?string $path = null): bool
{
// ...
}
```
1. **Use Artisan generators:**
```bash
vendor/bin/sail artisan make:model --help # Check options
vendor/bin/sail artisan make:controller --no-interaction
vendor/bin/sail artisan make:class # For generic PHP classes
```
2. **Database & Eloquent:**
- Use relationship methods with return type hints
- Prefer `Model::query()` over `DB::`
- Eager load to prevent N+1 queries
- Use query builder for complex operations
- **Migrations:** When modifying columns, include ALL previous attributes or they'll be dropped
3. **Form validation:**
- Always create Form Request classes (not inline validation)
- Include custom error messages
- Check sibling Form Requests for array vs string rule conventions
4. **Configuration:**
- Environment variables ONLY in config files
- Use `config('app.name')` not `env('APP_NAME')` in code
5. **URL generation:**
- Prefer named routes: `route('posts.show', $post)`
6. **APIs:**
- Default to Eloquent API Resources with versioning
- Follow existing conventions if already established
7. **Queues:**
- Use `ShouldQueue` interface for time-consuming operations
8. **Models:**
- Create factories and seeders alongside new models
- Use `casts()` method instead of `$casts` property (follow existing patterns)
```php
Route::get('/users', fn() => Inertia::render('Users/Index', [
'users' => User::all()
]));
```
**Leverage v2 features:**
**Deferred props:** Always add animated skeleton/pulsing empty states.
Generates TypeScript functions for Laravel routes. Always use `search-docs` before implementing.
**Best practices:**
**Usage examples:**
```typescript
import { show, store, update } from '@/actions/App/Http/Controllers/PostController'
show(1) // { url: "/posts/1", method: "get" }
show.url(1) // "/posts/1"
show.post(1) // { url: "/posts/1", method: "post" }
// Query params
show(1, { query: { page: 1 } }) // "/posts/1?page=1"
// Merge with current URL query
show(1, { mergeQuery: { page: 2, sort: null } })
// HTML form attributes
store.form() // { action: "/posts", method: "post" }
// Named routes
import { show as postShow } from '@/routes/post'
```
**CRITICAL:** Every change MUST be tested.
- `list-artisan-commands` — Check available Artisan parameters
- `get-absolute-url` — Generate correct project URLs
- `tinker` — Execute PHP/query Eloquent models
- `database-query` — Read from database
- `browser-logs` — Read browser errors/exceptions
- `search-docs` — **Use FIRST** for Laravel ecosystem docs (auto-filters by installed versions)
**Always use `search-docs` before coding.** It returns version-specific docs for this exact stack.
**Search syntax:**
```bash
['rate limiting', 'routing rate limiting', 'routing']
'authentication' # Finds 'authenticate', 'auth'
'rate limit' # Both words required
'"infinite scroll"' # Adjacent words in order
'middleware "rate limit"' # AND with exact phrase
["authentication", "middleware"] # ANY match
```
**Don't add package names to queries** (already shared). Use `test resource table`, not `filament 4 test resource table`.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/laravel-sail-uptime-monitor-helper/raw