use only abort(404) not return abort(404)
Method [send] does not exist on view.
Route::get('test', function (\Illuminate\Http\Request $request) {
if (some condition) {
$exitCode = Artisan::call('command', []);
} else {
return abort(404);
}
});
In this case, the script has been proceed return abort(404); Actually, it's printed 404 page but in storage/logs has been occurred an error: BadMethodCallException: Method [send] does not exist on view. in /vendor/laravel/framework/src/Illuminate/View/View.php:394
Stack trace: #0 /vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(107): Illuminate\View \View->__call('send', Array)
Also, I tried to invoke return response or view('error.404) but the error is still there.
Okey guys. I found the problem. In my 404 page have:
<i class="pe-7s-way text-success big-icon"></i>
So, there isn't that icon and increased exception.
Also, I changed abort(404) to
return response()->make(view('errors.404'), 404);
Thank you :)
Please or to participate in this conversation.