0👍
You need to add use App\Models\Category;
on top of controller.
Update, Next there is a type on Request
as well, you need to update to:
public function store(Request $request, Category $category)
you are using Reqeust
instead.
Also, I am not sure, if there will $category on store case, because the model might only be supplied while updating.
- [Vuejs]-Uncaught TypeError: Cannot read properties of undefined (reading 'post') – Creating a Laravel Vue page with Inertia.js
- [Vuejs]-Invalid form for default selected option in Vue
Source:stackexchange.com