I need to set a key=>value into the request that's pushed into Backpack's store method;
In v3 I had a working store method like so;
public function store(StoreRequest $request) {
$request->request->set('account_type', User::ACCOUNT_TYPE_BASIC);
$redirect_location = parent::storeCrud($request);
return $redirect_location;
}
but in trying to stay current for a still in development project I'm updating to v4 and running into a problem with adding/removing anything to/from the $request object when trying to utilize the traitStore or traitUpdate methods that are recommended in the documentation.
This does NOT work;
public function store(StoreRequest $request) {
$request->request->set('account_type', User::ACCOUNT_TYPE_BASIC);
$redirect_location = $this->traitStore();
return $redirect_location;
}
Specifically, the 'account_type' key is not included in the request that is sent to the database via traitStore, which uses only the fields defined in the (in this case) setupCreateOperation() method for this Crud.
Is there something I'm missing here or do I need to entirely manage the save/update on anything where I need to manipulate the request instead of utilizing the various backpack crud methods?