1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace App\Providers; |
4
|
|
|
|
5
|
|
|
use App\Http\ViewComposers\AddLotComposer; |
6
|
|
|
use App\Http\ViewComposers\BannerComposer; |
7
|
|
|
use App\Http\ViewComposers\BlogComposer; |
8
|
|
|
use App\Http\ViewComposers\CategoryComposer; |
9
|
|
|
use App\Http\ViewComposers\FaqComposer; |
10
|
|
|
use App\Http\ViewComposers\HomePageComposer; |
11
|
|
|
use App\Http\ViewComposers\LanguageComposer; |
12
|
|
|
use App\Http\ViewComposers\PagesComposer; |
13
|
|
|
use App\Http\ViewComposers\PartnerComposer; |
14
|
|
|
use App\Http\ViewComposers\SocialComposer; |
15
|
|
|
use App\Http\ViewComposers\MainComposer; |
16
|
|
|
use App\Http\ViewComposers\CurrencyComposer; |
17
|
|
|
|
18
|
|
|
use Illuminate\Support\ServiceProvider; |
19
|
|
|
|
20
|
|
|
class ComposerServiceProvider extends ServiceProvider |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* Register bindings in the container. |
24
|
|
|
* |
25
|
|
|
* @return void |
26
|
|
|
*/ |
27
|
|
|
public function boot() |
28
|
|
|
{ |
29
|
|
|
view()->composer('partials.footer.partners', PartnerComposer::class); |
|
|
|
|
30
|
|
|
|
31
|
|
|
view()->composer('partials.footer.socials', SocialComposer::class); |
32
|
|
|
|
33
|
|
|
view()->composer('partials.banners.*', BannerComposer::class); |
34
|
|
|
|
35
|
|
|
view()->composer(['partials.categories.*', 'product.partials.*'], CategoryComposer::class); |
36
|
|
|
|
37
|
|
|
view()->composer('partials.header.language-bar', LanguageComposer::class); |
38
|
|
|
|
39
|
|
|
view()->composer('partials.header.profile-bar', MainComposer::class); |
40
|
|
|
|
41
|
|
|
view()->composer('blog.partials.popular-sidebar', BlogComposer::class); |
42
|
|
|
|
43
|
|
|
view()->composer([ |
44
|
|
|
'partials.header.index', 'partials.footer.navigation_sidebar' |
45
|
|
|
], PagesComposer::class); |
46
|
|
|
|
47
|
|
|
view()->composer([ 'home.index' ], HomePageComposer::class); |
48
|
|
|
|
49
|
|
|
view()->composer('pages.support', FaqComposer::class); |
50
|
|
|
|
51
|
|
|
view()->composer([ 'lots.create', 'lots.partials.form.product' ], AddLotComposer::class); |
52
|
|
|
|
53
|
|
|
view()->composer('*', function($view){ |
|
|
|
|
54
|
|
|
return $view->with('meta', (new \App\Translate)); |
55
|
|
|
}); |
56
|
|
|
view()->composer( |
57
|
|
|
'*', 'App\Http\ViewComposers\CurrencyComposer' |
58
|
|
|
); |
59
|
|
|
|
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* Register the service provider. |
64
|
|
|
* |
65
|
|
|
* @return void |
66
|
|
|
*/ |
67
|
|
|
public function register() |
68
|
|
|
{ |
69
|
|
|
// |
70
|
|
|
} |
71
|
|
|
} |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: