LoginSignup
marcy27th
@marcy27th

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

laravel6  フラッシュメッセージ 表示位置

laravel6でTodoリストを作成しております。

Todoリストに項目を新規追加した際に
【リストに追加しました】というフラッシュメッセージを出るように
設定しましたが、表示位置が右上になっております。

フラッシュメッセージを上部 真ん中や左などに表示するにはどうしたら良いか教えてください。

●toasterを使用

viewに下記を記入して表示させています。

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>


<script>
@if (session('flash_message'))
$(function () {
toastr.success('{{ session('flash_message') }}');
});
@endif
</script>

0

1Answer

Comments

  1. @marcy27th

    Questioner
    ご回答ありがとうございます。

    tosterのデモサイトの使い方がわかり、表示に成功しました!

Your answer might help someone💌