+++ /dev/null
-<?php
-
-namespace Cubist\Backpack;
-
-use Illuminate\Cookie\CookieJar;
-use Illuminate\Cookie\CookieServiceProvider as Base;
-
-class CookieServiceProvider extends Base
-{
- public function register()
- {
- $this->app->singleton('cookie', function ($app) {
- $config = $app->make('config')->get('session');
-
- $domains = explode(',', $config['domain']);
-
- if (count($domains) === 1) {
- $domain = $domains[0];
- } else {
- foreach ($domains as $domain) {
- if (stripos($_SERVER['HTTP_HOST'], $domain) !== false) {
- $found = $domain;
- break;
- }
- }
- if (!isset($found)) {
- $domain = $_SERVER['HTTP_HOST'];
- } else {
- $domain = $found;
- }
- }
- config(['session.domain' => $domain]);
-
- return (new CookieJar)->setDefaultPathAndDomain(
- $config['path'], $domain, $config['secure'], $config['same_site'] ?? null
- );
- });
- }
-}
+++ /dev/null
-<?php
-
-namespace Cubist\Backpack;
-
-use Cubist\Backpack\Console\Commands\MigrateCommand;
-use Cubist\Backpack\Console\Commands\GenerateCommand;
-use Cubist\Backpack\Console\Commands\InstallCommand;
-use Cubist\Backpack\Console\Commands\LocaleCopy;
-use Cubist\Backpack\Console\Commands\LocaleSlugReset;
-use Cubist\Backpack\Console\Commands\SearchIndexCommand;
-use Cubist\Backpack\Console\Commands\UpdateCommand;
-use Illuminate\Support\Facades\Blade;
-use Illuminate\Support\ServiceProvider;
-use Cubist\Backpack\CubistCrudPanel;
-
-class CubistBackpackServiceProvider extends ServiceProvider
-{
- /**
- * Indicates if loading of the provider is deferred.
- *
- * @var bool
- */
- protected $defer = false;
-
- const NAMESPACE = 'cubist_back';
-
-
- /**
- * Perform post-registration booting of services.
- *
- * @return void
- */
- public function boot()
- {
- $resourcesDir = __DIR__ . '/../resources';
-
- $this->loadTranslationsFrom(realpath(__DIR__ . '/resources/lang'), self::NAMESPACE);
- foreach (glob(__DIR__ . '/routes/cubist/backpack/*.php') as $filename) {
- $this->loadRoutesFrom($filename);
- }
- $this->publishes([$resourcesDir . '/config/cubist.php' => config_path('cubist.php')], 'config');
- $this->loadViewsFrom(realpath(__DIR__ . '/resources/views'), self::NAMESPACE);
-
- Blade::directive('vendor_asset', function ($path) {
- return vendor_asset($path);
- });
-
- Blade::directive('favicon', function () {
- return "<?php echo \$__env->make('" . self::NAMESPACE . "::favicon', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>";
- });
-
-
- $this->app->extend('crud', function () {
- return new CubistCrudPanel();
- });
- }
-
-
- /**
- * Register any package services.
- *
- * @return void
- */
- public function register()
- {
- $resourcesDir = __DIR__ . '/resources';
-
- $configs = ['app', 'cubist'];
-
- foreach ($configs as $config) {
- $this->mergeConfigFrom($resourcesDir . '/config/' . $config . '.php', $config);
- }
-
-
- $this->commands([
- InstallCommand::class,
- UpdateCommand::class,
- GenerateCommand::class,
- MigrateCommand::class,
- SearchIndexCommand::class,
- LocaleCopy::class,
- LocaleSlugReset::class
- ]);
- }
-}
--- /dev/null
+<?php
+
+namespace Cubist\Backpack;
+
+use Illuminate\Cookie\CookieJar;
+use Illuminate\Cookie\CookieServiceProvider as Base;
+
+class CookieServiceProvider extends Base
+{
+ public function register()
+ {
+ $this->app->singleton('cookie', function ($app) {
+ $config = $app->make('config')->get('session');
+
+ $domains = explode(',', $config['domain']);
+
+ if (count($domains) === 1) {
+ $domain = $domains[0];
+ } else {
+ foreach ($domains as $domain) {
+ if (stripos($_SERVER['HTTP_HOST'], $domain) !== false) {
+ $found = $domain;
+ break;
+ }
+ }
+ if (!isset($found)) {
+ $domain = $_SERVER['HTTP_HOST'];
+ } else {
+ $domain = $found;
+ }
+ }
+ config(['session.domain' => $domain]);
+
+ return (new CookieJar)->setDefaultPathAndDomain(
+ $config['path'], $domain, $config['secure'], $config['same_site'] ?? null
+ );
+ });
+ }
+}
--- /dev/null
+<?php
+
+namespace Cubist\Backpack;
+
+use Cubist\Backpack\Console\Commands\MigrateCommand;
+use Cubist\Backpack\Console\Commands\GenerateCommand;
+use Cubist\Backpack\Console\Commands\InstallCommand;
+use Cubist\Backpack\Console\Commands\LocaleCopy;
+use Cubist\Backpack\Console\Commands\LocaleSlugReset;
+use Cubist\Backpack\Console\Commands\SearchIndexCommand;
+use Cubist\Backpack\Console\Commands\UpdateCommand;
+use Illuminate\Support\Facades\Blade;
+use Illuminate\Support\ServiceProvider;
+
+class CubistBackpackServiceProvider extends ServiceProvider
+{
+ /**
+ * Indicates if loading of the provider is deferred.
+ *
+ * @var bool
+ */
+ protected $defer = false;
+
+ const NAMESPACE = 'cubist_back';
+
+
+ /**
+ * Perform post-registration booting of services.
+ *
+ * @return void
+ */
+ public function boot()
+ {
+ $resourcesDir = __DIR__ . '/../resources';
+
+ $this->loadTranslationsFrom(realpath(__DIR__ . '/resources/lang'), self::NAMESPACE);
+ foreach (glob(__DIR__ . '/routes/cubist/backpack/*.php') as $filename) {
+ $this->loadRoutesFrom($filename);
+ }
+ $this->publishes([$resourcesDir . '/config/cubist.php' => config_path('cubist.php')], 'config');
+ $this->loadViewsFrom(realpath(__DIR__ . '/resources/views'), self::NAMESPACE);
+
+ Blade::directive('vendor_asset', function ($path) {
+ return vendor_asset($path);
+ });
+
+ Blade::directive('favicon', function () {
+ return "<?php echo \$__env->make('" . self::NAMESPACE . "::favicon', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>";
+ });
+
+
+ $this->app->extend('crud', function () {
+ return new CubistCrudPanel();
+ });
+ }
+
+
+ /**
+ * Register any package services.
+ *
+ * @return void
+ */
+ public function register()
+ {
+ $resourcesDir = __DIR__ . '/resources';
+
+ $configs = ['app', 'cubist'];
+
+ foreach ($configs as $config) {
+ $this->mergeConfigFrom($resourcesDir . '/config/' . $config . '.php', $config);
+ }
+
+
+ $this->commands([
+ InstallCommand::class,
+ UpdateCommand::class,
+ GenerateCommand::class,
+ MigrateCommand::class,
+ SearchIndexCommand::class,
+ LocaleCopy::class,
+ LocaleSlugReset::class
+ ]);
+ }
+}