Was wondering what would be the right way to this?
Trying out Backpack and ran into simple issue. I have Post
and User
and there is User
hasMany
Post
relation. Now since I have CrudController
how would go about setting current backpack_user()
as Post
User
. I mean I can hook model events (https://laravel.com/docs/11.x/eloquent#events) and do it that way, but it seems bit of an hassle. Didn’t find from Backpack docs whether there is better way or not.
tried to add $this->crud->model->user()->associate(backpack_user());
to setupCreateOperation
and setup
in my PostCrudController
backpack just ignores these.
Kaspar Martin Suursalu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.