Skip to content
Back to search

laravel-restify

Laravel API for Ai Agents and humans.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/BinarCode/laravel-restify with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/BinarCode/laravel-restify'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/binarcode--laravel-restify/badge.svg)](/listings/binarcode--laravel-restify)

HTML

<a href="/listings/binarcode--laravel-restify"><img src="/api/listings/binarcode--laravel-restify/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

composer require binaryk/laravel-restify

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 251 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <p align="center"><img src="/docs-v2/static/logo.png"></p>
  2. <p align="center">
  3. <a href="https://github.com/BinarCode/laravel-restify/actions"><img src="https://github.com/BinarCode/laravel-restify/actions/workflows/tests.yml/badge.svg" alt="Build Status"></a>
  4. <a href="https://packagist.org/packages/binaryk/laravel-restify"><img src="https://poser.pugx.org/binaryk/laravel-restify/d/total.svg" alt="Total Downloads"></a>
  5. <a href="https://packagist.org/packages/binaryk/laravel-restify"><img src="https://poser.pugx.org/binaryk/laravel-restify/v/stable.svg" alt="Latest Stable Version"></a>
  6. <a href="https://packagist.org/packages/binaryk/laravel-restify"><img src="https://poser.pugx.org/binaryk/laravel-restify/license.svg" alt="License"></a>
  7. </p>
  8. # Unified Laravel API Layer for Humans and AI
  9. **One Codebase. REST for Humans, MCP for AI Agents.**
  10. Laravel Restify turns your Eloquent models into both JSON:API endpoints and MCP servers -- automatically. Build once, and instantly serve APIs that work seamlessly for developers, apps, and AI agents.
  11. ## 🚀 The Power of One Codebase
  12. Traditional API development requires separate implementations for different consumers. Laravel Restify changes that:
  13. - **👥 Humans** get full-featured JSON:API endpoints
  14. - **🤖 AI Agents** get structured MCP (Model Context Protocol) servers
  15. - **🔒 Same Rules** - All authentication, authorization, and policies apply to both
  16. - **📝 One Definition** - Write your repository once, serve everywhere
  17. ## Key Features
  18. - **JSON:API Endpoints** - Full [JSON:API](https://jsonapi.org) specification compliance
  19. - **MCP Server Generation** - Automatic AI agent interfaces with tool definitions
  20. - **Unified Authorization** - Laravel policies protect both human and AI access
  21. - **Search & Filtering** - Powerful query capabilities for all consumers
  22. - **Authentication** - Laravel Sanctum integration for secure access
  23. - **GraphQL Support** - Auto-generated GraphQL schemas
  24. - **Field Validation** - Consistent validation rules across all interfaces
  25. ## Installation
  26. ```bash
  27. composer require binaryk/laravel-restify
  28. ```
  29. ## Quick Start
  30. **1. Setup the package:**
  31. ```bash
  32. php artisan restify:setup
  33. ```
  34. **2. Create your first repository:**
  35. ```bash
  36. php artisan restify:repository PostRepository --all
  37. ```
  38. **3. Enable MCP for AI agents (optional):**
  39. Add to your `config/ai.php`:
  40. ```php
  41. use Binaryk\LaravelRestify\MCP\RestifyServer;
  42. use Laravel\Mcp\Facades\Mcp;
  43. Mcp::web('restify', RestifyServer::class)
  44. ->middleware(['auth:sanctum'])
  45. ->name('mcp.restify');
  46. ```
  47. **That's it!** Your API now serves both:
  48. **For Humans (JSON:API):**
  49. ```bash
  50. GET /api/restify/posts
  51. POST /api/restify/posts
  52. PUT /api/restify/posts/1
  53. DELETE /api/restify/posts/1
  54. ```
  55. **For AI Agents (MCP):**
  56. ```bash
  57. GET /mcp/restify # Tool definitions and capabilities
  58. ```
  59. ## Example Repository
  60. ```php
  61. use Binaryk\LaravelRestify\Http\Requests\RestifyRequest;
  62. use Binaryk\LaravelRestify\Repositories\Repository;
  63. use Binaryk\LaravelRestify\Attributes\Model;
  64. #[Model(Post::class)]
  65. class PostRepository extends Repository
  66. {
  67. public function fields(RestifyRequest $request): array
  68. {
  69. return [
  70. field('title')->rules('required', 'string', 'max:255'),
  71. textarea('content')->rules('required'),
  72. field('author')->readonly(),
  73. datetime('published_at')->nullable(),
  74. ];
  75. }
  76. }
  77. ```
  78. This single definition automatically provides:
  79. - ✅ JSON:API CRUD endpoints with validation
  80. - ✅ MCP tools for AI agents with the same validation
  81. - ✅ Authorization policies applied to both interfaces
  82. - ✅ Search and filtering capabilities for all consumers
  83. ## One Codebase, Two Outputs
  84. Here's what you get from one repository definition:
  85. ### For Humans (JSON:API Response)
  86. ```bash
  87. GET /api/restify/posts
  88. ```
  89. ```json
  90. {
  91. "data": [
  92. {
  93. "id": "1",
  94. "type": "posts",
  95. "attributes": {
  96. "title": "Laravel Restify Guide",
  97. "content": "Build APIs fast...",
  98. "published_at": "2024-01-15"
  99. }
  100. }
  101. ],
  102. "links": {
  103. "self": "/api/restify/posts",
  104. "next": "/api/restify/posts?page=2"
  105. }
  106. }
  107. ```
  108. ### For AI Agents (MCP Tool Definition)
  109. ```bash
  110. GET /mcp/restify # Tool definitions for AI agents
  111. ```
  112. ```json
  113. {
  114. "tools": [
  115. {
  116. "name": "posts-index-tool",
  117. "description": "Retrieve a paginated list of Post records from the posts repository with filtering, sorting, and search capabilities.",
  118. "inputSchema": {
  119. "type": "object",
  120. "properties": {
  121. "page": {
  122. "type": "number",
  123. "description": "Page number for pagination"
  124. },
  125. "perPage": {
  126. "type": "number",
  127. "description": "Number of posts per page"
  128. },
  129. "search": {
  130. "type": "string",
  131. "description": "Search term to filter posts by title or content"
  132. },
  133. "sort": {
  134. "type": "string",
  135. "description": "Sorting criteria (e.g., sort=title or sort=-published_at for descending)"
  136. },
  137. "title": {
  138. "type": "string",
  139. "description": "Filter by exact match for title (e.g., title=Laravel). Accepts negation with -title=value"
  140. },
  141. "published_at": {
  142. "type": "string",
  143. "description": "Filter by publication date (e.g., published_at=2024-01-15)"
  144. }
  145. }
  146. }
  147. }
  148. ]
  149. }
  150. ```
  151. **All generated from this simple repository:**
  152. ```php
  153. #[Model(Post::class)]
  154. class PostRepository extends Repository
  155. {
  156. use HasMcpTools;
  157. public function fields(RestifyRequest $request): array
  158. {
  159. return [
  160. field('title')->required()->matchable(),
  161. field('content'),
  162. field('published_at')->rules('date')->matchable(),
  163. ];
  164. }
  165. }
  166. ```
  167. ## Restify Boost
  168. **Laravel Restify Boost** is a development companion that provides MCP server capabilities to help you build Restify APIs faster with AI assistance.
  169. **Repository:** [laravel-restify-boost](https://github.com/BinarCode/laravel-restify-boost)
  170. **Features:**
  171. - Documentation access for AI agents
  172. - Repository and action generation assistance
  173. - Code examples and best practices
  174. - Integration with Claude Desktop and other AI tools
  175. **Installation:**
  176. ```bash
  177. composer require --dev binarcode/laravel-restify-boost
  178. ```
  179. ## Templates
  180. Need a production-ready starting point? Check out [Restify Templates](https://restifytemplates.com) for complete API starter kits with authentication, permissions, and team management.
  181. ## Resources
  182. - **[Documentation](https://laravel-restify.com)** - Complete guides and API reference
  183. - **[Demo Repository](https://github.com/BinarCode/restify-demo)** - Working example
  184. - **[Video Course](https://www.binarcode.com/learn/restify)** - Visual learning resource
  185. ## Testing
  186. ```bash
  187. composer test
  188. ```
  189. ## Contributing
  190. Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
  191. ## Security
  192. If you discover any security related issues, please email eduard.lupacescu@binarcode.com instead of using the issue tracker.
  193. ## Credits
  194. - [Eduard Lupacescu](https://twitter.com/LupacescuEuard)
  195. - [Koen Koenster](https://github.com/Koenster)
  196. - [All Contributors](../../contributors)
  197. Built by [BinarCode](https://www.binarcode.com) - makers of [Routines](https://getroutines.ai/?ref=restify), an AI assistant for your Mac.
  198. ## License
  199. The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.