简体   繁体   中英

How to share variable in the views after firing event laravel 5.2

I have this listener class

class NotifyMR
{
/**
 * Create the event listener.
 */
public function __construct()
{

}

public function handle(LeaveRequestWasReviewed $event)
{
    return $event->leaveRequest.'->'.$event->statue;
}
}

so I need to share some variables in the views after firing event , so how to do it ?

通过View立面

View::share('key', 'value');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM