CRUD: Can't use InlineCreate - array_filter() expects parameter 1 to be array, null given
Hi,
I wanna use the InlineCreate operation and do some things on create and update methods.
When I have the request as argument :
public function store(StoreRequest $request){ ... }
I have this error :
Too few arguments to function App\\Http\\Controllers\\Admin\\OrderItemCrudController::store(), 0 passed
And when I remove request from argument, and use this in the method :
$this->crud->request->request->get('...')
I have this error :
Cannot access protected property Backpack\\CRUD\\app\\Library\\CrudPanel\\CrudPanel::$request
Is there a way to get the request with the InlineCreate operation ?
Thanks for your help,
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 52 (27 by maintainers)
Commits related to this issue
- fix #2708 — committed to Laravel-Backpack/CRUD by tabacitu 4 years ago
Could this be the order of the Operations ? I see Inline before the Create.
Not sure, but might worth try to clear our mind out of it.
EDIT:
F — * ---- * —K !!! It’s the order @tabacitu
It’s taken months, but that’s it. Once I moved InlineCreate below Create, it worked and everything saved properly
Yes! In LARGE BOLD LETTERS.
Jameson W Parker
Ok my bad ! I see now that in Backpack 4.1.x we have to use :
$this->crud->getRequest()So it’s okay, sorry !
Edit: I encountered this issue but the problem was that I had manually set the routes for a CRUD controller, but didn’t update those routes when I upgraded backpack.
This works for me. Definitely keep me posted if you find a fix!
Thank you for your help. I really appreciate it.