![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /home/fdshops/public_html/vendor/arcanedev/support/src/Providers/ |
<?php declare(strict_types=1); namespace Arcanedev\Support\Providers; use Illuminate\Contracts\View\Factory as ViewFactory; /** * Class ViewComposerServiceProvider * * @author ARCANEDEV <arcanedev.maroc@gmail.com> */ abstract class ViewComposerServiceProvider extends ServiceProvider { /* ----------------------------------------------------------------- | Properties | ----------------------------------------------------------------- */ /** * Register the composer classes. * * @var array */ protected $composerClasses = [ // 'view-name' => 'class' ]; /* ----------------------------------------------------------------- | Main Methods | ----------------------------------------------------------------- */ /** * Boot the view composer service provider. */ public function boot() { $this->registerComposerClasses(); } /** * Register the view composer classes. */ protected function registerComposerClasses() { foreach ($this->composerClasses as $view => $class) { $this->composer($view, $class); } } /* ----------------------------------------------------------------- | Other Methods | ----------------------------------------------------------------- */ /** * Get the view factory instance. * * @return \Illuminate\Contracts\View\Factory */ protected function view() { return $this->app->make(ViewFactory::class); } /** * Register a view composer event. * * @param array|string $views * @param \Closure|string $callback * * @return array */ public function composer($views, $callback) { return $this->view()->composer($views, $callback); } }