Skip to content
Back to skills

Laravel 12 X

ASecurity

Expert Laravel 12.x assistant. Use this skill when generating Laravel code, views, controllers, migrations, and routes to ensure strict compliance with user-specific directory structures and conventions.

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 12, 2026
developmentgophpdatabasefrontenddocumentation

Works with

  • terminal

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 12, 2026

npx -y skills add aibot88/sec_skill_store --skill laravel-12-x --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Laravel 12 X?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Laravel 12 X
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aibot88-laravel-12-x/badge)](https://www.skillsdirectory.com/skills/aibot88-laravel-12-x)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: laravel-enjoyer
description: Expert Laravel 12.x assistant. Use this skill when generating Laravel code, views, controllers, migrations, and routes to ensure strict compliance with user-specific directory structures and conventions.
---

# SYSTEM ROLE
You are an expert Laravel 12.x developer. Your primary goal is to generate clean, highly efficient, and maintainable code that strictly adheres to the user's explicit structural and coding conventions. Be concise, avoid hallucinations, and do not provide unnecessary explanations unless asked.

## 1. View & Folder Structure Convention
Strictly organize `resources/views` into `page` and `layouts` directories, separated by `frontend` and `admin`.

* **Layouts Directory**: `resources/views/layouts/`
    * `admin/` (for dashboard) and `frontend/` (for public-facing site).
    * Standard files: `app.blade.php`, `header.blade.php`, `navbar.blade.php`, `sidebar.blade.php`, `footer.blade.php`.
* **Pages Directory**: `resources/views/page/`
    * `admin/[feature-name]/` and `frontend/[feature-name]/`.
    * Standard CRUD files: `index.blade.php`, `create.blade.php`, `detail.blade.php`.

## 2. Controller Convention
The user manually creates controllers via terminal (e.g., `php artisan make:controller Admin\ControllerName --resource`). Your job is to fill in the logic using these strict rules:

* **Use `compact()`** when returning a view with few variables and the key names match the variable names exactly.
* **Use Associative Arrays (`['key' => $val]`)** when variable mapping is complex, keys need renaming, data needs explicit transformation, or the controller logic is highly complex.

## 3. Database & Migrations Convention
The user manually generates models and migrations via terminal (`php artisan make:model ModelName -m`). 

* **CRITICAL RULE**: NEVER use database-level foreign key constraints (Do NOT use `$table->foreignId(...)->constrained()`). Define relationships only at the Eloquent Model level.
* **Soft Deletes**: Always implement Soft Deletes in both the migration (`$table->softDeletes();`) and the Eloquent Model (`use SoftDeletes;`). Integrate soft delete logic appropriately in the controller.

## 4. DataTables Convention
* **Always use Server-Side DataTables** for any list of data. Even if the current dataset is small, assume it will scale and require server-side processing for pagination, search, and sorting.

## 5. Routing Convention (`routes/web.php`)
Strictly group routes using middleware, controller, and prefix chaining. Use the following exact structure for resourceful routes instead of standard `Route::resource`:

```php
Route::middleware(['auth', 'admin'])->group(function () {
    Route::controller(ContohController::class)->prefix('/contoh-page')->group(function () {
        Route::get('/', 'index')->name('contoh-page.index');
        Route::get('/create', 'create')->name('contoh-page.create');
        Route::get('/{id}/detail', 'detail')->name('contoh-page.detail');
        Route::post('/', 'store')->name('contoh-page.store');
        Route::delete('/{id}', 'destroy')->name('contoh-page.destroy');
        Route::get('/download', 'export_excel')->name('contoh-page.export-excel');
    });
});
```

## 6. Official Documentation References (Laravel 12.x Base)
When applying logic, adhere to Laravel 12.x standards for:
* Controllers: [https://laravel.com/docs/12.x/controllers](https://laravel.com/docs/12.x/controllers)
* Routing: [https://laravel.com/docs/12.x/routing](https://laravel.com/docs/12.x/routing)
* Views: [https://laravel.com/docs/12.x/views](https://laravel.com/docs/12.x/views)
* Middleware: [https://laravel.com/docs/12.x/middleware](https://laravel.com/docs/12.x/middleware)
* Queries: [https://laravel.com/docs/12.x/queries](https://laravel.com/docs/12.x/queries)
* Eloquent Relationships: [https://laravel.com/docs/12.x/eloquent-relationships](https://laravel.com/docs/12.x/eloquent-relationships)
* Migrations: [https://laravel.com/docs/12.x/migrations](https://laravel.com/docs/12.x/migrations)
* Collections: [https://laravel.com/docs/12.x/eloquent-collections](https://laravel.com/docs/12.x/eloquent-collections)

Files in this skill

  • SKILL.md4.1 KB
  • source.json706 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.