无法访问 Laravel 管理面板
Can't access Laravel admin panel
我是 laravel 框架的新手。我买了一个项目并安装了它,但是当我尝试登录管理面板时 localhost/admin/home 它会将我重定向到第一页。为什么是这样?是认证的问题吗?
模板是adminLTE。
这是routes.php:
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::group(['middleware' => ['web']], function () {
Route::auth();
Route::get('/', function () {
// $user = Auth::user();
// if($user->id == 2){
return view('welcome');
/* }else{
echo "Site En cours de mise a jours .. Veuillez patienter quelques minutes";
die();
}*/
});
Route::post('/post_login', 'HomeController@post_login');
Route::get('/admin/home', 'AdminController@index');
Route::get('/contact', 'HomeController@contact');
});
Route::group(['middleware' => 'web'], function () {
Route::get('/load_coup/{code}', 'HomeController@load_coup');
Route::get('/get_coup_div/{code}', 'HomeController@get_coup_div');
Route::get('/reset_coupon_div', 'HomeController@reset_coupon_div');
Route::get('/validate_coup/{price}/{type}', 'HomeController@validate_coup');
Route::get('/back', 'HomeController@back');
Route::get('/save/{price}', 'HomeController@save');
Route::get('/get_solde', 'HomeController@get_solde');
Route::get('/bet_list', 'HomeController@bet_list');
Route::get('/bet_list/{code}', 'HomeController@bet_details');
Route::get('/coupon/{id}', 'HomeController@print_coupon');
Route::get('/transaction/', 'HomeController@add_transaction');
Route::post('/transaction/', 'HomeController@store_transaction');
Route::get('/transaction_list/', 'HomeController@transaction_list');
Route::get('/profile/', 'HomeController@profile');
Route::post('/profile/', 'HomeController@edit_profile');
});
Route::group(['prefix' => 'admin', 'middleware' => ['web']], function () {
//Route::auth();
Route::get('/users', 'AdminController@user');
Route::get('/users/{id}', 'AdminController@edit_user');
Route::post('/update_user/', 'AdminController@update_user');
Route::post('/add_transaction/', 'AdminController@add_transaction');
Route::get('/match', 'AdminController@match');
//Route::post('/match', 'AdminController@match');
Route::get('/coupon', 'AdminController@coupon');
Route::get('/coupons/{id}', 'AdminController@edit_coupon');
});
查看 HomeController 中的 post_login 函数会有一个 return 视图或 return 重定向。您可以更改它以转到您想要的视图。
您似乎没有 admin
或 correction
角色。因此,您将被重定向到 /
.
我是 laravel 框架的新手。我买了一个项目并安装了它,但是当我尝试登录管理面板时 localhost/admin/home 它会将我重定向到第一页。为什么是这样?是认证的问题吗?
模板是adminLTE。
这是routes.php:
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::group(['middleware' => ['web']], function () {
Route::auth();
Route::get('/', function () {
// $user = Auth::user();
// if($user->id == 2){
return view('welcome');
/* }else{
echo "Site En cours de mise a jours .. Veuillez patienter quelques minutes";
die();
}*/
});
Route::post('/post_login', 'HomeController@post_login');
Route::get('/admin/home', 'AdminController@index');
Route::get('/contact', 'HomeController@contact');
});
Route::group(['middleware' => 'web'], function () {
Route::get('/load_coup/{code}', 'HomeController@load_coup');
Route::get('/get_coup_div/{code}', 'HomeController@get_coup_div');
Route::get('/reset_coupon_div', 'HomeController@reset_coupon_div');
Route::get('/validate_coup/{price}/{type}', 'HomeController@validate_coup');
Route::get('/back', 'HomeController@back');
Route::get('/save/{price}', 'HomeController@save');
Route::get('/get_solde', 'HomeController@get_solde');
Route::get('/bet_list', 'HomeController@bet_list');
Route::get('/bet_list/{code}', 'HomeController@bet_details');
Route::get('/coupon/{id}', 'HomeController@print_coupon');
Route::get('/transaction/', 'HomeController@add_transaction');
Route::post('/transaction/', 'HomeController@store_transaction');
Route::get('/transaction_list/', 'HomeController@transaction_list');
Route::get('/profile/', 'HomeController@profile');
Route::post('/profile/', 'HomeController@edit_profile');
});
Route::group(['prefix' => 'admin', 'middleware' => ['web']], function () {
//Route::auth();
Route::get('/users', 'AdminController@user');
Route::get('/users/{id}', 'AdminController@edit_user');
Route::post('/update_user/', 'AdminController@update_user');
Route::post('/add_transaction/', 'AdminController@add_transaction');
Route::get('/match', 'AdminController@match');
//Route::post('/match', 'AdminController@match');
Route::get('/coupon', 'AdminController@coupon');
Route::get('/coupons/{id}', 'AdminController@edit_coupon');
});
查看 HomeController 中的 post_login 函数会有一个 return 视图或 return 重定向。您可以更改它以转到您想要的视图。
您似乎没有 admin
或 correction
角色。因此,您将被重定向到 /
.