Support the ongoing development of Laravel.io →
Views Blade
Last updated 1 year ago.
0

Event::fire seems to return an array if you look at fire method here: https://github.com/laravel/framework/blob/master/src/Illuminat.... That could be part of the issue. I'm guessing this is because firing an event can return multiple things if the event has multiple listeners. You can always just pass the first element of the event response to the View::make() method. Give the following a try:

Event::listen('test', function () {
    return 'hello';
});

$event = Event::fire('test');
return View::make($event[0]);
Last updated 1 year ago.
0

Very thanks.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

yuomtheara yuomtheara Joined 12 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.