2
こんにちは私は私の管理パネルで深刻な問題を抱えています。データベースを更新、削除、または挿入しようとするたびに、再度ログインページにリダイレクトされます。私はユーザーをログインさせておくことができますか?別の問題は、私が多くの変更を加えたときに私に"verisfy csrf token "
を与えてくれるのです。どうすれば問題になるのですか?{{csrf_field()}}
?私は1200にセッション時間を増やそうとしたが、それは誰も私を助けることができるので、動作しません?それは私のカーネルです:laravelのログイン時間を増やす方法
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array
*/
protected $middleware = [
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
],
'api' => [
'throttle:60,1',
],
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'can' => \Illuminate\Foundation\Http\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
];
}
、それは私のルートの次の
Route::group(['middleware' =>[ 'web']], function() {
});
のようなあなたのルートの使用のWebミドルウェアグループかどうか
<?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('home');
});
*/
/*
|--------------------------------------------------------------------------
| 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::auth();
Route::get('/', ['as'=>'home', 'middleware'=>'auth', 'uses'=>'[email protected]']);
Route::controller('about','abouttitleController');
Route::controller('abouttitleedit','abouttitleeditController');
Route::controller('aboutcategory','aboutcategoryController');
Route::controller('aboutcategoryedit','aboutcategoryeditController');
Route::controller('abouttopic','abouttopicController');
Route::controller('abouttopicedit','abouttopiceditController');
Route::controller('features','featuresController');
Route::controller('featuresedit','featureseditController');
Route::controller('contact','contactController');
Route::controller('hirecategory','hirecategoryController');
Route::controller('hiretitle','hiretitleController');
Route::controller('hiretitleedit','hiretitleeditController');
Route::controller('hirecategoryedit','hirecategoryeditController');
Route::controller('hiretopicedit','hiretopiceditController');
Route::controller('servicescategory','servicescategoryController');
Route::controller('servicescategoryedit','servicescategoryeditController');
Route::controller('servicestitle','servicestitleController');
Route::controller('servicestitleedit','servicestitleeditController');
Route::controller('servicessubcategory','servicessubcategoryController');
Route::controller('servicessubedit','servicessubcategoryeditController');
Route::controller('residentialservices','residentialController');
Route::controller('residentialedit','residentialeditController');
Route::controller('slider','sliderController');
Route::controller('slideredit','slidereditController');
Route::controller('testmonials','testmonialsController');
Route::controller('testmonialsedit','testmonialseditController');
Route::controller('tips','tipsController');
Route::controller('tipsedit','tipseditController');
Route::controller('commercialtitle','commercialtitleController');
Route::controller('commercialtitleedit','commercialtitleeditController');
Route::controller('commercialtopic','commercialtopicController');
Route::controller('commercialtopicedit','commercialtopiceditController');
Route::controller('meta','metaController');
});
私のルートからそれを削除しました。今すぐカーネルを投稿します –
私の質問を更新し、kernel.phpファイルを掲示しました –
あなたのkernalファイルは大丈夫です、経路を削除しないでください、セッションが正常に動作するために保護されたルートにWebミドルウェアが含まれていることを確認してください –