Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

crazymonster's avatar

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.

0 likes
5 replies
popcone's avatar

use only abort(404) not return abort(404)

crazymonster's avatar

I found it's passed through index.php $response->send(); at line 56

There is the problem. I don't know how to fix it yet. @habeebnet - that is not a problem.

crazymonster's avatar

@tomi i did try it before but no change (I found this one issue on github). I found if I change the view which is invoked and the problem is fixed. But when I try error page and something is wrong.

crazymonster's avatar
crazymonster
OP
Best Answer
Level 1

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.