Notifications in Laravel, stored in Session (how to create and clear them)





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I'm making an application, where I've added this to my view-template, to show all the notifications / status-messaged / alerts:



@if ( ! empty( session('notifications') ) )
@foreach( session('notifications') as $notification )
<div class="alert alert-{{ $notification['notification_type'] }}" role="alert">
<strong>{{ $notification['notification_title'] }}</strong> - {{ $notification['notification_message'] }}
</div>
@endforeach
@endif


I'm looking for a way, where I can simply pass a notification to a Collection stored in session('notifications'), anywhere in my controllers.



But whenever a page is loaded, that session-variable starts out empty. So I would need to both:




  • Clear all notifications upon every page load (using Session::forget('notifications') I assume, ref).

  • Instantiate an empty Collection in the session, so I don't need to check-if-empty-and-if-not-then-add-notification-and-if-it-is-empty-then-make-an-empty-collection-and-then-add-the-notification.


Where does code like this belong? I'm fairly new to Laravel, coming from WordPress, where I just would have added an action to init in functions.php. But where is the equivalent in Laravel?



And is this the proper way of controlling notifications in Laravel? I'm calling it notifications, in lack of better word. Perhaps, 'Alert' or 'Status'? Because I can see that a notification is something related, but still something else.










share|improve this question





























    0















    I'm making an application, where I've added this to my view-template, to show all the notifications / status-messaged / alerts:



    @if ( ! empty( session('notifications') ) )
    @foreach( session('notifications') as $notification )
    <div class="alert alert-{{ $notification['notification_type'] }}" role="alert">
    <strong>{{ $notification['notification_title'] }}</strong> - {{ $notification['notification_message'] }}
    </div>
    @endforeach
    @endif


    I'm looking for a way, where I can simply pass a notification to a Collection stored in session('notifications'), anywhere in my controllers.



    But whenever a page is loaded, that session-variable starts out empty. So I would need to both:




    • Clear all notifications upon every page load (using Session::forget('notifications') I assume, ref).

    • Instantiate an empty Collection in the session, so I don't need to check-if-empty-and-if-not-then-add-notification-and-if-it-is-empty-then-make-an-empty-collection-and-then-add-the-notification.


    Where does code like this belong? I'm fairly new to Laravel, coming from WordPress, where I just would have added an action to init in functions.php. But where is the equivalent in Laravel?



    And is this the proper way of controlling notifications in Laravel? I'm calling it notifications, in lack of better word. Perhaps, 'Alert' or 'Status'? Because I can see that a notification is something related, but still something else.










    share|improve this question

























      0












      0








      0








      I'm making an application, where I've added this to my view-template, to show all the notifications / status-messaged / alerts:



      @if ( ! empty( session('notifications') ) )
      @foreach( session('notifications') as $notification )
      <div class="alert alert-{{ $notification['notification_type'] }}" role="alert">
      <strong>{{ $notification['notification_title'] }}</strong> - {{ $notification['notification_message'] }}
      </div>
      @endforeach
      @endif


      I'm looking for a way, where I can simply pass a notification to a Collection stored in session('notifications'), anywhere in my controllers.



      But whenever a page is loaded, that session-variable starts out empty. So I would need to both:




      • Clear all notifications upon every page load (using Session::forget('notifications') I assume, ref).

      • Instantiate an empty Collection in the session, so I don't need to check-if-empty-and-if-not-then-add-notification-and-if-it-is-empty-then-make-an-empty-collection-and-then-add-the-notification.


      Where does code like this belong? I'm fairly new to Laravel, coming from WordPress, where I just would have added an action to init in functions.php. But where is the equivalent in Laravel?



      And is this the proper way of controlling notifications in Laravel? I'm calling it notifications, in lack of better word. Perhaps, 'Alert' or 'Status'? Because I can see that a notification is something related, but still something else.










      share|improve this question














      I'm making an application, where I've added this to my view-template, to show all the notifications / status-messaged / alerts:



      @if ( ! empty( session('notifications') ) )
      @foreach( session('notifications') as $notification )
      <div class="alert alert-{{ $notification['notification_type'] }}" role="alert">
      <strong>{{ $notification['notification_title'] }}</strong> - {{ $notification['notification_message'] }}
      </div>
      @endforeach
      @endif


      I'm looking for a way, where I can simply pass a notification to a Collection stored in session('notifications'), anywhere in my controllers.



      But whenever a page is loaded, that session-variable starts out empty. So I would need to both:




      • Clear all notifications upon every page load (using Session::forget('notifications') I assume, ref).

      • Instantiate an empty Collection in the session, so I don't need to check-if-empty-and-if-not-then-add-notification-and-if-it-is-empty-then-make-an-empty-collection-and-then-add-the-notification.


      Where does code like this belong? I'm fairly new to Laravel, coming from WordPress, where I just would have added an action to init in functions.php. But where is the equivalent in Laravel?



      And is this the proper way of controlling notifications in Laravel? I'm calling it notifications, in lack of better word. Perhaps, 'Alert' or 'Status'? Because I can see that a notification is something related, but still something else.







      laravel






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 24 '18 at 3:31









      ZethZeth

      70711534




      70711534
























          2 Answers
          2






          active

          oldest

          votes


















          1














          I think that you are looking for this : https://laravel.com/docs/5.7/session#flash-data



          Right ?






          share|improve this answer
























          • That is exacly it! However... What if I wanted to two flash-messages with the key 'status'? If I just set the $request->session()->flash('status', 'Task was successful!'); in one place and $request->session()->flash('status', 'ANOTHER MESSAGE'); later in the code, then the first flash-message will be overwritten right? Can I make it so that doesn't happen?

            – Zeth
            Nov 24 '18 at 3:55











          • This here is one way to solve it ( ashleyhindle.com/… ), - but it's not safe, since str_random(4) could generate two equal strings.

            – Zeth
            Nov 24 '18 at 3:58






          • 1





            When you display a flash message, you just display "the key", so you can set a lot of different message with some "different values", it depend on you ^^ But i think that using the "same key" for many message at the "same time", it's a little bit weird no ?

            – Christophe
            Nov 24 '18 at 17:34













          • Aaaaahhhh... I just got how the 'key' is supposed to work now. That the key is simply there to tell you, where the message comes from. And as shown on the Ashley Hindle-link, posted earlier, the second parameter for flash() can be an array with the message, the title, the color of the box and all that. Awesome. Thanks a bunch!

            – Zeth
            Nov 24 '18 at 23:08



















          0














          To others who may need it, then here is a function for adding several flash-messages.



          helper.php



          Put this somewhere that is accesible globally (this post describes a way to make such a place):



          function add_flash_message( array $notification){
          session()->flash( 'any_notifications', true );
          if(
          empty( session( 'notification_collection' ) )
          ){
          // If notification_collection is either not set or not a collection
          $new_collection = new IlluminateSupportCollection();
          $new_collection->push([
          'notification_title' => $notification['title'],
          'notification_message' => $notification['message'],
          'notification_type' => $notification['type'],
          ]);
          session()->flash( 'notification_collection', $new_collection );
          } else {
          // Add to the notification-collection
          $notification_collection = Session::get( 'notification_collection' );
          $notification_collection->push( [
          'notification_title' => $notification['title'],
          'notification_message' => $notification['message'],
          'notification_type' => $notification['type'],
          ]);
          session()->flash( 'notification_collection', $notification_collection );
          }
          }


          What is does it, that it checks if there is a flash-message already. And if there is, then it'll add the new one; and if there isn't then it'll create a new Collection and add it there.



          In the workflow



          add_flash_message( [
          'title' => 'The file does not exist',
          'message' => 'The chosen file/path does not seem to exist.',
          'type' => 'danger'
          ] );


          In the view/blade-file



          @if( !empty( Session( 'any_notifications' ) ) )
          @foreach (Session('notification_collection') as $notification)
          <div class="alert alert-{{ $notification['notification_type'] }}" role="alert">
          <strong>{{ $notification['notification_title'] }}</strong> - {{ $notification['notification_message'] }}
          <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
          </div>
          @endforeach
          @endif





          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53454932%2fnotifications-in-laravel-stored-in-session-how-to-create-and-clear-them%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            I think that you are looking for this : https://laravel.com/docs/5.7/session#flash-data



            Right ?






            share|improve this answer
























            • That is exacly it! However... What if I wanted to two flash-messages with the key 'status'? If I just set the $request->session()->flash('status', 'Task was successful!'); in one place and $request->session()->flash('status', 'ANOTHER MESSAGE'); later in the code, then the first flash-message will be overwritten right? Can I make it so that doesn't happen?

              – Zeth
              Nov 24 '18 at 3:55











            • This here is one way to solve it ( ashleyhindle.com/… ), - but it's not safe, since str_random(4) could generate two equal strings.

              – Zeth
              Nov 24 '18 at 3:58






            • 1





              When you display a flash message, you just display "the key", so you can set a lot of different message with some "different values", it depend on you ^^ But i think that using the "same key" for many message at the "same time", it's a little bit weird no ?

              – Christophe
              Nov 24 '18 at 17:34













            • Aaaaahhhh... I just got how the 'key' is supposed to work now. That the key is simply there to tell you, where the message comes from. And as shown on the Ashley Hindle-link, posted earlier, the second parameter for flash() can be an array with the message, the title, the color of the box and all that. Awesome. Thanks a bunch!

              – Zeth
              Nov 24 '18 at 23:08
















            1














            I think that you are looking for this : https://laravel.com/docs/5.7/session#flash-data



            Right ?






            share|improve this answer
























            • That is exacly it! However... What if I wanted to two flash-messages with the key 'status'? If I just set the $request->session()->flash('status', 'Task was successful!'); in one place and $request->session()->flash('status', 'ANOTHER MESSAGE'); later in the code, then the first flash-message will be overwritten right? Can I make it so that doesn't happen?

              – Zeth
              Nov 24 '18 at 3:55











            • This here is one way to solve it ( ashleyhindle.com/… ), - but it's not safe, since str_random(4) could generate two equal strings.

              – Zeth
              Nov 24 '18 at 3:58






            • 1





              When you display a flash message, you just display "the key", so you can set a lot of different message with some "different values", it depend on you ^^ But i think that using the "same key" for many message at the "same time", it's a little bit weird no ?

              – Christophe
              Nov 24 '18 at 17:34













            • Aaaaahhhh... I just got how the 'key' is supposed to work now. That the key is simply there to tell you, where the message comes from. And as shown on the Ashley Hindle-link, posted earlier, the second parameter for flash() can be an array with the message, the title, the color of the box and all that. Awesome. Thanks a bunch!

              – Zeth
              Nov 24 '18 at 23:08














            1












            1








            1







            I think that you are looking for this : https://laravel.com/docs/5.7/session#flash-data



            Right ?






            share|improve this answer













            I think that you are looking for this : https://laravel.com/docs/5.7/session#flash-data



            Right ?







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 24 '18 at 3:41









            ChristopheChristophe

            139315




            139315













            • That is exacly it! However... What if I wanted to two flash-messages with the key 'status'? If I just set the $request->session()->flash('status', 'Task was successful!'); in one place and $request->session()->flash('status', 'ANOTHER MESSAGE'); later in the code, then the first flash-message will be overwritten right? Can I make it so that doesn't happen?

              – Zeth
              Nov 24 '18 at 3:55











            • This here is one way to solve it ( ashleyhindle.com/… ), - but it's not safe, since str_random(4) could generate two equal strings.

              – Zeth
              Nov 24 '18 at 3:58






            • 1





              When you display a flash message, you just display "the key", so you can set a lot of different message with some "different values", it depend on you ^^ But i think that using the "same key" for many message at the "same time", it's a little bit weird no ?

              – Christophe
              Nov 24 '18 at 17:34













            • Aaaaahhhh... I just got how the 'key' is supposed to work now. That the key is simply there to tell you, where the message comes from. And as shown on the Ashley Hindle-link, posted earlier, the second parameter for flash() can be an array with the message, the title, the color of the box and all that. Awesome. Thanks a bunch!

              – Zeth
              Nov 24 '18 at 23:08



















            • That is exacly it! However... What if I wanted to two flash-messages with the key 'status'? If I just set the $request->session()->flash('status', 'Task was successful!'); in one place and $request->session()->flash('status', 'ANOTHER MESSAGE'); later in the code, then the first flash-message will be overwritten right? Can I make it so that doesn't happen?

              – Zeth
              Nov 24 '18 at 3:55











            • This here is one way to solve it ( ashleyhindle.com/… ), - but it's not safe, since str_random(4) could generate two equal strings.

              – Zeth
              Nov 24 '18 at 3:58






            • 1





              When you display a flash message, you just display "the key", so you can set a lot of different message with some "different values", it depend on you ^^ But i think that using the "same key" for many message at the "same time", it's a little bit weird no ?

              – Christophe
              Nov 24 '18 at 17:34













            • Aaaaahhhh... I just got how the 'key' is supposed to work now. That the key is simply there to tell you, where the message comes from. And as shown on the Ashley Hindle-link, posted earlier, the second parameter for flash() can be an array with the message, the title, the color of the box and all that. Awesome. Thanks a bunch!

              – Zeth
              Nov 24 '18 at 23:08

















            That is exacly it! However... What if I wanted to two flash-messages with the key 'status'? If I just set the $request->session()->flash('status', 'Task was successful!'); in one place and $request->session()->flash('status', 'ANOTHER MESSAGE'); later in the code, then the first flash-message will be overwritten right? Can I make it so that doesn't happen?

            – Zeth
            Nov 24 '18 at 3:55





            That is exacly it! However... What if I wanted to two flash-messages with the key 'status'? If I just set the $request->session()->flash('status', 'Task was successful!'); in one place and $request->session()->flash('status', 'ANOTHER MESSAGE'); later in the code, then the first flash-message will be overwritten right? Can I make it so that doesn't happen?

            – Zeth
            Nov 24 '18 at 3:55













            This here is one way to solve it ( ashleyhindle.com/… ), - but it's not safe, since str_random(4) could generate two equal strings.

            – Zeth
            Nov 24 '18 at 3:58





            This here is one way to solve it ( ashleyhindle.com/… ), - but it's not safe, since str_random(4) could generate two equal strings.

            – Zeth
            Nov 24 '18 at 3:58




            1




            1





            When you display a flash message, you just display "the key", so you can set a lot of different message with some "different values", it depend on you ^^ But i think that using the "same key" for many message at the "same time", it's a little bit weird no ?

            – Christophe
            Nov 24 '18 at 17:34







            When you display a flash message, you just display "the key", so you can set a lot of different message with some "different values", it depend on you ^^ But i think that using the "same key" for many message at the "same time", it's a little bit weird no ?

            – Christophe
            Nov 24 '18 at 17:34















            Aaaaahhhh... I just got how the 'key' is supposed to work now. That the key is simply there to tell you, where the message comes from. And as shown on the Ashley Hindle-link, posted earlier, the second parameter for flash() can be an array with the message, the title, the color of the box and all that. Awesome. Thanks a bunch!

            – Zeth
            Nov 24 '18 at 23:08





            Aaaaahhhh... I just got how the 'key' is supposed to work now. That the key is simply there to tell you, where the message comes from. And as shown on the Ashley Hindle-link, posted earlier, the second parameter for flash() can be an array with the message, the title, the color of the box and all that. Awesome. Thanks a bunch!

            – Zeth
            Nov 24 '18 at 23:08













            0














            To others who may need it, then here is a function for adding several flash-messages.



            helper.php



            Put this somewhere that is accesible globally (this post describes a way to make such a place):



            function add_flash_message( array $notification){
            session()->flash( 'any_notifications', true );
            if(
            empty( session( 'notification_collection' ) )
            ){
            // If notification_collection is either not set or not a collection
            $new_collection = new IlluminateSupportCollection();
            $new_collection->push([
            'notification_title' => $notification['title'],
            'notification_message' => $notification['message'],
            'notification_type' => $notification['type'],
            ]);
            session()->flash( 'notification_collection', $new_collection );
            } else {
            // Add to the notification-collection
            $notification_collection = Session::get( 'notification_collection' );
            $notification_collection->push( [
            'notification_title' => $notification['title'],
            'notification_message' => $notification['message'],
            'notification_type' => $notification['type'],
            ]);
            session()->flash( 'notification_collection', $notification_collection );
            }
            }


            What is does it, that it checks if there is a flash-message already. And if there is, then it'll add the new one; and if there isn't then it'll create a new Collection and add it there.



            In the workflow



            add_flash_message( [
            'title' => 'The file does not exist',
            'message' => 'The chosen file/path does not seem to exist.',
            'type' => 'danger'
            ] );


            In the view/blade-file



            @if( !empty( Session( 'any_notifications' ) ) )
            @foreach (Session('notification_collection') as $notification)
            <div class="alert alert-{{ $notification['notification_type'] }}" role="alert">
            <strong>{{ $notification['notification_title'] }}</strong> - {{ $notification['notification_message'] }}
            <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
            </div>
            @endforeach
            @endif





            share|improve this answer




























              0














              To others who may need it, then here is a function for adding several flash-messages.



              helper.php



              Put this somewhere that is accesible globally (this post describes a way to make such a place):



              function add_flash_message( array $notification){
              session()->flash( 'any_notifications', true );
              if(
              empty( session( 'notification_collection' ) )
              ){
              // If notification_collection is either not set or not a collection
              $new_collection = new IlluminateSupportCollection();
              $new_collection->push([
              'notification_title' => $notification['title'],
              'notification_message' => $notification['message'],
              'notification_type' => $notification['type'],
              ]);
              session()->flash( 'notification_collection', $new_collection );
              } else {
              // Add to the notification-collection
              $notification_collection = Session::get( 'notification_collection' );
              $notification_collection->push( [
              'notification_title' => $notification['title'],
              'notification_message' => $notification['message'],
              'notification_type' => $notification['type'],
              ]);
              session()->flash( 'notification_collection', $notification_collection );
              }
              }


              What is does it, that it checks if there is a flash-message already. And if there is, then it'll add the new one; and if there isn't then it'll create a new Collection and add it there.



              In the workflow



              add_flash_message( [
              'title' => 'The file does not exist',
              'message' => 'The chosen file/path does not seem to exist.',
              'type' => 'danger'
              ] );


              In the view/blade-file



              @if( !empty( Session( 'any_notifications' ) ) )
              @foreach (Session('notification_collection') as $notification)
              <div class="alert alert-{{ $notification['notification_type'] }}" role="alert">
              <strong>{{ $notification['notification_title'] }}</strong> - {{ $notification['notification_message'] }}
              <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
              </div>
              @endforeach
              @endif





              share|improve this answer


























                0












                0








                0







                To others who may need it, then here is a function for adding several flash-messages.



                helper.php



                Put this somewhere that is accesible globally (this post describes a way to make such a place):



                function add_flash_message( array $notification){
                session()->flash( 'any_notifications', true );
                if(
                empty( session( 'notification_collection' ) )
                ){
                // If notification_collection is either not set or not a collection
                $new_collection = new IlluminateSupportCollection();
                $new_collection->push([
                'notification_title' => $notification['title'],
                'notification_message' => $notification['message'],
                'notification_type' => $notification['type'],
                ]);
                session()->flash( 'notification_collection', $new_collection );
                } else {
                // Add to the notification-collection
                $notification_collection = Session::get( 'notification_collection' );
                $notification_collection->push( [
                'notification_title' => $notification['title'],
                'notification_message' => $notification['message'],
                'notification_type' => $notification['type'],
                ]);
                session()->flash( 'notification_collection', $notification_collection );
                }
                }


                What is does it, that it checks if there is a flash-message already. And if there is, then it'll add the new one; and if there isn't then it'll create a new Collection and add it there.



                In the workflow



                add_flash_message( [
                'title' => 'The file does not exist',
                'message' => 'The chosen file/path does not seem to exist.',
                'type' => 'danger'
                ] );


                In the view/blade-file



                @if( !empty( Session( 'any_notifications' ) ) )
                @foreach (Session('notification_collection') as $notification)
                <div class="alert alert-{{ $notification['notification_type'] }}" role="alert">
                <strong>{{ $notification['notification_title'] }}</strong> - {{ $notification['notification_message'] }}
                <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                </div>
                @endforeach
                @endif





                share|improve this answer













                To others who may need it, then here is a function for adding several flash-messages.



                helper.php



                Put this somewhere that is accesible globally (this post describes a way to make such a place):



                function add_flash_message( array $notification){
                session()->flash( 'any_notifications', true );
                if(
                empty( session( 'notification_collection' ) )
                ){
                // If notification_collection is either not set or not a collection
                $new_collection = new IlluminateSupportCollection();
                $new_collection->push([
                'notification_title' => $notification['title'],
                'notification_message' => $notification['message'],
                'notification_type' => $notification['type'],
                ]);
                session()->flash( 'notification_collection', $new_collection );
                } else {
                // Add to the notification-collection
                $notification_collection = Session::get( 'notification_collection' );
                $notification_collection->push( [
                'notification_title' => $notification['title'],
                'notification_message' => $notification['message'],
                'notification_type' => $notification['type'],
                ]);
                session()->flash( 'notification_collection', $notification_collection );
                }
                }


                What is does it, that it checks if there is a flash-message already. And if there is, then it'll add the new one; and if there isn't then it'll create a new Collection and add it there.



                In the workflow



                add_flash_message( [
                'title' => 'The file does not exist',
                'message' => 'The chosen file/path does not seem to exist.',
                'type' => 'danger'
                ] );


                In the view/blade-file



                @if( !empty( Session( 'any_notifications' ) ) )
                @foreach (Session('notification_collection') as $notification)
                <div class="alert alert-{{ $notification['notification_type'] }}" role="alert">
                <strong>{{ $notification['notification_title'] }}</strong> - {{ $notification['notification_message'] }}
                <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                </div>
                @endforeach
                @endif






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 25 '18 at 23:00









                ZethZeth

                70711534




                70711534






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53454932%2fnotifications-in-laravel-stored-in-session-how-to-create-and-clear-them%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    Academy of Television Arts & Sciences

                    L'Équipe

                    1995 France bombings