Guys 我正在使用laravel5.2.45
。當我使用redirect()->with()
在routes.php
內有閃存數據時,我無法輸出緩存數據。這是我的代碼。在laravel中使用redirect() - > with()時無法輸出Flash數據5.2.45
在App/Http/routes.php
Route::get('hello', function(){
return redirect('/')->with('ok',"success");
});
在index.blade.php
<div class="container">
@if(session()->has('ok'))
<?php echo session('ok'); ?> // always null
@endif
</div>
沒有mattter我做什麼,也不能打印會話數據。我也嘗試使用`Session :: get('ok')',但它仍然是空的。
我已經更新了我的應用程序composer update
和compose dump-autoload
,但它仍然不起作用。
任何人都可以幫忙嗎?
你申請'web'中間件的路線? –
會話的驅動程序是什麼? –