问题
I'm building a small app with Laravel and I juste discovered Backpack that looks very nice !
I downloaded it (I have a license), but I really don't know how to use it with my existing files (so far 3 controllers, 3 models and a few blade files)
Maybe the answer is somewhere in the documentation, but I could not find it..
A detailed explanation would be mutch appreciated !
Thank you all and have a nice day!
Cheers from France
回答1:
suppose you have model called Person ...
php artisan backpack:crud Person
the generated command will tell you that the model is existed... and it will generate the routes and Crud Controller for you ...
then you go to your model ... in 'use' section add:
use Backpack\CRUD\app\Models\Traits\CrudTrait;
and in your model body ... add
use CrudTrait;
you can also override the views ... witch i do not recommend unless you have good reason for that
https://backpackforlaravel.com/docs/4.1/upgrade-guide#views
来源:https://stackoverflow.com/questions/62116088/how-to-use-backpack-for-laravel-on-existing-project