To pass data to all views in Laravel use a method called to share(). This method takes two arguments, key, and value. Generally, the share() method is called from the boot method of the Laravel application service provider. A developer can use any service provider, AppServiceProvider, or our own service provider.