Try   HackMD

如何從後端傳送特定文字到前端顯示

如果在Controller執行完一個function
想要傳送一段文字到前端頁面顯示
可以使用->with('參數','想要顯示的訊息')
例如
return redirect('/index')->with('msg','感謝您的寶貴意見');

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

這個訊息將存在Session
在由前端頁面取出
@if (Session::has('msg'))
alert('{{ Session::get('msg') }}');
@endif
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

此為警示視窗
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

tags: laravel JS