laravel-restify
Laravel API for Ai Agents and humans.
claude mcp add --transport stdio binarcode-laravel-restify php artisan restify:setup
How to use
Laravel Restify is a powerful tool for building a fully customizable JSON:API in Laravel. It provides a zero-config approach to generating RESTful CRUD endpoints for your Eloquent models, with built-in protections and a clean, declarative setup that minimizes boilerplate. Once installed in a Laravel project, you can generate repositories and expose REST resources quickly, and then interact with them via standard HTTP requests using JSON:API conventions or the package’s conventions. Use the provided artisan commands to set up Restify, scaffold repositories, and then invoke typical CRUD endpoints to manage your resources through the API.
With Restify, you can: install the package and run the setup command to initialize configuration, generate repositories for your models (which creates the necessary controllers, routes, and policies), and then perform CRUD operations on the resources. You can test endpoints using tools like Postman or cURL; for example, you can list resources, create new ones, retrieve a single resource, update it, and delete it via standard REST endpoints under the api/restify/{resource} namespace. The library aims to reduce boilerplate while providing a JSON:API-compliant structure and easy customization options via configuration and providers in Laravel. For more advanced usage, refer to the official Restify documentation linked in the repository for details on permissions, validation, and customization hooks.
How to install
Prerequisites:
- PHP (version 7.4 or newer) and a Laravel-compatible environment
- Composer
- A Laravel project set up and configured
Installation steps:
-
Create or navigate to your Laravel project
-
Install the Restify package via Composer:
composer require binaryk/laravel-restify
-
Publish the package configuration and assets if applicable (follow the package’s docs; typically you may run setup commands after installation)
-
Run the setup command to initialize Restify for your project:
php artisan restify:setup
-
Generate repositories for your models (example with a Dream model):
php artisan restify:repository Dream --all
-
Serve your Laravel application and access the REST endpoints under the defined API namespace, for example: GET /api/restify/dreams
If you are starting from scratch, ensure your Laravel project is properly configured (database, migrations, etc.) before generating repositories.
Additional notes
Tips and considerations:
- Ensure your PHP version and Laravel version are compatible with the Restify version you are installing.
- After generating repositories, you may want to customize policies, validation rules, and resource representations to fit your API’s requirements.
- Routes and endpoints typically follow the JSON:API conventions; refer to the official Restify documentation for exact route patterns and response structures.
- If you encounter issues, check your Laravel logs and the package’s CHANGELOG for compatibility notes with Laravel releases.
- This package is Laravel-based; there is no separate Node, Python, or container runtime required for its core functionality beyond a normal Laravel deployment.
Related MCP Servers
better-chatbot
Just a Better Chatbot. Powered by Agent & MCP & Workflows.
laravel
A Laravel package for implementing secure Model Context Protocol servers using Streamable HTTP and SSE transport, providing real-time communication and a scalable tool system for enterprise environments.
relay
An MCP client tool for Prism
laravel-toon
TOON encoding for Laravel. Encode data for AI/LLMs with ~50% fewer tokens than JSON.
mcpcat-python-sdk
MCPcat is an analytics platform for MCP server owners 🐱.
php -sdk
PHP implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools. ✨ Features 🚀 Complete MCP Protocol Support - Full implementation of the MCP specification 🔧 Type-Safe - Leverages PHP 8.1+ type system with enums, union types, and strict typing ⚡ Async First