@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | protected $namespace = 'Modules\Tag\Http\Controllers'; |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | - * @return string |
|
| 16 | + * @return boolean |
|
| 17 | 17 | */ |
| 18 | 18 | protected function getFrontendRoute() |
| 19 | 19 | { |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * @return string |
|
| 32 | + * @return boolean |
|
| 33 | 33 | */ |
| 34 | 34 | protected function getApiRoute() |
| 35 | 35 | { |
@@ -3,8 +3,8 @@ |
||
| 3 | 3 | use Illuminate\Routing\Router; |
| 4 | 4 | |
| 5 | 5 | /** @var Router $router */ |
| 6 | -$router->group(['prefix' => 'tag'], function (Router $router) { |
|
| 7 | - $router->bind('tag__tag', function ($id) { |
|
| 6 | +$router->group(['prefix' => 'tag'], function(Router $router) { |
|
| 7 | + $router->bind('tag__tag', function($id) { |
|
| 8 | 8 | return app(\Modules\Tag\Repositories\TagRepository::class)->find($id); |
| 9 | 9 | }); |
| 10 | 10 | $router->get('tags', [ |
@@ -12,14 +12,14 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('tag__tags', function (Blueprint $table) { |
|
| 15 | + Schema::create('tag__tags', function(Blueprint $table) { |
|
| 16 | 16 | $table->engine = 'InnoDB'; |
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('namespace'); |
| 19 | 19 | $table->timestamps(); |
| 20 | 20 | }); |
| 21 | 21 | |
| 22 | - Schema::create('tag__tagged', function (Blueprint $table) { |
|
| 22 | + Schema::create('tag__tagged', function(Blueprint $table) { |
|
| 23 | 23 | $table->increments('id'); |
| 24 | 24 | $table->string('taggable_type'); |
| 25 | 25 | $table->integer('taggable_id')->unsigned(); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('tag__tag_translations', function (Blueprint $table) { |
|
| 16 | + Schema::create('tag__tag_translations', function(Blueprint $table) { |
|
| 17 | 17 | $table->engine = 'InnoDB'; |
| 18 | 18 | $table->increments('id'); |
| 19 | 19 | $table->string('slug'); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $this->registerBindings(); |
| 33 | 33 | |
| 34 | - $this->app->singleton('tag.widget', function ($app) { |
|
| 34 | + $this->app->singleton('tag.widget', function($app) { |
|
| 35 | 35 | return new TagWidget($app[TagRepository::class]); |
| 36 | 36 | }); |
| 37 | 37 | } |
@@ -54,17 +54,17 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | private function registerBindings() |
| 56 | 56 | { |
| 57 | - $this->app->bind(TagRepository::class, function () { |
|
| 57 | + $this->app->bind(TagRepository::class, function() { |
|
| 58 | 58 | $repository = new EloquentTagRepository(new Tag()); |
| 59 | 59 | |
| 60 | - if (! config('app.cache')) { |
|
| 60 | + if (!config('app.cache')) { |
|
| 61 | 61 | return $repository; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | return new CacheTagDecorator($repository); |
| 65 | 65 | }); |
| 66 | 66 | |
| 67 | - $this->app->singleton(TagManager::class, function () { |
|
| 67 | + $this->app->singleton(TagManager::class, function() { |
|
| 68 | 68 | return new TagManagerRepository(); |
| 69 | 69 | }); |
| 70 | 70 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | if (app()->environment() === 'testing') { |
| 75 | 75 | return; |
| 76 | 76 | } |
| 77 | - $this->app['blade.compiler']->directive('tags', function ($value) { |
|
| 77 | + $this->app['blade.compiler']->directive('tags', function($value) { |
|
| 78 | 78 | return "<?php echo TagWidget::show(array$value); ?>"; |
| 79 | 79 | }); |
| 80 | 80 | } |
@@ -31,8 +31,8 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function extendWith(Menu $menu) |
| 33 | 33 | { |
| 34 | - $menu->group(trans('core::sidebar.content'), function (Group $group) { |
|
| 35 | - $group->item(trans('tag::tags.tags'), function (Item $item) { |
|
| 34 | + $menu->group(trans('core::sidebar.content'), function(Group $group) { |
|
| 35 | + $group->item(trans('tag::tags.tags'), function(Item $item) { |
|
| 36 | 36 | $item->icon('fa fa-tag'); |
| 37 | 37 | $item->weight(0); |
| 38 | 38 | $item->route('admin.tag.tag.index'); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | return $this->cache |
| 25 | 25 | ->tags($this->entityName, 'global') |
| 26 | 26 | ->remember("{$this->locale}.{$this->entityName}.allForNamespace.{$namespace}", $this->cacheTime, |
| 27 | - function () use ($namespace) { |
|
| 27 | + function() use ($namespace) { |
|
| 28 | 28 | return $this->repository->allForNamespace($namespace); |
| 29 | 29 | } |
| 30 | 30 | ); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | { |
| 115 | 115 | $tag = $this->createTagsModel()->where('namespace', $this->getEntityClassName()) |
| 116 | 116 | ->with('translations') |
| 117 | - ->whereHas('translations', function (Builder $q) use ($name) { |
|
| 117 | + ->whereHas('translations', function(Builder $q) use ($name) { |
|
| 118 | 118 | $q->where('slug', $this->generateTagSlug($name)); |
| 119 | 119 | })->first(); |
| 120 | 120 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $tag = $this->createTagsModel() |
| 161 | 161 | ->where('namespace', $this->getEntityClassName()) |
| 162 | 162 | ->with('translations') |
| 163 | - ->whereHas('translations', function (Builder $q) use ($name) { |
|
| 163 | + ->whereHas('translations', function(Builder $q) use ($name) { |
|
| 164 | 164 | $q->orWhere('name', $this->generateTagSlug($name)); |
| 165 | 165 | $q->orWhere('slug', $this->generateTagSlug($name)); |
| 166 | 166 | })->first(); |