I am trying to authorise the user to submit a post request, by using a Request within Laravel. The error I am getting is:
ReflectionException in RouteDependencyResolverTrait.php line 57: Class App\Http\Controllers\UpdateClinicDescriptionFormRequest does not exist
It's as if Laravel is trying to look within Controllers for the Request, but it's clearly in the Request's folder.
The UpdateClinicDescriptionFormRequest.php file is in the Request's folder.
The function trying to access to Request is:
public function postUpdateDescription(UpdateClinicDescriptionFormRequest $request, $id)
{
$clinic = Clinic::find($id);
$clinic->description = Input::get('description');
$clinic->save();
return redirect()->back();
}
Any help would be hugely appreciated.
It looks like you haven't imported it. Add this at the top of your controller, after the namespace declaration:
use App\Http\Requests\UpdateClinicDescriptionFormRequest;
And make sure that file is properly namespaced:
namespace App\Http\Requests;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With