2016-12-30 105 views
0

我是laravel中的新成員。我在我的應用中的一些形式可以編輯/更新,當形式向用戶更新的相關信息,然後點擊保存我希望出現一個閃光成功的消息,稱「更新成功」,我想,對我所有的形式,但它是不工作。有人能幫助我嗎?我無法得到問題所在。 我跟着這個混帳,以實現快速封郵件在我的應用程序laravel/flashLaravel 5.3使用laravel/flash包的flash消息根本不工作

在我的控制,我有

$this->validate($request, Other::$validationRules); 

    $other = Other::findOrFail($id); 
    $other->update($request->all()); 

    flash('sucessfully updated','sucess'); 

    return redirect('/profile/' .\Auth::User()->id. '/archives/other'); 

這是閃存味精到我的編輯表格視圖

@if (session()->has('flash_notification.message')) 
     <div class="alert alert-{{ session('flash_notification.level') }}"> 
      <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> 

      {{ session('flash_notification.message') }} 
     </div> 
    @endif 

的路線,我使用路由組web和​​auth中間件。

我希望我已經明確enough.thanks

回答

0

,或者你可以做這樣的

return redirect('/profile/' .\Auth::User()->id. '/archives/other')->with('message','sucessfully updated.'); 

,並考慮:

@if(Session::has('message')) 
    <h2 style="color: green"><i class="fa fa-star"></i>{{Session::get('message')}}</h2> 
@endif 
+0

感謝這一點,但它仍然沒有工作。 –

+0

你使用什麼版本? – CodeNoobie

+0

laravel 5.3,寫在問題中。它仍然無法正常工作。有沒有其他配置我還沒有做,使其工作?我真的無法解釋也不明白問題所在。 –