Download the PHP package axyr/laravel-tractor without Composer
On this page you can find all versions of the php package axyr/laravel-tractor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download axyr/laravel-tractor
More information about axyr/laravel-tractor
Files in axyr/laravel-tractor
Package laravel-tractor
Short Description Opiniated Laravel CRUD generator for a Module/Repository/Filter based CRUD setup.
License MIT
Informations about the package laravel-tractor
🚜 Laravel Tractor - Another Laravel API Module Generator
Scaffold a Laravel module structure for JSON API's.
Introduction
Laravel Tractor is another module scaffolder for generating the basic PHP classes commonly used for JSON API's. The scaffolder is mainly targetted on stand alone API's without any Blade, Livewire or any other frontend library.
After installing, you can generate all required files for a working CRUD based module:
Above command will generate a basic module structure with all the files needed for a model based JSON API.
The module will have boilerplate tests that tests all the permission authorization, database operations and filters.
Examples
A full example of a generater module can be found here:
TODO
We generate the bare minimum, but workable and testable code, some examples:
Model
Controller
PermissionSeeder
For every resource we create a seeder that stores a permission for each Controller action:
ControllerAuthorizationTest
The ControllerAuthorizationTest test every permission for an allowed user and a restricted user. In this way we are sure every Controller actions can be finegrained assigned to any future role.
Documentation
https://axyr.gitbook.io/laravel-tractor
Quick start
Run the composer install command from the terminal:
Then you can generate a Module for a Model resource:
After that you can run the tests:
From here, you can start extending the module with your specific business cases.
For further information and customisation, visit our documentation page:
All versions of laravel-tractor with dependencies
laravel/framework Version ^11.0
wikimedia/composer-merge-plugin Version ^2.1
spatie/laravel-permission Version ^6.0