@@ -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,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 | ); |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | $query->with('translations'); |
| 51 | 51 | |
| 52 | 52 | foreach ($tags as $tag) { |
| 53 | - $query->whereHas('tags', function (Builder $query) use ($type, $tag) { |
|
| 54 | - $query->whereHas('translations', function (Builder $query) use ($type, $tag) { |
|
| 53 | + $query->whereHas('tags', function(Builder $query) use ($type, $tag) { |
|
| 54 | + $query->whereHas('translations', function(Builder $query) use ($type, $tag) { |
|
| 55 | 55 | $query->where($type, $tag); |
| 56 | 56 | }); |
| 57 | 57 | }); |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | $query->with('translations'); |
| 78 | 78 | |
| 79 | - return $query->whereHas('tags', function (Builder $query) use ($type, $tags) { |
|
| 80 | - $query->whereHas('translations', function (Builder $query) use ($type, $tags) { |
|
| 79 | + return $query->whereHas('tags', function(Builder $query) use ($type, $tags) { |
|
| 80 | + $query->whereHas('translations', function(Builder $query) use ($type, $tags) { |
|
| 81 | 81 | $query->whereIn($type, $tags); |
| 82 | 82 | }); |
| 83 | 83 | }); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | { |
| 165 | 165 | $tag = $this->createTagsModel()->where('namespace', $this->getEntityClassName()) |
| 166 | 166 | ->with('translations') |
| 167 | - ->whereHas('translations', function (Builder $q) use ($name) { |
|
| 167 | + ->whereHas('translations', function(Builder $q) use ($name) { |
|
| 168 | 168 | $q->where('slug', $this->generateTagSlug($name)); |
| 169 | 169 | })->first(); |
| 170 | 170 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | $tag = $this->createTagsModel() |
| 211 | 211 | ->where('namespace', $this->getEntityClassName()) |
| 212 | 212 | ->with('translations') |
| 213 | - ->whereHas('translations', function (Builder $q) use ($name) { |
|
| 213 | + ->whereHas('translations', function(Builder $q) use ($name) { |
|
| 214 | 214 | $q->orWhere('name', $this->generateTagSlug($name)); |
| 215 | 215 | $q->orWhere('slug', $this->generateTagSlug($name)); |
| 216 | 216 | })->first(); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $this->registerBindings(); |
| 33 | 33 | |
| 34 | - $this->app->singleton('tag.widget.directive', function ($app) { |
|
| 34 | + $this->app->singleton('tag.widget.directive', function($app) { |
|
| 35 | 35 | return new TagWidget($app[TagRepository::class]); |
| 36 | 36 | }); |
| 37 | 37 | } |
@@ -55,17 +55,17 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | private function registerBindings() |
| 57 | 57 | { |
| 58 | - $this->app->bind(TagRepository::class, function () { |
|
| 58 | + $this->app->bind(TagRepository::class, function() { |
|
| 59 | 59 | $repository = new EloquentTagRepository(new Tag()); |
| 60 | 60 | |
| 61 | - if (! config('app.cache')) { |
|
| 61 | + if (!config('app.cache')) { |
|
| 62 | 62 | return $repository; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | return new CacheTagDecorator($repository); |
| 66 | 66 | }); |
| 67 | 67 | |
| 68 | - $this->app->singleton(TagManager::class, function () { |
|
| 68 | + $this->app->singleton(TagManager::class, function() { |
|
| 69 | 69 | return new TagManagerRepository(); |
| 70 | 70 | }); |
| 71 | 71 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | if (app()->environment() === 'testing') { |
| 76 | 76 | return; |
| 77 | 77 | } |
| 78 | - $this->app['blade.compiler']->directive('tags', function ($value) { |
|
| 78 | + $this->app['blade.compiler']->directive('tags', function($value) { |
|
| 79 | 79 | return "<?php echo TagWidget::show(array$value); ?>"; |
| 80 | 80 | }); |
| 81 | 81 | } |