edvinaskrucas / notification

Notification package for Laravel
MIT License
525 stars 99 forks source link

Not displaying notifications on Laravel 4.2 #61

Closed lucastaliberti closed 8 years ago

lucastaliberti commented 8 years ago

Hi all,

Just updated my project from Laravel 4.0 to 4.2 and my notifications stopped working. I'm using "edvinaskrucas/notification": "3.*".

Here are some examples of not working controllers return:

Notification::success('success');
return Redirect::back();
Notification::success('success');
return Redirect::to('orders');
Notification::success('success');
return Redirect::route('orders.create');

On the view I simple use:

{{ Notification::showAll() }}

I have no more ideas how to debug that...

edvinaskrucas commented 8 years ago

Hi, does messages are flashed to session properly?

lucastaliberti commented 8 years ago

Hi Edvinas, I believe so, but I can't say if there is something wrong. As follow my session dump after a notification call

Notification::success('Pedido gravado');
Array
(
    [_token] => 10BuO70jkGMvwBR3B7yfJEDORNhF24BBdnzn6EaU
    [PHPDEBUGBAR_STACK_DATA] => Array
        (
            [2dd05fd87b55c9feaa486dcb7f4863b0] => 
            [e00677a3d772c2a54cb645e7d89014f9] => 
            [2ce1b63378bec6cd4a359813909afc9f] => 
            [85659e603b1c7591dc2689599dbe82ad] => 
            [53b3fd87e2e903ced7cdef225516cf09] => 
            [ddac715b3da3670f6ce741107c71ac87] => 
        )

    [flash] => Array
        (
            [old] => Array
                (
                )

            [new] => Array
                (
                    [0] => notifications_containers
                    [1] => notifications_default_1
                )

        )

    [cartalyst_sentry] => Array
        (
            [0] => 1
            [1] => $2y$10$KPi3GuKep/WUneOftNOxde6IGFhQn3be5DAFbTfqwHRKcR9j32zWK
        )

    [pn] => 42
    [notifications_containers] => Array
        (
            [0] => default
        )

    [notifications_default_1] => {"message":"Pedido gravado","format":false,"type":"success","flashable":true,"alias":null,"position":null}
)
edvinaskrucas commented 8 years ago

Did you tried to escape

{{ Notification::showAll() }}

to

{!! Notification::showAll() !!}

?

lucastaliberti commented 8 years ago

@edvinaskrucas I believe {!! !!} is a Laravel 5.x control, i'm still in 4.2. Is there other way to escape that using Laravel 4.2?

edvinaskrucas commented 8 years ago

Hey, just tested version 3.* on laravel 4.2.11 - everyting is working fine.