Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Providers;
- use Illuminate\Support\ServiceProvider;
- class AppServiceProvider extends ServiceProvider
- {
- public function boot()
- {
- $this->app['hooks']->listen('hook1', function () {
- return view('hook1-a');
- });
- $this->app['hooks']->listen('hook1', 'App\Hook1Listener@handle');
- $this->app['hooks']->listen('hook2', function () {
- return view('hook2-a');
- });
- }
- public function register()
- {
- $this->app->singleton('hooks', function ($app) {
- return new \App\HookManager;
- });
- $this->app['hooks']->add('hook1');
- $this->app['hooks']->add('hook2');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement