जैसा कि आप लोगों को पता है कि लैरवेल 5.2 कुछ दिन पहले जारी किया गया था। मैं इस नए संस्करण की कोशिश कर रहा हूँ। मैं CLI पर निम्न आदेश का उपयोग कर एक नई परियोजना बनाया:लार्वेल 5.2 एथ काम नहीं कर रहा
php artisan make:auth
यह ठीक काम किया:
laravel new testapp
प्रति documentation of Authentication Quickstart रूप में, मैं पाड़ मार्गों और प्रमाणीकरण के विचारों के लिए निम्न आदेश का पालन किया। पंजीकरण ठीक काम कर रहा है। लेकिन मुझे लॉगिन में समस्या का सामना करना पड़ रहा है। प्रवेश करने के बाद मैं route.php फ़ाइल में निम्न परीक्षण किया:
Route::get('/', function() {
dd(Auth::user());
return view('welcome');
});
Auth::user()
null
लौटा रहा है और यह भी Auth::check()
और Auth::guest()
उचित रूप से काम नहीं कर रहे। मैंने नई परियोजनाओं को दो बार तीन बार एक बार फिर से कोशिश की है लेकिन सही परिणाम नहीं मिल सका।
नीचे पूरा route.php
<?php
/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in 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::get('/', function() {
dd(Auth::());
return view('welcome');
});
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function() {
//
});
Route::group(['middleware' => 'web'], function() {
Route::auth();
Route::get('/home', '[email protected]');
});
किसी को भी मेरी मदद कर सकते है? या क्या कोई भी एक ही समस्या का सामना कर रहा है? मेरे द्वारा यह कैसे किया जा सकता है?
को
auth
मिडलवेयर बाँध आप अपने मार्ग समूह में मिडलवेयर समूह 'web' उपयोग कर रहे हैं की जरूरत है? कृपया अपने सभी मार्गों को पोस्ट करें। एफपी – Moppo@Moppo प्रश्न में ऊपर जोड़ा गया। –