1

For my project I'm using a Laravel backend with Backpack installed. Currently Backpack has generated a CRUD controller for my Role model but I want to add a field. Since this CRUD controller isn't in my project I can't edit this controller. So I wanted to create a new CRUD controller for my Role model. So I ran the following command:

php artisan backpack:crud role

When it asked for a type I gave field as value. When I run this I get an exception as can be seen in the added image.

CLI backpack exception

I tried using different types (request, etc.) but I got the same exception. I also tried updating Backpack, but this didn't help.

1 Answer 1

1

About your error please have a look at: https://github.com/Laravel-Backpack/community-forum/discussions/500

The problem is that your routes/backpack/custom.php file does not have the expected end line.

To add fields etc in your roles, you can simply create a new App/RoleController extends Package/RoleController and then bind your new controller in a ServiceProvider.

Follow the instructions here: https://github.com/Laravel-Backpack/PermissionManager#customize-usercrudcontroller

Cheers

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.