@@ -2,30 +2,30 @@ |
||
| 2 | 2 | |
| 3 | 3 | Route::demoAccess('/demo'); |
| 4 | 4 | |
| 5 | -Route::group(['namespace' => 'Back', 'prefix' => 'blender'], function () { |
|
| 5 | +Route::group(['namespace' => 'Back', 'prefix' => 'blender'], function() { |
|
| 6 | 6 | |
| 7 | - require __DIR__ . '/back_auth.php'; |
|
| 7 | + require __DIR__.'/back_auth.php'; |
|
| 8 | 8 | |
| 9 | - Route::group(['middleware' => 'auth'], function () { |
|
| 10 | - require __DIR__ . '/back.php'; |
|
| 9 | + Route::group(['middleware' => 'auth'], function() { |
|
| 10 | + require __DIR__.'/back.php'; |
|
| 11 | 11 | }); |
| 12 | 12 | }); |
| 13 | 13 | |
| 14 | -Route::group(['namespace' => 'Front', 'middleware' => 'demoMode'], function () { |
|
| 14 | +Route::group(['namespace' => 'Front', 'middleware' => 'demoMode'], function() { |
|
| 15 | 15 | |
| 16 | 16 | $multiLingual = count(config('app.locales')) > 1; |
| 17 | 17 | |
| 18 | - Route::group($multiLingual ? ['prefix' => locale()] : [], function () { |
|
| 18 | + Route::group($multiLingual ? ['prefix' => locale()] : [], function() { |
|
| 19 | 19 | try { |
| 20 | - require __DIR__ . '/front_auth.php'; |
|
| 21 | - require __DIR__ . '/front.php'; |
|
| 20 | + require __DIR__.'/front_auth.php'; |
|
| 21 | + require __DIR__.'/front.php'; |
|
| 22 | 22 | } catch (Exception $exception) { |
| 23 | 23 | logger()->warning('Front routes weren\'t included.'); |
| 24 | 24 | } |
| 25 | 25 | }); |
| 26 | 26 | |
| 27 | 27 | if ($multiLingual) { |
| 28 | - Route::get('/', function () { |
|
| 28 | + Route::get('/', function() { |
|
| 29 | 29 | return redirect(locale()); |
| 30 | 30 | }); |
| 31 | 31 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public function label(string $name, bool $required = false, array $options = []) : string |
| 29 | 29 | { |
| 30 | - return Form::label($name, fragment("back.{$this->module}.{$name}") . ($required ? '*' : ''), $options); |
|
| 30 | + return Form::label($name, fragment("back.{$this->module}.{$name}").($required ? '*' : ''), $options); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | public function error(string $name) : string |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $fieldName = $this->fieldName($name, $locale); |
| 85 | 85 | |
| 86 | 86 | $contents = Form::checkbox($fieldName, 1, Form::useInitialValue($this->model, $name, $locale), |
| 87 | - ['class' => 'form-control']) . ' ' . fragment("back.{$this->module}.{$name}"); |
|
| 87 | + ['class' => 'form-control']).' '.fragment("back.{$this->module}.{$name}"); |
|
| 88 | 88 | |
| 89 | 89 | return $this->group([el('label.-checkbox', $contents)]); |
| 90 | 90 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | public function tags(string $type) : string |
| 136 | 136 | { |
| 137 | 137 | return $this->group([ |
| 138 | - Form::label($type.'_tags[]', fragment("back.{$this->module}.{$type}") . '*'), |
|
| 138 | + Form::label($type.'_tags[]', fragment("back.{$this->module}.{$type}").'*'), |
|
| 139 | 139 | Form::tags($this->model, $type), |
| 140 | 140 | ]); |
| 141 | 141 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | public function category(string $type) : string |
| 144 | 144 | { |
| 145 | 145 | return $this->group([ |
| 146 | - Form::label($type.'_tags[]', fragment("back.{$this->module}.{$type}") . '*'), |
|
| 146 | + Form::label($type.'_tags[]', fragment("back.{$this->module}.{$type}").'*'), |
|
| 147 | 147 | Form::category($this->model, $type, ['data-select'=>'select']), |
| 148 | 148 | ]); |
| 149 | 149 | } |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | [ |
| 68 | 68 | 'class' => 'button -danger -small', |
| 69 | 69 | ] |
| 70 | - ) . el('span.fa.fa-remove') . Form::closeButton(); |
|
| 70 | + ).el('span.fa.fa-remove').Form::closeButton(); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | public function onlineIndicator(bool $online) : string |
@@ -10,32 +10,32 @@ discard block |
||
| 10 | 10 | { |
| 11 | 11 | public function register() |
| 12 | 12 | { |
| 13 | - Menu::macro('back', function () { |
|
| 13 | + Menu::macro('back', function() { |
|
| 14 | 14 | return Menu::new() |
| 15 | 15 | ->setActiveClass('-active') |
| 16 | 16 | ->setActiveFromRequest('/blender'); |
| 17 | 17 | }); |
| 18 | 18 | |
| 19 | - Menu::macro('moduleGroup', function ($title) { |
|
| 19 | + Menu::macro('moduleGroup', function($title) { |
|
| 20 | 20 | return Menu::back() |
| 21 | 21 | ->addParentClass('menu_group') |
| 22 | 22 | ->setParentAttribute('data-menu-group', fragment("back.nav.{$title}")) |
| 23 | - ->registerFilter(function (Link $link) { |
|
| 23 | + ->registerFilter(function(Link $link) { |
|
| 24 | 24 | $link->addParentClass('menu_group_item'); |
| 25 | 25 | }); |
| 26 | 26 | }); |
| 27 | 27 | |
| 28 | - Menu::macro('startSecondary', function () { |
|
| 29 | - return $this->registerFilter(function (Link $link) { |
|
| 28 | + Menu::macro('startSecondary', function() { |
|
| 29 | + return $this->registerFilter(function(Link $link) { |
|
| 30 | 30 | $link->addParentClass('-secondary'); |
| 31 | 31 | }); |
| 32 | 32 | }); |
| 33 | 33 | |
| 34 | - Menu::macro('module', function (string $action, string $name) { |
|
| 34 | + Menu::macro('module', function(string $action, string $name) { |
|
| 35 | 35 | return $this->action("Back\\{$action}", fragment("back.{$name}")); |
| 36 | 36 | }); |
| 37 | 37 | |
| 38 | - Menu::macro('backMain', function () { |
|
| 38 | + Menu::macro('backMain', function() { |
|
| 39 | 39 | return Menu::back() |
| 40 | 40 | ->addClass('menu_groups') |
| 41 | 41 | ->setAttribute('data-menu-groups') |
@@ -67,9 +67,9 @@ discard block |
||
| 67 | 67 | ); |
| 68 | 68 | }); |
| 69 | 69 | |
| 70 | - Menu::macro('backUser', function () { |
|
| 70 | + Menu::macro('backUser', function() { |
|
| 71 | 71 | |
| 72 | - $avatar = HTML::avatar(current_user(), '-small') . |
|
| 72 | + $avatar = HTML::avatar(current_user(), '-small'). |
|
| 73 | 73 | el('span.:response-desktop-only', current_user()->email); |
| 74 | 74 | |
| 75 | 75 | return Menu::new() |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | public static function findByNameOrCreate(string $name, TagType $type) : Tag |
| 33 | 33 | { |
| 34 | 34 | $existing = Tag::nonDraft()->get() |
| 35 | - ->first(function (int $id, Tag $tag) use ($name) { |
|
| 35 | + ->first(function(int $id, Tag $tag) use ($name) { |
|
| 36 | 36 | return $tag->translate('name', content_locale()) === $name; |
| 37 | 37 | }); |
| 38 | 38 | |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | { |
| 7 | 7 | public static function bootHasUrl() |
| 8 | 8 | { |
| 9 | - static::saving(function ($model) { |
|
| 9 | + static::saving(function($model) { |
|
| 10 | 10 | |
| 11 | 11 | if (!in_array('name', $model->translatable ?? [])) { |
| 12 | 12 | $model->url = str_slug($model->name); |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | $newsletter->subscribe($this->user->email, [], 'subscribers'); |
| 33 | 33 | |
| 34 | 34 | Log::info("subscribed {$this->user->email} to the newsletter"); |
| 35 | - } catch(Exception $e) { |
|
| 35 | + } catch (Exception $e) { |
|
| 36 | 36 | Log::warning("could not subscribe {$this->user->email} to the newsletter because {$e->getMessage()}"); |
| 37 | 37 | } |
| 38 | 38 | |