laravel-api-jsonapi

laravel-api-jsonapi is a skill for Claude Code, Codex from elmochilyas/laraskills. It costs 0 tokens per session (3,967 once invoked), scanned A, original, MIT.

A guide for building Laravel 13 APIs that follow JSON:API, a standard format for returning data, relationships, links, errors, and page results.

In plain words
What is it for?
Use it to define API resources, related records, selected fields, included data, links, metadata, errors, and pagination.
Why use it?
It prevents each API endpoint from inventing its own response structure, which makes integrations harder to maintain.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to define API resources, related records, selected fields, included data, links, metadata, errors, and pagination.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/elmochilyas/laraskills/laravel-api-jsonapi
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add elmochilyas/laraskills --skill laravel-api-jsonapi
Clone the repo
git clone --depth 1 https://github.com/elmochilyas/laraskills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for laravel-api-jsonapi

README.md
[![agentmods](https://agentmods.dev/badge/skills/elmochilyas/laraskills/laravel-api-jsonapi/github.svg)](https://agentmods.dev/skills/elmochilyas/laraskills/laravel-api-jsonapi)
Your own site
<a href="https://agentmods.dev/skills/elmochilyas/laraskills/laravel-api-jsonapi"><img src="https://agentmods.dev/badge/skills/elmochilyas/laraskills/laravel-api-jsonapi/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for laravel-api-jsonapi

Your own site · 80×15
<a href="https://agentmods.dev/skills/elmochilyas/laraskills/laravel-api-jsonapi"><img src="https://agentmods.dev/badge/skills/elmochilyas/laraskills/laravel-api-jsonapi.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,967 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.03967
Opus 5 $0.00000 $0.01983
Sonnet 5 $0.00000 $0.00793
Haiku 4.5 $0.00000 $0.00397

Measured 9d ago against content hash 0f66f485ba5f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

laravel-api-jsonapi scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/laravel-api-jsonapi/SKILL.md · 747 lines

How it starts

The opening of the file, as written. The whole thing — 747 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Laravel 13 JSON:API — First-Party Resources

When to Use

Use this skill when building APIs that need strict JSON:API specification compliance. Laravel 13 ships with a native JsonApiResource class that produces spec-compliant responses without external packages. Covers resource definition, attributes, relationships, sparse fieldsets, includes, compound documents, links, meta objects, error handling, and pagination. Preferred for large public APIs, enterprise integrations, and mobile backends.


Laravel 13 Native JSON:API Resources

Generating a JSON:API Resource

php artisan make:resource PostResource --json-api

This generates a class extending Illuminate\Http\Resources\JsonApi\JsonApiResource with $attributes and $relationships properties.

Basic Resource Structure

namespace App\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\JsonApi\JsonApiResource;

class PostResource extends JsonApiResource
{
    public $attributes = [
        'title',
        'content',
        'status',
    ];

    public $relationships = [
        'author' => AuthorResource::class,
    ];
}

This produces:

{
    "data": {
        "type": "posts",
        "id": "1",
        "attributes": {
            "title": "Hello World",
            "content": "Post content here",
            "status": "published"
        },
        "relationships": {
            "author": {
                "data": {
                    "type": "authors",
                    "id": "5"
                }
            }
        },
        "links": {
            "self": "/api/v1/posts/1"
        }
    }
}

Defining Attributes

Simple Attribute List

class UserResource extends JsonApiResource
{
    // Simple array — auto-resolves from model attributes
    public $attributes = [
        'name',
        'email',
        'role',
    ];
}

Closure-Wrapped Attributes (Dynamic Values)

class UserResource extends JsonApiResource
{
    public $attributes = [
        'name',
        'email',
        'is_admin' => fn () => $this->is_admin,
        'created_at' => fn () => $this->created_at->toIso8601String(),
        'avatar_url' => fn () => $this->avatar_url,
    ];
}

Read the full file on GitHub · 747 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 747 lines · 0 tokens per session scan A 0f66f485ba5f

Subscribe to this mod's changes

laravel-api-jsonapi is a skill published in the GitHub repository elmochilyas/laraskills (8 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,967 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

laravel-specialist

Build and configure Laravel 10+ applications, including creating Eloquent models and relationships, implementing Sanctum authentication, configuring Horizon queues, designing RESTful APIs with API resources, and building reactive interfaces with Livewire. Use when creating Laravel models, setting up queue workers…

Jeffallan/claude-skills · 86 tokens

create-powergrid-plugin

Create a complete PowerGrid plugin from scratch, including PHP class, Column macro, Blade view, Alpine.js component, and registration.

Power-Components/livewire-powergrid · 31 tokens

owl-admin-devtools-generator

A development guide for Owl Admin, a Laravel-based administration system, covering its code generator, API templates, relationships, and visual pages.

slowlyo/owl-admin · 82 tokens

llamaindex-development

Expert guidance for LlamaIndex development including RAG applications, vector stores, document processing, query engines, and building production AI applications.

Mindrally/skills · 32 tokens

craftcms

Craft CMS 5 plugin and module development — extending Craft with PHP. Covers elements, element queries, services, models, records, controllers, migrations, queue jobs, console commands, field types, native fields, events, behaviors, Twig extensions, widgets, filesystems, permissions, project config, GraphQL, testing…

michtio/craftcms-claude-skills · 327 tokens

php-development

Expert guidance for PHP 8+ development with SOLID principles, PSR standards, and modern best practices.

Mindrally/skills · 24 tokens