Skip to content

Commit

Permalink
handle model not found in view
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jul 15, 2023
1 parent cc40ac1 commit b5299bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Illuminate/View/Engines/CompilerEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Illuminate\View\Engines;

use Illuminate\Database\RecordsNotFoundException;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\View\Compilers\CompilerInterface;
Expand Down Expand Up @@ -102,7 +103,9 @@ public function get($path, array $data = [])
*/
protected function handleViewException(Throwable $e, $obLevel)
{
if ($e instanceof HttpException || $e instanceof HttpResponseException) {
if ($e instanceof HttpException ||
$e instanceof HttpResponseException ||
$e instanceof RecordsNotFoundException) {
parent::handleViewException($e, $obLevel);
}

Expand Down

0 comments on commit b5299bb

Please sign in to comment.