2017-01-18 4 views
1

laravel 프레임 워크를 처음 사용했습니다. 프로젝트를 구입하고 설치했지만 관리자 패널에 로그인하려고 시도하면 localhost/admin/home 첫 페이지로 리디렉션됩니다. 왜 이런거야? 인증에 문제가 있습니까?Laravel 관리자 패널에 액세스 할 수 없습니다.

템플릿은 adminLTE입니다.

이 routes.php 경우 : HomeController의 post_login 기능에서

<?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', '[email protected]_login'); 
    Route::get('/admin/home', '[email protected]'); 
    Route::get('/contact', '[email protected]'); 
}); 

Route::group(['middleware' => 'web'], function() { 

    Route::get('/load_coup/{code}', '[email protected]_coup'); 
    Route::get('/get_coup_div/{code}', '[email protected]_coup_div'); 
    Route::get('/reset_coupon_div', '[email protected]_coupon_div'); 
    Route::get('/validate_coup/{price}/{type}', '[email protected]_coup'); 
    Route::get('/back', '[email protected]'); 
    Route::get('/save/{price}', '[email protected]'); 
    Route::get('/get_solde', '[email protected]_solde'); 
    Route::get('/bet_list', '[email protected]_list'); 
    Route::get('/bet_list/{code}', '[email protected]_details'); 
    Route::get('/coupon/{id}', '[email protected]_coupon'); 
    Route::get('/transaction/', '[email protected]_transaction'); 
    Route::post('/transaction/', '[email protected]_transaction'); 
    Route::get('/transaction_list/', '[email protected]_list'); 

    Route::get('/profile/', '[email protected]'); 
    Route::post('/profile/', '[email protected]_profile'); 

}); 

Route::group(['prefix' => 'admin', 'middleware' => ['web']], function() { 
    //Route::auth(); 
    Route::get('/users', '[email protected]'); 
    Route::get('/users/{id}', '[email protected]_user'); 
    Route::post('/update_user/', '[email protected]_user'); 
    Route::post('/add_transaction/', '[email protected]_transaction'); 
    Route::get('/match', '[email protected]'); 
    //Route::post('/match', '[email protected]'); 
    Route::get('/coupon', '[email protected]'); 
    Route::get('/coupons/{id}', '[email protected]_coupon'); 
}); 
+0

코드 스크린 샷을 삭제했습니다. 코드를 포함하려면 서식있는 텍스트로 추가하십시오 (코드 추가를 위해 툴바 버튼을 사용하거나 [코드 블록 포맷] (http : // stackoverflow. co.kr/help/formatting # help-post-body)). –

답변

0

admin 또는 correction 역할이없는 것 같습니다. 이 때문에 /으로 리디렉션됩니다.

+0

내가 프로젝트를 보내 주신 것을 환영합니다. –

+0

첫 번째 사용자 (관리자)를 어떻게 만드셨습니까? – Buglinjo

+0

프로젝트의 등록 페이지에 –

0

봐가 반환 볼 수 또는 리디렉션을 반환합니다. 원하는보기로 이동하도록 변경할 수 있습니다.

+0

나에게 설명해주세요. public function post_login (Request $ request) { $ auth = false; $ credentials = $ request-> only ('user_name', 'password'); if (Auth :: 시도 ($ 자격 증명, $ 요청 -> ('기억'))) { $ user = Auth :: user(); if ($ user-> valide) { $ auth = true; // 성공 } else { Auth :: logout(); } –

+0

로그인 한 후 다른 페이지로 리디렉션하려고합니까? 또는 앱을 보거나 액세스 할 수 없다는 메시지가 표시되고 로그인 페이지로 리디렉션되고 있습니까? –

+0

아니요 관리자 패널에 로그인해야합니다. –

관련 문제