diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 6a139e2..4d869bc 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -5,6 +5,7 @@ use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Illuminate\Auth\AuthenticationException; +use Illuminate\Http\Request; use Throwable; class Handler extends ExceptionHandler @@ -32,17 +33,13 @@ public function register() }); - $this->renderable(function (NotFoundHttpException $e, $request) { - - - if ($request->is('api/*')) { - return response()->json([ - 'status' => -1, - ], 404); - } else { - return redirect()->route('front.home'); - } - }); + $this->renderable(function (NotFoundHttpException $e, $request) { + if ($request->is('api/*')) { + return response()->json([ + 'status' => -1 + ], 404); + } + }); } /** diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..9e96df4 Binary files /dev/null and b/public/favicon.ico differ diff --git a/routes/web.php b/routes/web.php index 6e8e4b5..db3d5b9 100644 --- a/routes/web.php +++ b/routes/web.php @@ -27,4 +27,6 @@ Route::get('/news/{slug}', [App\Http\Controllers\Front\FrontPostController::class, 'index'])->name('front.post'); -Route::get('/{category_slug}', [App\Http\Controllers\Front\FrontListController::class, 'category'])->name('front.category'); +Route::get('/{category_slug}', [App\Http\Controllers\Front\FrontListController::class, 'category']) + ->where('category_slug', '^(automotive|business|trading|information-technology|marketing|office|telecommunications|food-drink|collectibles|pets|photography|hobbies-gifts|hunting-fishing|law|politics|home-garden|shopping|fashion-clothing|real-estate|family|wedding|immigration|society|education|languages|health|beauty|psychology|wellness|religion-spirituality|tips-tricks|how-to|holiday|world-festivals|travel|outdoors|computer|phones|gadgets|technology|social-networks)$') + ->name('front.category');