There is few small steps to have working admin panel , that would take less than 10min .
- Install the LaravelPanel .
- login and test the LaravelPanel , you should see empty dashboard at this point.
- Make crud with crud commands .
- Add your fileds to crud controller you have created .
- Test your crud controller with going to yourdomain.com/panel
- create custom contoller for other type of admin parts (Optional)
Panel Commands, files & namespaces
The LaravelPanel package adds three new artisan commands.
The first command
panel:crud is a useful combination of the other two commands,
and creates both a new model and a matching controller.
panel:createcontroller commands provide the flexibility to create
models and controllers in any location suited to the project structure.
For all LaravelPanel commands, if the entity name (only) is supplied then LaravelPanel will use default locations that match the base Laravel structure. For models, this is the app folder, and for controllers, the app/Http/Controllers folder
$ php artisan panel:crud Foo will create a new model class
Foo, and also a matching controller class
The model file will be app/Foo.php. It will be namespaced as
class FOO extends Model;
The controller file will be app/Http/Controllers/FooController.php, with a namespace of
(Note: the model and the controller then need fleshing out with your code)
Alternative locations for Models and/or Controllers
The default locations for models and controllers may be just fine, especially for small projects! But with a large number of models it may be preferred to keep models and controllers stored elsewhere to fit your project structure. For example, keeping all models in an app/Models folder. This can easily be achieved using the two separate LaravelPanel commands provided.
For example, creating a Post model and PostController.
panel:createmodel Models/Post will create the model file app/Models/Post folder, namespaced to
panel:createcontroller Blog/PostController will create file app/Http/Controllers/Blog/PostController.php, again with a correct namespace.
If a complete path is supplied to the panel command (starting with /App), that will also be respected.
panel:createmodel /App/Blog/Post and
panel:createcontroller /App/Blog/PostController will create both the model
and controller files in the app/Blog/ folder.