Works with the AI Agents you already use

    Laravel Backend API Assistant

    by Muhammad Bintang Syakhila

    1

    A Laravel backend assistant for building, debugging, and auditing secure REST APIs, database structures, Eloquent models, and backend applications.

    Free

    Security scanned
    Laravel Backend API Assistant

    Laravel Backend API Assistant

    Example session with this skill installed

    I need a new API endpoint to allow users to update their profile information. It should validate that the email is unique and the bio is under 500 characters. Use a Form Request.

    • Read your context and instructions
    • Compiled the laravel backend api

    I have designed the update profile endpoint using a Form Request and an API Resource to ensure clean validation and response formatting.

    Profile Update Implementation

    // app/Http/Requests/UpdateProfileRequest.php
    namespace App\Http\Requests;
    
    use Illuminate\Foundation\Http\FormRequest;
    use Illuminate\Validation\Rule;
    
    class UpdateProfileRequest extends FormRequest
    {
        public function authorize(): bool
        {
            return true; // Authorization handled via middleware or Policy
        }
    
        public function rules(): array
        {
            return [
                'name' => ['required', 'string', 'max:255'],
                'email' => [
                    'required',
                    'email',
                    'max:255',
                    Rule::unique('users')->ignore($this->user()->id),
                ],
                'bio' => ['nullable', 'string', 'max:500'],
            ];
        }
    }
    
    // app/Http/Controllers/Api/UserController.php
    public function update(UpdateProfileRequest $request)
    {
        $user = $request->user();
        $user->update($request->validated());
    
        return new UserResource($user);
    }
    
    // routes/api.php
    Route::middleware('auth:sanctum')->put('/profile', [UserController::class, 'update']);
    

    Next steps

    1. Generate the UserResource if it does not exist using php artisan make:resource UserResource.
    2. Run php artisan test to verify the unique email validation logic.
    3. Ensure the bio column exists in your users table migration.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Building and maintaining Laravel APIs requires constant attention to Eloquent performance, authorization logic, and request validation. This skill acts as a senior backend engineer to help you design, implement, and audit Laravel applications with a focus on RESTful best practices and MySQL optimization.

    What it does

    • API implementation writes controllers, routes, and Form Requests following REST standards.
    • Security auditing identifies IDOR vulnerabilities, mass-assignment risks, and missing authorization policies.
    • Database optimization designs migrations and Eloquent relationships while preventing N+1 query issues.
    • Automated testing generates Feature and Unit tests for happy paths, validation failures, and tenant isolation.
    • Systematic debugging analyzes stack traces to provide targeted, low-risk fixes for backend failures.

    How it works

    1. Context inspection analyzes your existing Laravel version, project structure, and coding conventions.
    2. Endpoint design defines HTTP methods, request validation rules, and response shapes using API Resources.
    3. Component generation produces the necessary migrations, models, and services to fulfill the logic.
    4. Security review checks every new endpoint for authentication, authorization, and data leakage.

    Frameworks & tools

    This skill is built for Laravel (PHP) applications using MySQL. It utilizes Eloquent ORM, Laravel's built-in testing suite (PHPUnit/Pest), and standard API components like Form Requests and Resources.

    Why this beats prompting it yourself

    Generic prompts often ignore Laravel-specific security features like Policies or fail to scope queries in multi-tenant environments. This skill enforces a strict security review and database integrity check for every code change it proposes.

    Use cases

    • Scaffold a new REST API endpoint with full validation and authorization.
    • Refactor a bloated controller into focused Service or Action classes.
    • Audit an existing codebase for SQL injection risks and IDOR vulnerabilities.
    • Optimize slow database queries using eager loading and proper indexing.

    Known limitations

    Does not support frontend-specific frameworks like Vue or React. Cannot execute migrations on production environments without explicit approval.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Frequently Asked Questions

    This assistant is specifically optimized for modern Laravel versions (8.x, 9.x, 10.x, and 11.x) using PHP 8.1+ and MySQL databases. It strictly follows the latest Laravel conventions, such as the use of Form Requests, API Resources, and Pest/PHPUnit testing.

    The assistant enforces security by default, automatically generating Authorization Policies and identifying common vulnerabilities like IDOR or mass-assignment. Every code snippet is audited to ensure data is properly scoped to the authenticated user or tenant.

    Yes, it can analyze your existing models and controllers to suggest eager loading strategies and proper database indexing. It specifically looks for N+1 query problems and can refactor complex Eloquent queries into high-performance solutions.

    This is a backend-focused tool that specializes in the server-side API layer, Eloquent models, and business logic. It does not provide support for frontend scaffolding, CSS styling, or JavaScript frameworks like Vue, React, or Livewire.

    Once you add this skill to your AI workspace, you can share specific file contexts (like a Model or Controller) to receive targeted refactoring, or provide a feature requirement to have the assistant generate the full API stack from migration to test.

    Unlike generic AI, this skill is pre-configured with a "Security-First" checklist that audits every line of code for Laravel-specific risks. It also enforces consistent architecture, such as moving logic out of controllers and into Service or Action classes by default.

    New in APIs & Backend

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.

    Free