ErrorException
в VerifyCsrfToken.php линии 135:ErrorException в VerifyCsrfToken.phpПопытка получить свойство необъектных
Что бы быть причиной меня, чтобы получить вышеуказанную ошибку? У меня есть собственное промежуточное программное обеспечение.
Я не уверен, что файлы к сообщению, как это происходит, когда я логин и на мой взгляд, у меня есть
{!! csrf_field() !!}
Маршруты:
<?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() {
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(['namespace' => 'Admin', 'prefix' => 'admin', 'middleware' => 'web'], function() {
/* Admin Auth */
Route::get('login', 'Auth\[email protected]');
Route::post('login', 'Auth\[email protected]');
Route::get('register', 'Auth\[email protected]');
Route::post('register', 'Auth\[email protected]');
Route::get('logout', 'Auth\[email protected]');
Route::group(['middleware' => 'auth.admin'], function(){
/*Admin Dashboard Routes */
Route::get('dashboard', '[email protected]');
Route::get('admin', '[email protected]');
});
});
Route::group(['middleware' => 'web'], function() {
Route::get('/home', '[email protected]');
});
Middleware:
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Auth;
class AdminAuthController
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
{
if(Auth::guard($guard)->guest())
{
if ($request->ajax())
{
return response('Unauthorized.', 401);
}else{
return redirect()->guest('admin/login');
}
return $next($request);
}
}
}
Вы можете разместить свой файл маршруты? –
@JilsonThomas Done –
На какой странице вы получаете эту ошибку? –