Reputation: 6342
I'm playing around with Laravel5 to test out custom exception. But It returns the error
Call to a member function send() on string
and I can't really figure out why.
1.routes.php
2.App/Exceptions/toshikiER.php
3.composer.php
4.App/Exceptions/Hanlder.php
Upvotes: 1
Views: 92
Reputation: 1208
If you take a look at the render method annotations.
/**
* Render an exception into a response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
You'll see that you have to return a \Illuminate\Htttp\Response.
I made my own exception too, I handle my new exception like this
return response()->view("your.view", [], 403);
Upvotes: 3