Every one. Nice to meet you.
My code is below.
-controller.php
public function admin(Request $request) {
if ($request->ajax()) {
$users = \DB::table('users')->leftJoin('roles', 'users.role_id', '=', 'roles.id')->select('users.id as id', 'roles.name as role_name', 'users.*')->get();
...
return Datatables::of(results)->make();
}
return view('frontend.homepage.admin');
-web.php
Route::prefix("admin")->middleware(["auth:admin"])->group(function(){
Route::get('dashboard', ['as' => 'homepage.admin', 'uses' => 'PagesController@admin']);
});
But I have one error like as below.
{ "message": "", "exception": "Symfony\Component\HttpKernel\Exception\NotFoundHttpException", "file": "E:\Uniclix_Source\API\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php", "line": 179, "trace": [ { "file": "E:\Uniclix_Source\API\vendor\laravel\framework\src\Illuminate\Routing\Router.php", "line": 636, "function": "match", "class": "Illuminate\Routing\RouteCollection", "type": "->" }, { "file": "E:\Uniclix_Source\API\vendor\laravel\framework\src\Illuminate\Routing\Router.php", "line": 625, "function": "findRoute", "class": "Illuminate\Routing\Router", "type": "->" }, { "file": "E:\Uniclix_Source\API\vendor\laravel\framework\src\Illuminate\Routing\Router.php", "line": 614, "function": "dispatchToRoute", "class": "Illuminate\Routing\Router", "type": "->" }, { "file": "E:\Uniclix_Source\API\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php", "line": 176, "function": "dispatch", "class": "Illuminate\Routing\Router", "type": "->" }, { "file": "E:\Uniclix_Source\API\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php", "line": 30, "function": "Illuminate\Foundation\Http\{closure}", "class": "Illuminate\Foundation\Http\Kernel", "type": "->" }
Who can help me?
/admin/dashboard
. You can verify all of your routes by doingphp artisan routes:list
to see all of your registered routes. – aynber