| @@ -49,7 +49,7 @@ discard block | ||
| 49 | 49 | */ | 
| 50 | 50 | public function scopeTermsByVocabulary($query, $vocabulary) | 
| 51 | 51 |      { | 
| 52 | -        return $query->whereHas('terms', function ($t) use ($vocabulary) { | |
| 52 | +        return $query->whereHas('terms', function($t) use ($vocabulary) { | |
| 53 | 53 |              $t->where('vocabulary', $vocabulary); | 
| 54 | 54 | }); | 
| 55 | 55 | } | 
| @@ -74,8 +74,8 @@ discard block | ||
| 74 | 74 |      { | 
| 75 | 75 |          foreach ($taxonomies as $vocabulary => $terms) { | 
| 76 | 76 | $terms = is_array($terms) ? $terms : [$terms]; | 
| 77 | -            if (! empty($terms)) { | |
| 78 | -                $query->whereHas('terms', function ($t) use ($vocabulary, $terms, $termKey) { | |
| 77 | +            if (!empty($terms)) { | |
| 78 | +                $query->whereHas('terms', function($t) use ($vocabulary, $terms, $termKey) { | |
| 79 | 79 |                      $t->where('vocabulary', $vocabulary)->whereIn($termKey, $terms); | 
| 80 | 80 | }); | 
| 81 | 81 | } | 
| @@ -74,11 +74,11 @@ discard block | ||
| 74 | 74 | 'name' => 'Бренды товаров', | 
| 75 | 75 | 'description' => 'Бренды товаров магазина', | 
| 76 | 76 | 'terms' => [ | 
| 77 | - ['name' => 'Tesla', 'description' => '',], | |
| 78 | - ['name' => 'BMW', 'description' => '',], | |
| 79 | - ['name' => 'Mercedes', 'description' => '',], | |
| 80 | - ['name' => 'Peugeot', 'description' => '',], | |
| 81 | - ['name' => 'Ford', 'description' => '',], | |
| 77 | + ['name' => 'Tesla', 'description' => '', ], | |
| 78 | + ['name' => 'BMW', 'description' => '', ], | |
| 79 | + ['name' => 'Mercedes', 'description' => '', ], | |
| 80 | + ['name' => 'Peugeot', 'description' => '', ], | |
| 81 | + ['name' => 'Ford', 'description' => '', ], | |
| 82 | 82 | ], | 
| 83 | 83 | ], | 
| 84 | 84 | [ | 
| @@ -87,10 +87,10 @@ discard block | ||
| 87 | 87 | 'description' => 'Статусы заказов', | 
| 88 | 88 | 'terms' => [ | 
| 89 | 89 | ['name' => 'Новый заказ', 'description' => '', 'system_name' => 'order_new'], | 
| 90 | - ['name' => 'Отправлен клиенту', 'description' => '', 'system_name' => 'order_shipping',], | |
| 91 | - ['name' => 'Успешно получен', 'description' => '', 'system_name' => 'order_accept',], | |
| 92 | - ['name' => 'Отклонен', 'description' => '', 'system_name' => 'order_rejected',], | |
| 93 | - ['name' => 'Отказ', 'description' => '', 'system_name' => 'order_refund',], | |
| 90 | + ['name' => 'Отправлен клиенту', 'description' => '', 'system_name' => 'order_shipping', ], | |
| 91 | + ['name' => 'Успешно получен', 'description' => '', 'system_name' => 'order_accept', ], | |
| 92 | + ['name' => 'Отклонен', 'description' => '', 'system_name' => 'order_rejected', ], | |
| 93 | + ['name' => 'Отказ', 'description' => '', 'system_name' => 'order_refund', ], | |
| 94 | 94 | ], | 
| 95 | 95 | ], | 
| 96 | 96 | [ | 
| @@ -109,9 +109,9 @@ discard block | ||
| 109 | 109 | 'name' => 'Единицы измерения количества', | 
| 110 | 110 | 'description' => 'Словарь едениц измерения количества товаров/услуг', | 
| 111 | 111 | 'terms' => [ | 
| 112 | - ['name' => 'см.', 'description' => 'сантиметров',], | |
| 113 | - ['name' => 'т.', 'description' => 'тонн',], | |
| 114 | - ['name' => 'шт.', 'description' => 'штук',], | |
| 112 | + ['name' => 'см.', 'description' => 'сантиметров', ], | |
| 113 | + ['name' => 'т.', 'description' => 'тонн', ], | |
| 114 | + ['name' => 'шт.', 'description' => 'штук', ], | |
| 115 | 115 | ], | 
| 116 | 116 | ], | 
| 117 | 117 | [ | 
| @@ -119,8 +119,8 @@ discard block | ||
| 119 | 119 | 'name' => 'Способы оплаты', | 
| 120 | 120 | 'description' => 'Способы оплаты товаров/услуг', | 
| 121 | 121 | 'terms' => [ | 
| 122 | - ['name' => 'Предоплата', 'description' => 'оплата проводится наперед', 'system_name' => 'pay_prepay',], | |
| 123 | - ['name' => 'Оплата при получении', 'description' => 'оплата проводится при получении товара', 'system_name' => 'pay_upon_receipt',], | |
| 122 | + ['name' => 'Предоплата', 'description' => 'оплата проводится наперед', 'system_name' => 'pay_prepay', ], | |
| 123 | + ['name' => 'Оплата при получении', 'description' => 'оплата проводится при получении товара', 'system_name' => 'pay_upon_receipt', ], | |
| 124 | 124 | ], | 
| 125 | 125 | ], | 
| 126 | 126 | [ | 
| @@ -128,9 +128,9 @@ discard block | ||
| 128 | 128 | 'name' => 'Статусы оплаты', | 
| 129 | 129 | 'description' => 'Статусы оплаты товаров/услуг', | 
| 130 | 130 | 'terms' => [ | 
| 131 | - ['name' => 'Не оплачено', 'description' => 'Новый платеж, ожидает оплаты', 'system_name' => 'payment_new',], | |
| 132 | - ['name' => 'Оплата успешна', 'description' => 'Оплата проведена успешно', 'system_name' => 'payment_success',], | |
| 133 | - ['name' => 'Ошибка оплаты', 'description' => 'Оплата не проведена', 'system_name' => 'payment_fail',], | |
| 131 | + ['name' => 'Не оплачено', 'description' => 'Новый платеж, ожидает оплаты', 'system_name' => 'payment_new', ], | |
| 132 | + ['name' => 'Оплата успешна', 'description' => 'Оплата проведена успешно', 'system_name' => 'payment_success', ], | |
| 133 | + ['name' => 'Ошибка оплаты', 'description' => 'Оплата не проведена', 'system_name' => 'payment_fail', ], | |
| 134 | 134 | ], | 
| 135 | 135 | ], | 
| 136 | 136 | [ | 
| @@ -138,10 +138,10 @@ discard block | ||
| 138 | 138 | 'name' => 'Статусы объявлений', | 
| 139 | 139 | 'description' => 'Статусы модерации объявлений', | 
| 140 | 140 | 'terms' => [ | 
| 141 | - ['name' => 'На модерации', 'description' => 'Обявление находится на модерации', 'system_name' => 'post_moderation',], | |
| 142 | - ['name' => 'Опубликовано', 'description' => 'Обявление успешно опубликовано', 'system_name' => 'post_published',], | |
| 143 | - ['name' => 'Отклонено', 'description' => 'Обявление отклонено для публикации', 'system_name' => 'post_rejected',], | |
| 144 | - ['name' => 'В архиве', 'description' => 'Обявление находится в архиве', 'system_name' => 'post_archived',], | |
| 141 | + ['name' => 'На модерации', 'description' => 'Обявление находится на модерации', 'system_name' => 'post_moderation', ], | |
| 142 | + ['name' => 'Опубликовано', 'description' => 'Обявление успешно опубликовано', 'system_name' => 'post_published', ], | |
| 143 | + ['name' => 'Отклонено', 'description' => 'Обявление отклонено для публикации', 'system_name' => 'post_rejected', ], | |
| 144 | + ['name' => 'В архиве', 'description' => 'Обявление находится в архиве', 'system_name' => 'post_archived', ], | |
| 145 | 145 | ], | 
| 146 | 146 | ], | 
| 147 | 147 | ]; | 
| @@ -161,7 +161,7 @@ discard block | ||
| 161 | 161 | ]); | 
| 162 | 162 |              $this->command->info("Vocabulary saved: $vocabulary->name ($vocabulary->id)"); | 
| 163 | 163 | |
| 164 | -            if (! empty($item['terms'])) { | |
| 164 | +            if (!empty($item['terms'])) { | |
| 165 | 165 | $this->seedTerms($item['terms'], $vocabulary); | 
| 166 | 166 | } | 
| 167 | 167 | } | 
| @@ -186,7 +186,7 @@ discard block | ||
| 186 | 186 | |
| 187 | 187 |              $this->command->info(" - Term saved: $term->name ($term->id)"); | 
| 188 | 188 | |
| 189 | -            if (! empty($item['terms'])) { | |
| 189 | +            if (!empty($item['terms'])) { | |
| 190 | 190 | $this->seedTerms($item['terms'], $vocabulary, $term->id); | 
| 191 | 191 | } | 
| 192 | 192 | } | 
| @@ -82,15 +82,15 @@ | ||
| 82 | 82 | */ | 
| 83 | 83 | public function createTermablesTable() | 
| 84 | 84 |      { | 
| 85 | -         Schema::create('termables', function (Blueprint $table) { | |
| 86 | -             $table->unsignedInteger('term_id'); | |
| 87 | -             $table->morphs('termable'); | |
| 85 | +            Schema::create('termables', function (Blueprint $table) { | |
| 86 | +                $table->unsignedInteger('term_id'); | |
| 87 | +                $table->morphs('termable'); | |
| 88 | 88 | |
| 89 | -             $table->foreign('term_id') | |
| 90 | -                 ->references('id') | |
| 91 | -                 ->on('terms') | |
| 92 | -                 ->onDelete('CASCADE'); | |
| 93 | - }); | |
| 89 | +                $table->foreign('term_id') | |
| 90 | +                    ->references('id') | |
| 91 | +                    ->on('terms') | |
| 92 | +                    ->onDelete('CASCADE'); | |
| 93 | + }); | |
| 94 | 94 | } | 
| 95 | 95 | |
| 96 | 96 | /** | 
| @@ -27,7 +27,7 @@ discard block | ||
| 27 | 27 | */ | 
| 28 | 28 | public function createVocabulariesTable() | 
| 29 | 29 |      { | 
| 30 | -        Schema::create('vocabularies', function (Blueprint $table) { | |
| 30 | +        Schema::create('vocabularies', function(Blueprint $table) { | |
| 31 | 31 |              $table->increments('id'); | 
| 32 | 32 |              $table->string('system_name')->unique(); | 
| 33 | 33 |              $table->string('name'); | 
| @@ -41,7 +41,7 @@ discard block | ||
| 41 | 41 | */ | 
| 42 | 42 | public function createTermsTable() | 
| 43 | 43 |      { | 
| 44 | -        Schema::create('terms', function (Blueprint $table) { | |
| 44 | +        Schema::create('terms', function(Blueprint $table) { | |
| 45 | 45 |              $table->increments('id'); | 
| 46 | 46 |              $table->string('name'); | 
| 47 | 47 |              $table->string('system_name')->nullable()->unique(); // optional | 
| @@ -64,7 +64,7 @@ discard block | ||
| 64 | 64 | */ | 
| 65 | 65 | public function createVocabulariablesTable() | 
| 66 | 66 |      { | 
| 67 | -        Schema::create('vocabularyables', function (Blueprint $table) { | |
| 67 | +        Schema::create('vocabularyables', function(Blueprint $table) { | |
| 68 | 68 |              $table->unsignedInteger('vocabulary_id'); | 
| 69 | 69 |              $table->morphs('vocabularyable'); | 
| 70 | 70 | |
| @@ -80,7 +80,7 @@ discard block | ||
| 80 | 80 | */ | 
| 81 | 81 | public function createTermablesTable() | 
| 82 | 82 |      { | 
| 83 | -         Schema::create('termables', function (Blueprint $table) { | |
| 83 | +         Schema::create('termables', function(Blueprint $table) { | |
| 84 | 84 |               $table->unsignedInteger('term_id'); | 
| 85 | 85 |               $table->morphs('termable'); | 
| 86 | 86 | |
| @@ -29,7 +29,7 @@ discard block | ||
| 29 | 29 | */ | 
| 30 | 30 | public function register() | 
| 31 | 31 |      { | 
| 32 | - $this->mergeConfigFrom(__DIR__.'/../config/taxonomy.php', 'taxonomy'); | |
| 32 | + $this->mergeConfigFrom(__DIR__ . '/../config/taxonomy.php', 'taxonomy'); | |
| 33 | 33 | } | 
| 34 | 34 | |
| 35 | 35 | protected function publishConfig() | 
| @@ -47,10 +47,10 @@ discard block | ||
| 47 | 47 | |
| 48 | 48 | protected function publishMigrations() | 
| 49 | 49 |      { | 
| 50 | -        if (! class_exists('CreateTaxonomiesTable')) { | |
| 50 | +        if (!class_exists('CreateTaxonomiesTable')) { | |
| 51 | 51 |              $timestamp = date('Y_m_d_His', time()); | 
| 52 | 52 | |
| 53 | - $migrationPath = __DIR__.'/../database/migrations/create_taxonomy_tables.php'; | |
| 53 | + $migrationPath = __DIR__ . '/../database/migrations/create_taxonomy_tables.php'; | |
| 54 | 54 |              $this->publishes([$migrationPath => database_path('/migrations/' . $timestamp . '_create_taxonomy_tables.php'), | 
| 55 | 55 | ], 'taxonomy-migrations'); | 
| 56 | 56 | } | 
| @@ -58,8 +58,8 @@ discard block | ||
| 58 | 58 | |
| 59 | 59 | protected function overrideModels() | 
| 60 | 60 |      { | 
| 61 | -        if (! class_exists('App\Models\Term\Taxonomy') || ! class_exists('App\Models\Vocabulary\Taxonomy')) { | |
| 62 | - $modelPathStub = __DIR__.'/stubs/models/'; | |
| 61 | +        if (!class_exists('App\Models\Term\Taxonomy') || !class_exists('App\Models\Vocabulary\Taxonomy')) { | |
| 62 | + $modelPathStub = __DIR__ . '/stubs/models/'; | |
| 63 | 63 |              $modelPath = $this->checkMakeDir(app_path('Models/Taxonomy')) . '/'; | 
| 64 | 64 | |
| 65 | 65 | $this->publishes([ |