2017-02-21 7 views
0

make:authコマンドを使用してlaravel 5のログインと登録フォームを作成しました。私のレイアウトフォルダには、home.blade.phpとfront.blade.phpの両方があります。私の問題は、私は私のインデックスページ(サイトの開始ページ)として私のWebアプリケーションにアクセスするときにfront.blade.phpファイルが必要です。私はシステムにロギングするときにhome.blade.phpファイルが必要です。 (cmsの仕事をする)。私の事の目的地は、これはログイン後にlaravel 5のログインページを管理する方法は?

Route::auth(); 






Route::get('/', function() { 
    return view('front'); 
}); 


Route::get('/home', function() { 
    return view('home'); 
}); 


Route::get('/about',function(){ 
    return view('about'); 
}); 

Route::get('/bod',function(){ 
    return view('bod'); 
}); 

Route::get('/st',function(){ 
    return view('st'); 
}); 

Route::get('/services',function(){ 
    return view('services'); 
}); 

Route::get('/contact',function(){ 
    return view('contact'); 
}); 

Route::get('/welcome',function(){ 
    return view('welcome'); 
}); 


Route::auth(); 

Route::get('/home', '[email protected]'); 

routes.phpのですが、私は、ルート上の私のウェブアプリを使用する場合、必ずシステムで伐採した後、ファイルをfront.blade.phpにリダイレクト

routes.phpのです。私はシステムとのロギング後にhome.blade.phpでリダイレクトする必要があります。あなたは、フロントルート内のチェックを追加して、ユーザーがログインしている場合は自宅にリダイレクトすることができます

答えて

0

if (Auth::check()) { 
    return redirect('home'); 
} 
+0

このスクリプトルート::取得(「/」、機能(){ 場合(と成功事例の( '正面'); });返信表示( '前');返信表示( '自宅'); } – flex

関連する問題