Package Data | |
---|---|
Maintainer Username: | lupka |
Maintainer Contact: | alex@alexchalupka.com (Alex Chalupka) |
Package Create Date: | 2017-01-16 |
Package Last Update: | 2017-01-17 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-19 03:03:52 |
Package Statistics | |
---|---|
Total Downloads: | 13 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 2 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
[](LICENSE)
composer require lupka/crudder
Add the new provider to the providers
array of config/app.php
:
'providers' => [
// ...
Lupka\Crudder\CrudderServiceProvider::class,
// ...
],
Add the new Crudder alias to the aliases
array of config/app.php
:
'aliases' => [
// ...
'Crudder' => Lupka\Crudder\CrudderFacade::class,
// ...
],
Add a call to Crudder::routes()
wherever you want within your routes file. The example below uses a route group with a prefix and auth middleware:
Route::group(['prefix' => 'crudder', 'middleware' => 'auth'], function(){
Crudder::routes();
});
Publish the Crudder config file by running the following command:
php artisan vendor:publish --tag=config
All you need to do to get started is enter the class name of the Eloquent Model you want to have an admin for in the crudder.php
config file.
'models' => [
'App\BlogPost' => []
]
Crudder will use a basic form based on the field types in your database.
If you want to modify values programmatically before/after saving, I recommend using observers: https://laravel.com/docs/5.3/eloquent#observers