我是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');
});
答案 0 :(得分:0)
查看HomeController中的post_login函数,将会有一个返回视图或返回重定向。您可以将其更改为转到您希望的视图。
答案 1 :(得分:0)
您似乎没有admin
或correction
角色。因此,您被重定向到/
。