@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('pages', function (Blueprint $table) { |
|
| 16 | + Schema::create('pages', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->integer('template_id'); |
| 19 | 19 | $table->string('page')->nullable()->default(null); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | $this->doPublishing(); |
| 29 | 29 | |
| 30 | - $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); |
|
| 30 | + $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); |
|
| 31 | 31 | |
| 32 | 32 | $router = $this->app->make(Router::class); |
| 33 | 33 | $router->aliasMiddleware('role', RoleMiddleware::class); |
@@ -53,13 +53,13 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | $this->app['App\User'] = $this->app['Chuckbe\Chuckcms\Models\User']; |
| 55 | 55 | |
| 56 | - $this->loadViewsFrom(__DIR__.'/views', 'chuckcms'); |
|
| 56 | + $this->loadViewsFrom(__DIR__ . '/views', 'chuckcms'); |
|
| 57 | 57 | // publish error views + publish updated lfm views |
| 58 | 58 | |
| 59 | - $this->mergeConfigFrom(__DIR__.'/../config/chuckcms.php', 'chuckcms'); |
|
| 60 | - $this->mergeConfigFrom(__DIR__.'/../config/menu.php', 'menu'); |
|
| 61 | - $this->mergeConfigFrom(__DIR__.'/../config/lfm.php', 'lfm'); |
|
| 62 | - $this->mergeConfigFrom(__DIR__.'/../config/lang.php', 'lang'); |
|
| 59 | + $this->mergeConfigFrom(__DIR__ . '/../config/chuckcms.php', 'chuckcms'); |
|
| 60 | + $this->mergeConfigFrom(__DIR__ . '/../config/menu.php', 'menu'); |
|
| 61 | + $this->mergeConfigFrom(__DIR__ . '/../config/lfm.php', 'lfm'); |
|
| 62 | + $this->mergeConfigFrom(__DIR__ . '/../config/lang.php', 'lang'); |
|
| 63 | 63 | |
| 64 | 64 | $this->app->register('Chuckbe\Chuckcms\Providers\ChuckSiteServiceProvider'); |
| 65 | 65 | $this->app->register('Chuckbe\Chuckcms\Providers\ChuckTemplateServiceProvider'); |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | $this->publishes([ |
| 91 | - __DIR__.'/resources' => public_path('chuckbe/chuckcms'), |
|
| 91 | + __DIR__ . '/resources' => public_path('chuckbe/chuckcms'), |
|
| 92 | 92 | ], 'chuckcms-public'); |
| 93 | 93 | |
| 94 | 94 | $this->publishes([ |
| 95 | - __DIR__.'/../config/chuckcms.php' => config_path('chuckcms.php'), |
|
| 96 | - __DIR__.'/../config/menu.php' => config_path('menu.php'), |
|
| 97 | - __DIR__.'/../config/lfm.php' => config_path('lfm.php'), |
|
| 98 | - __DIR__.'/../config/lang.php' => config_path('lang.php'), |
|
| 95 | + __DIR__ . '/../config/chuckcms.php' => config_path('chuckcms.php'), |
|
| 96 | + __DIR__ . '/../config/menu.php' => config_path('menu.php'), |
|
| 97 | + __DIR__ . '/../config/lfm.php' => config_path('lfm.php'), |
|
| 98 | + __DIR__ . '/../config/lang.php' => config_path('lang.php'), |
|
| 99 | 99 | ], 'chuckcms-config'); |
| 100 | 100 | } |
| 101 | 101 | |
@@ -110,11 +110,11 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | $filesystem = $this->app->make(Filesystem::class); |
| 112 | 112 | |
| 113 | - return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) |
|
| 114 | - ->flatMap(function ($path) use ($filesystem, $migrationFileName) { |
|
| 115 | - return $filesystem->glob($path.'*_'.$migrationFileName); |
|
| 113 | + return Collection::make($this->app->databasePath() . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR) |
|
| 114 | + ->flatMap(function($path) use ($filesystem, $migrationFileName) { |
|
| 115 | + return $filesystem->glob($path . '*_' . $migrationFileName); |
|
| 116 | 116 | }) |
| 117 | - ->push($this->app->databasePath()."/migrations/{$timestamp}_{$migrationFileName}") |
|
| 117 | + ->push($this->app->databasePath() . "/migrations/{$timestamp}_{$migrationFileName}") |
|
| 118 | 118 | ->first(); |
| 119 | 119 | } |
| 120 | 120 | } |
@@ -64,16 +64,16 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | $repeater = $this->repeater->where('url', $slug)->first(); |
| 66 | 66 | if ($repeater !== null) { |
| 67 | - $templateHintpath = explode('::', (string) $repeater->page)[0]; |
|
| 67 | + $templateHintpath = explode('::', (string)$repeater->page)[0]; |
|
| 68 | 68 | $template = $this->template->where('active', 1)->where('hintpath', $templateHintpath)->first(); |
| 69 | 69 | |
| 70 | - return view((string) $repeater->page, compact('template', 'repeater')); |
|
| 70 | + return view((string)$repeater->page, compact('template', 'repeater')); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - $page = $this->page->where('slug->'.app()->getLocale(), $slug)->first(); |
|
| 73 | + $page = $this->page->where('slug->' . app()->getLocale(), $slug)->first(); |
|
| 74 | 74 | if ($page == null) { |
| 75 | 75 | foreach (\LaravelLocalization::getSupportedLocales() as $localeCode => $properties) { |
| 76 | - $page = $this->page->where('slug->'.$localeCode, $slug)->first(); |
|
| 76 | + $page = $this->page->where('slug->' . $localeCode, $slug)->first(); |
|
| 77 | 77 | if ($page !== null && $localeCode == app()->getLocale()) { |
| 78 | 78 | break; |
| 79 | 79 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | app()->setLocale($localeCode); |
| 84 | 84 | \LaravelLocalization::setLocale($localeCode); |
| 85 | 85 | |
| 86 | - return redirect($localeCode.'/'.$slug); |
|
| 86 | + return redirect($localeCode . '/' . $slug); |
|
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | $template = $this->template->where('active', 1)->where('id', $page->template_id)->first(); |
| 128 | 128 | |
| 129 | - return view($template->hintpath.'::templates.'.$template->slug.'.page', compact('template', 'page', 'pageblocks')); |
|
| 129 | + return view($template->hintpath . '::templates.' . $template->slug . '.page', compact('template', 'page', 'pageblocks')); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | public function css(Page $page) |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | |
| 41 | 41 | public static function getUrl($id) |
| 42 | 42 | { |
| 43 | - return ChuckSite::getSetting('domain').'/'.self::where('id', $id)->first()->slug; |
|
| 43 | + return ChuckSite::getSetting('domain') . '/' . self::where('id', $id)->first()->slug; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | public function deleteById($id) |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | $follow = 'nofollow'; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $meta[$langKey]['robots'] = $index.$follow; |
|
| 56 | - $meta[$langKey]['googlebots'] = $index.$follow; |
|
| 55 | + $meta[$langKey]['robots'] = $index . $follow; |
|
| 56 | + $meta[$langKey]['googlebots'] = $index . $follow; |
|
| 57 | 57 | |
| 58 | 58 | $count = count($request->get('meta_key')[$langKey]); |
| 59 | 59 | for ($i = 0; $i < $count; $i++) { |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | $follow = 'nofollow'; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - $meta[$langKey]['robots'] = $index.$follow; |
|
| 110 | - $meta[$langKey]['googlebots'] = $index.$follow; |
|
| 109 | + $meta[$langKey]['robots'] = $index . $follow; |
|
| 110 | + $meta[$langKey]['googlebots'] = $index . $follow; |
|
| 111 | 111 | |
| 112 | 112 | $count = count($request->get('meta_key')[$langKey]); |
| 113 | 113 | for ($i = 0; $i < $count; $i++) { |
@@ -14,13 +14,13 @@ discard block |
||
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | 16 | if (!Schema::hasColumn('pages', 'css')) { |
| 17 | - Schema::table('pages', function (Blueprint $table) { |
|
| 17 | + Schema::table('pages', function(Blueprint $table) { |
|
| 18 | 18 | $table->longText('css')->nullable()->after('meta'); |
| 19 | 19 | }); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | if (!Schema::hasColumn('pages', 'js')) { |
| 23 | - Schema::table('pages', function (Blueprint $table) { |
|
| 23 | + Schema::table('pages', function(Blueprint $table) { |
|
| 24 | 24 | $table->longText('js')->nullable()->after('css'); |
| 25 | 25 | }); |
| 26 | 26 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function down() |
| 35 | 35 | { |
| 36 | - Schema::table('pages', function (Blueprint $table) { |
|
| 36 | + Schema::table('pages', function(Blueprint $table) { |
|
| 37 | 37 | $table->dropColumn('js'); |
| 38 | 38 | $table->dropColumn('css'); |
| 39 | 39 | }); |