0

As you know inside the AppServiceProvider.php there is a public function boot(). Also i need my own function. This must works like boot. I need that function in everypage. That function just return some values for search-box. Its in the header section. Header values are in the boot function also. I can't figure out how to make global search.

public function boot()
{ 
    parent::boot();

    static::created(function(Request $request){
            // I don't know how it works. This could be completely wrong
        });

}

Am i need to add something like that? Any idea would be great. Thanks in advance.

Ali Özen
  • 1,525
  • 2
  • 14
  • 29

1 Answers1

-1

You can create a provider yourself which will be initialised on boot. Laravel 5.6 Docs - Providers

Mac
  • 55
  • 8