diff --git a/database/factories/SlideFactory.php b/database/factories/SlideFactory.php index f0fea4e..745c359 100644 --- a/database/factories/SlideFactory.php +++ b/database/factories/SlideFactory.php @@ -33,7 +33,7 @@ class SlideFactory extends Factory 'title' => $this->faker->unique()->word(), 'text' => $this->faker->realText(25), 'link_label' => $this->faker->text(128), - 'link' => route('wasup'), + 'link' => 'route(\'wasup\')', 'link_new_tab' => rand(0, 1), 'date_start' => Carbon::now(), 'date_end' => Carbon::now()->addDays(2), diff --git a/routes/web.php b/routes/web.php index 56f6697..8b149f6 100644 --- a/routes/web.php +++ b/routes/web.php @@ -114,58 +114,60 @@ Route::prefix('bo') } ); -$langs = ['en', 'es', '']; +if(!app()->runningInConsole()) { + $langs = ['en', 'es', '']; -foreach ($langs as $lang) { - Route::middleware(['front-end-globals']) - ->prefix($lang) - ->name($lang == '' ? '' : $lang . '.') - ->group( - function () use ($lang) { - Route::get('/', [ControllersHomeController::class, 'index'])->name('home'); + foreach ($langs as $lang) { + Route::middleware(['front-end-globals']) + ->prefix($lang) + ->name($lang == '' ? '' : $lang . '.') + ->group( + function () use ($lang) { + Route::get('/', [ControllersHomeController::class, 'index'])->name('home'); - Route::get( - '/' . Str::slug(Lang::get('urls.marque', [], $lang)), - [ControllersMarqueController::class, 'index'] - )->name('wasup'); - Route::get( - '/' . Str::slug(Lang::get('urls.gammes', [], $lang)), - [ControllersGammesController::class, 'index'] - )->name('gammes.index'); - Route::get( - '/' . Str::slug(Lang::get('urls.gamme', [], $lang)) . '/{gammeSlug:slug}', - [ControllersGammesController::class, 'show'] - )->name('gammes.show'); - Route::get( - '/' . Str::slug(Lang::get('urls.produit', [], $lang)) . '/{gammeSlug:slug}/{productSlug:slug}', - [ControllersProductsController::class, 'show'] - )->name('product.show'); - Route::get( - '/' . Str::slug(Lang::get('urls.news', [], $lang)), - [ControllersNewsController::class, 'index'] - )->name('news'); - Route::get( - '/' . Str::slug(Lang::get('urls.food-service', [], $lang)), - [ControllersFoodServiceController::class, 'index'] - )->name('food'); - Route::get( - '/' . Str::slug(Lang::get('urls.legals', [], $lang)), - [ControllersLegalsController::class, 'index'] - )->name('cgu'); - Route::get( - '/' . Str::slug(Lang::get('urls.policy', [], $lang)), - [ControllersPolicyController::class, 'index'] - )->name('policy'); - Route::get( - '/' . Str::slug(Lang::get('urls.search', [], $lang)), - [ControllersProductsController::class, 'search'] - )->name('search'); - // Classic. - Route::get( - '/' . Str::slug(Lang::get('urls.contact', [], $lang)), - [ControllersContactController::class, 'contact'] - )->name('contact'); - Route::post('/contact', [ControllersContactController::class, 'contactSubmit'])->name('contact.submit'); - } - ); -}//end foreach + Route::get( + '/' . Str::slug(Lang::get('urls.marque', [], $lang)), + [ControllersMarqueController::class, 'index'] + )->name('wasup'); + Route::get( + '/' . Str::slug(Lang::get('urls.gammes', [], $lang)), + [ControllersGammesController::class, 'index'] + )->name('gammes.index'); + Route::get( + '/' . Str::slug(Lang::get('urls.gamme', [], $lang)) . '/{gammeSlug:slug}', + [ControllersGammesController::class, 'show'] + )->name('gammes.show'); + Route::get( + '/' . Str::slug(Lang::get('urls.produit', [], $lang)) . '/{gammeSlug:slug}/{productSlug:slug}', + [ControllersProductsController::class, 'show'] + )->name('product.show'); + Route::get( + '/' . Str::slug(Lang::get('urls.news', [], $lang)), + [ControllersNewsController::class, 'index'] + )->name('news'); + Route::get( + '/' . Str::slug(Lang::get('urls.food-service', [], $lang)), + [ControllersFoodServiceController::class, 'index'] + )->name('food'); + Route::get( + '/' . Str::slug(Lang::get('urls.legals', [], $lang)), + [ControllersLegalsController::class, 'index'] + )->name('cgu'); + Route::get( + '/' . Str::slug(Lang::get('urls.policy', [], $lang)), + [ControllersPolicyController::class, 'index'] + )->name('policy'); + Route::get( + '/' . Str::slug(Lang::get('urls.search', [], $lang)), + [ControllersProductsController::class, 'search'] + )->name('search'); + // Classic. + Route::get( + '/' . Str::slug(Lang::get('urls.contact', [], $lang)), + [ControllersContactController::class, 'contact'] + )->name('contact'); + Route::post('/contact', [ControllersContactController::class, 'contactSubmit'])->name('contact.submit'); + } + ); + }//end foreach +} \ No newline at end of file