This is a Laravel 11 application with Livewire Version 3, and Filamentphp v3.
# Technical Guidelines
When generating code you always adhere to to the following standards:
## Key Principles
- Write concise, technical responses with accurate PHP examples.
- Adhere to Laravel 11 best practices and conventions.
- Use object-oriented programming with a focus on SOLID principles.
- Prefer iteration and modularization over duplication.
- Use descriptive variable and method names.
- Use lowercase with dashes for directories (e.g., app/Http/Controllers).
- Favor dependency injection and service containers.
- Overall, you love clean and minimalist code, early returns, cruddy by design, and short, declaritive functions.
## Function Naming:
- Title Case for relationship functions on Models eg User()->People->Entity instead of user()->people->entity
- camelCase for normal functions eg getFooBar() in a controller
- You like Eloquent Model functions that return booleans, strings, integers or any kind of information about the model to be in the attribute accessor virtual column format getFooAttribute() as this helps the team recognise them as a computed property.
- You like Eloquent Model functions that return a collection based on a filtered relationship (especially where the term get() is used inside the function) to be in the format getFoo() as this marks them as a relationship that has been "crystalised".
## Variable Naming:
- $camelCase for variables that contain php objects, collections, models or things that can be chained on to eg $fooModel
- $snake_case for variables that contain simple values, strings and numbers eg $foo_value especially when they will be consumed on the front end in blade or vue.
## PHP/Laravel guidelines:
- Use PHP 8.3+ features when appropriate (e.g., typed properties, match expressions).
- Follow PSR-12 coding standards.
- Utilize Laravel's built-in features and helpers when possible.
- File structure: Follow Laravel's directory structure and naming conventions.
- Implement proper error handling and logging:
- Use Laravel's exception handling and logging features.
- Create custom exceptions when necessary.
- Use try-catch blocks for expected exceptions.
- Use Laravel's validation features for form and request validation.
- Implement middleware for request filtering and modification.
- Utilize Laravel's Eloquent ORM for database interactions.
- Use Laravel's query builder for complex database queries.
- Static calls where possible such as Redirect::to() instead of redirect() and Str::snake('FooBar) instead of str()->snake('FooBar') because they are more declarative.
## FilamentPHP guidelines:
When generating blade you prefer to utilize existing filament blade components.
For a detailed reference you consult the filament documentation
**Available UI components**
- Avatar
- Badge
- Breadcrumbs
- Loading indicator
- Section
- Tabs
**UI components for actions**
- Button
- Dropdown
- Icon button
- Link
- Modal
**UI components for forms**
- Checkbox
- Fieldset
- Input
- Input wrapper
- Select
**UI components for tables**
- Pagination
When testing filament you can interact with the Filament\Facades\Filament::class and it's methods:
- static arePasswordsRevealable() StatefulGuard
- static auth() void
- static bootCurrentPanel() array|NavigationGroup[]
- static buildNavigation() void
- ... and many many more
blade
css
express.js
javascript
laravel
php
shell
solidjs
+1 more
First Time Repository
PHP
Languages:
Blade: 9.1KB
CSS: 24.6KB
JavaScript: 30.3KB
PHP: 188.6KB
Shell: 22.5KB
Created: 12/29/2024
Updated: 1/9/2025