thilagaraja / laravelcurdmvc
There is no license information available for the latest version (dev-master) of this package.
dev-master
2023-03-25 17:12 UTC
This package is auto-updated.
Last update: 2025-05-25 21:45:52 UTC
README
Description about package
- This package is useful for Developers to easily create a CRUD (Create, Read, Update, Delete) for API Integration.
- Below are the command to use this feature.
composer require thilagaraja/laravelcurdmvc
composer require intervention/image
System require
- PHP
- Laravel
- MySQL
add below in config/app.php
- under the provide
Thilagaraja\Laravelcurdmvc\LaravelCurdMvcProvider::class
- under the allases
'Input' => Illuminate\Support\Facades\Request::class,
Need to disable csrf
- App\Http\Middleware\VerifyCsrfToken.php
protected $except = [
'webhook/*', // Disable CSRF protection for routes matching the "webhook/*" pattern
];
- install below package for the following error => class 'form' not found
composer require laravelcollective/html
CRUD Operation API's
Step 1 : Master API for module creation
- API Name : http://localhost:8000/master
- Method : POST
- payload :
{
"module" : "module name here",
"fields" : [
{
"column" : "email",
"date_type" : "string",
"required" : true,
"unique" : true
},
{
"column" : "image",
"date_type" : "string"
}
]
}
- Data types : string, integer, date, dateTime, bigInteger
- See the json file all data types Sample Payload
- This package will create one master table in your project for unique module validation. The table name is crud_master and avatar table for image upload.
- If you want to image column on module, you need to specify column name as 'image'. So it automatically consider as file upload.
- And each module has an seperate table.
Step 2 : Run migration for table creation
- After run the master module api, below file will be created automatically in your project folder
- Migration file, Controller file, Module File and routes on web.php file.
- Need to run following command
php artisan migrate
- As of now we have only create table migration. If you want to alter table You can manually update the migration file as usual.
Step 3 : Use the API End points
- Now you can download the postman collection for CRUD Operation Download Collection
- API End Points
- List Api : GET : http://localhost:8000/webhook/module_name
- Store Api : POST : http://localhost:8000/webhook/module_name
- Edit Api : GET : http://localhost:8000/webhook/module_name/4/edit // => 4 is primary ID of the table
- Update Api : PUT : http://localhost:8000/webhook/module_name/4
- Delete Api : DELETE : http://localhost:8000/webhook/module_name/4
- Status Change : GET : http://localhost:8000/webhook/module_name/4/{param}/status // {param} 1 is Active, 0 is InActive, 2 is Delete