[英]Can't access Laravel admin panel
I'm new to the laravel framework. 我是laravel框架的新手。 I bought a project and I installed it but when I try to login to the admin panel localhost/admin/home it redirects me to the first page.
我买了一个项目并安装了它,但是当我尝试登录管理面板localhost / admin / home时,它会将我重定向到第一页。 Why is this?
为什么是这样? Is the problem in the authentication?
身份验证中存在问题吗?
The template is adminLTE . 模板是adminLTE 。
This is routes.php: 这是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');
});
Look at the post_login function in the HomeController there will be a return view or return redirect. 查看HomeController中的post_login函数,将会有一个返回视图或返回重定向。 You can change it to go to the view you wish.
您可以将其更改为转到您希望的视图。
Looks like you don't have admin
or correction
role. 看起来你没有
admin
或correction
角色。 Because of that you are redirected to /
. 因此,您被重定向到
/
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.