passage phpcbf
This commit is contained in:
parent
7ffae283c0
commit
e48a257513
38 changed files with 162 additions and 154 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* Undocumented class
|
||||
*
|
||||
*
|
||||
* @category Description
|
||||
* @package Category
|
||||
* @author Name <email@email.com>
|
||||
|
|
@ -17,7 +17,7 @@ use Kwaadpepper\ExceptionHandler\Exceptions\ExceptionHandler;
|
|||
|
||||
/**
|
||||
* Undocumented class
|
||||
*
|
||||
*
|
||||
* @category Description
|
||||
* @package Category
|
||||
* @author Name <email@email.com>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* Controller pour le login
|
||||
*
|
||||
*
|
||||
* @category Description
|
||||
* @package Category
|
||||
* @author Name <email@email.com>
|
||||
|
|
@ -19,7 +19,7 @@ use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
|||
|
||||
/**
|
||||
* Undocumented class
|
||||
*
|
||||
*
|
||||
* @category Description
|
||||
* @package Category
|
||||
* @author Name <email@email.com>
|
||||
|
|
|
|||
|
|
@ -31,13 +31,13 @@ class AdviceController extends Controller
|
|||
public function update(Advice $advice, UpdateAdviceRequest $request)
|
||||
{
|
||||
$advice->fill($request->validated());
|
||||
if (is_a($request->picture1,"SplFileInfo")) {
|
||||
if (is_a($request->picture1, "SplFileInfo")) {
|
||||
$advice->picture1 = Utils::storeImage($request->picture1, $advice->getTable());
|
||||
}
|
||||
if (is_a($request->picture2,"SplFileInfo")) {
|
||||
if (is_a($request->picture2, "SplFileInfo")) {
|
||||
$advice->picture2 = Utils::storeImage($request->picture2, $advice->getTable());
|
||||
}
|
||||
if (is_a($request->picture3,"SplFileInfo")) {
|
||||
if (is_a($request->picture3, "SplFileInfo")) {
|
||||
$advice->picture3 = Utils::storeImage($request->picture3, $advice->getTable());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class EncartsController extends Controller
|
|||
public function update(Encart $encart, UpdateEncartRequest $request)
|
||||
{
|
||||
$encart->fill($request->validated());
|
||||
if (is_a($request->picture,"SplFileInfo")) {
|
||||
if (is_a($request->picture, "SplFileInfo")) {
|
||||
$encart->picture = Utils::storeImage($request->picture, $encart->getTable());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ use App\Models\Moment;
|
|||
|
||||
class MomentsController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class PictoBrandsController extends Controller
|
|||
public function store(StorePictoBrandRequest $request)
|
||||
{
|
||||
$pictobrand = new PictoBrand($request->validated());
|
||||
if (is_a($request->picture,"SplFileInfo")) {
|
||||
if (is_a($request->picture, "SplFileInfo")) {
|
||||
$pictobrand->picture = Utils::storeImage($request->picture, $pictobrand->getTable());
|
||||
}
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ class PictoBrandsController extends Controller
|
|||
public function update(PictoBrand $pictobrand, UpdatePictoBrandRequest $request)
|
||||
{
|
||||
$pictobrand->fill($request->validated());
|
||||
if (is_a($request->picture,"SplFileInfo")) {
|
||||
if (is_a($request->picture, "SplFileInfo")) {
|
||||
$pictobrand->picture = Utils::storeImage($request->picture, $pictobrand->getTable());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,10 +43,10 @@ class PostsController extends Controller
|
|||
public function store(StorePostRequest $request)
|
||||
{
|
||||
$post = new Post($request->validated());
|
||||
if (is_a($request->picture_home,"SplFileInfo")) {
|
||||
if (is_a($request->picture_home, "SplFileInfo")) {
|
||||
$post->picture_home = Utils::storeImage($request->picture_home, $post->getTable());
|
||||
}
|
||||
if (is_a($request->picture_news,"SplFileInfo")) {
|
||||
if (is_a($request->picture_news, "SplFileInfo")) {
|
||||
$post->picture_news = Utils::storeImage($request->picture_news, $post->getTable());
|
||||
}
|
||||
$response = $this->changeUniquePostOnTop($post->on_top);
|
||||
|
|
@ -82,10 +82,10 @@ class PostsController extends Controller
|
|||
public function update(Post $post, UpdatePostRequest $request)
|
||||
{
|
||||
$post->fill($request->validated());
|
||||
if (is_a($request->picture_home,"SplFileInfo")) {
|
||||
if (is_a($request->picture_home, "SplFileInfo")) {
|
||||
$post->picture_home = Utils::storeImage($request->picture_home, $post->getTable());
|
||||
}
|
||||
if (is_a($request->picture_news,"SplFileInfo")) {
|
||||
if (is_a($request->picture_news, "SplFileInfo")) {
|
||||
$post->picture_news = Utils::storeImage($request->picture_news, $post->getTable());
|
||||
}
|
||||
$response = $this->changeUniquePostOnTop($post->on_top);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class SlidesController extends Controller
|
|||
|
||||
$slide = new Slide($request->validated());
|
||||
$slide->order = $this->getLastOrder();
|
||||
if (is_a($request->picture,"SplFileInfo")) {
|
||||
if (is_a($request->picture, "SplFileInfo")) {
|
||||
$slide->picture = Utils::storeImage($request->picture, $slide->getTable());
|
||||
}
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ class SlidesController extends Controller
|
|||
public function update(StoreSlideRequest $request, Slide $slide)
|
||||
{
|
||||
$slide->fill($request->validated());
|
||||
if (is_a($request->picture,"SplFileInfo")) {
|
||||
if (is_a($request->picture, "SplFileInfo")) {
|
||||
$slide->picture = Utils::storeImage($request->picture, $slide->getTable());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,14 +14,19 @@ class FoodServiceController extends Controller
|
|||
public function index()
|
||||
{
|
||||
$page = Page::foodservice();
|
||||
$seoDatum = SeoDatum::where('page',$page)->first();
|
||||
$seoDatum = SeoDatum::where('page', $page)->first();
|
||||
|
||||
$encart_food = Encart::where('page', Page::foodHeader()->value)->first();
|
||||
$title_foodBloc2 = Title::where('page', Page::foodBloc2()->value)->first();
|
||||
$pictos_food = Picto::where('page', Page::foodBloc2()->value)->get();
|
||||
$products_food = Product::where('is_food_service', true)->get();
|
||||
|
||||
return view('front.food-service', compact('seoDatum' , 'encart_food', 'title_foodBloc2',
|
||||
'pictos_food', 'products_food'));
|
||||
return view('front.food-service', compact(
|
||||
'seoDatum',
|
||||
'encart_food',
|
||||
'title_foodBloc2',
|
||||
'pictos_food',
|
||||
'products_food'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,11 +14,11 @@ class GammesController extends Controller
|
|||
$gammes = Gamme::whereNull('parent_gamme_id')->orderBy('title')->get();
|
||||
//remove Food Service from count
|
||||
/** @var \Illuminate\Database\Eloquent\Collection $gammes */
|
||||
$gammes = $gammes->whereNotIn('slug','food-service');
|
||||
$gammes = $gammes->whereNotIn('slug', 'food-service');
|
||||
$nb_gammes = $gammes->count();
|
||||
|
||||
$page = Page::gammes();
|
||||
$seoDatum = SeoDatum::where('page',$page)->first();
|
||||
$seoDatum = SeoDatum::where('page', $page)->first();
|
||||
|
||||
return view('front.gammes.index', compact('gammes', 'nb_gammes', 'seoDatum'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class HomeController extends Controller
|
|||
{
|
||||
|
||||
$page = Page::home();
|
||||
$seoDatum = SeoDatum::where('page',$page)->first();
|
||||
$seoDatum = SeoDatum::where('page', $page)->first();
|
||||
|
||||
$slider = Slider::where('published', 1)->first();
|
||||
if ($slider) {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,6 @@ class LegalsController extends Controller
|
|||
$seoDatum = new SeoDatum();
|
||||
$seoDatum->title = $mentions_legales->title;
|
||||
|
||||
return view('front.legals', compact('seoDatum' ,'mentions_legales'));
|
||||
return view('front.legals', compact('seoDatum', 'mentions_legales'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class MarqueController extends Controller
|
|||
public function index()
|
||||
{
|
||||
$page = Page::marque();
|
||||
$seoDatum = SeoDatum::where('page',$page)->first();
|
||||
$seoDatum = SeoDatum::where('page', $page)->first();
|
||||
|
||||
$encart_marqueHeader = Encart::where('page', Page::marqueHeader()->value)->first();
|
||||
$encart_marqueBloc4l = Encart::where('page', Page::marqueBloc4l()->value)->first();
|
||||
|
|
@ -28,8 +28,17 @@ class MarqueController extends Controller
|
|||
$title_marqueBloc4 = Title::where('page', Page::marqueBloc4()->value)->first();
|
||||
$moments = Moment::where('page', Page::marqueHistory()->value)->get();
|
||||
|
||||
return view('front.a-propos', compact('seoDatum', 'encart_marqueHeader', 'encart_marqueBloc4l',
|
||||
'encart_marqueBloc4r', 'encart_marqueFooter', 'pictobrands_marque', 'title_marqueBloc2',
|
||||
'pictos_marqueBloc2', 'moments', 'title_marqueBloc4'));
|
||||
return view('front.a-propos', compact(
|
||||
'seoDatum',
|
||||
'encart_marqueHeader',
|
||||
'encart_marqueBloc4l',
|
||||
'encart_marqueBloc4r',
|
||||
'encart_marqueFooter',
|
||||
'pictobrands_marque',
|
||||
'title_marqueBloc2',
|
||||
'pictos_marqueBloc2',
|
||||
'moments',
|
||||
'title_marqueBloc4'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class NewsController extends Controller
|
|||
public function index()
|
||||
{
|
||||
$page = Page::news();
|
||||
$seoDatum = SeoDatum::where('page',$page)->first();
|
||||
$seoDatum = SeoDatum::where('page', $page)->first();
|
||||
|
||||
$advice_news = Advice::all()->first();
|
||||
$texts_news = Text::where('page', Page::newsQuestions()->value)->get();
|
||||
|
|
@ -31,6 +31,6 @@ class NewsController extends Controller
|
|||
|
||||
$products_news = Product::where('is_news', true)->get();
|
||||
|
||||
return view('front.news', compact('seoDatum', 'advice_news' , 'texts_news', 'title_newsPosts', 'posts', 'products_news'));
|
||||
return view('front.news', compact('seoDatum', 'advice_news', 'texts_news', 'title_newsPosts', 'posts', 'products_news'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ class ProductsController extends Controller
|
|||
return view('front.product', compact('product', 'gamme', 'seoDatum'));
|
||||
}
|
||||
|
||||
public function search(Request $request) {
|
||||
public function search(Request $request)
|
||||
{
|
||||
$filter = $request->query('filter');
|
||||
|
||||
if (!empty($filter)) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* Middleware pour l'auth
|
||||
*
|
||||
*
|
||||
* @category Description
|
||||
* @package Category
|
||||
* @author Name <email@email.com>
|
||||
|
|
@ -17,7 +17,7 @@ use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
|||
|
||||
/**
|
||||
* Undocumented class
|
||||
*
|
||||
*
|
||||
* @category Description
|
||||
* @package Category
|
||||
* @author Name <email@email.com>
|
||||
|
|
@ -30,7 +30,7 @@ class Authenticate extends Middleware
|
|||
* Get the path the user should be redirected to when they are not authenticated.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request La requête
|
||||
*
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
protected function redirectTo($request)
|
||||
|
|
|
|||
|
|
@ -23,17 +23,17 @@ class FrontEndGlobals
|
|||
$routeParamsFR = Route::current()->parameters();
|
||||
$routeParamsEN = $routeParamsFR;
|
||||
$routeParamsES = $routeParamsFR;
|
||||
array_walk($routeParamsFR, array($this, 'unbind'),'');
|
||||
array_walk($routeParamsEN, array($this, 'unbind'),'en');
|
||||
array_walk($routeParamsES, array($this, 'unbind'),'es');
|
||||
if (preg_match('/^(en|es)/', $currentRoute )) {
|
||||
$currentRouteFR = preg_replace('/^(en|es)\./', '', $currentRoute,1);
|
||||
$currentRouteEN = preg_replace('/^(en|es)/', 'en', $currentRoute,1);
|
||||
$currentRouteES = preg_replace('/^(en|es)/', 'es', $currentRoute,1);
|
||||
array_walk($routeParamsFR, array($this, 'unbind'), '');
|
||||
array_walk($routeParamsEN, array($this, 'unbind'), 'en');
|
||||
array_walk($routeParamsES, array($this, 'unbind'), 'es');
|
||||
if (preg_match('/^(en|es)/', $currentRoute)) {
|
||||
$currentRouteFR = preg_replace('/^(en|es)\./', '', $currentRoute, 1);
|
||||
$currentRouteEN = preg_replace('/^(en|es)/', 'en', $currentRoute, 1);
|
||||
$currentRouteES = preg_replace('/^(en|es)/', 'es', $currentRoute, 1);
|
||||
} else {
|
||||
$currentRouteFR = $currentRoute;
|
||||
$currentRouteEN = 'en.'.$currentRoute;
|
||||
$currentRouteES = 'es.'.$currentRoute;
|
||||
$currentRouteEN = 'en.' . $currentRoute;
|
||||
$currentRouteES = 'es.' . $currentRoute;
|
||||
}
|
||||
|
||||
View::share('currentRouteFR', $currentRouteFR);
|
||||
|
|
@ -46,8 +46,9 @@ class FrontEndGlobals
|
|||
return $next($request);
|
||||
}
|
||||
|
||||
public function unbind(&$item,$k,$lang) {
|
||||
if($k=='gammeSlug' || $k=='productSlug') {
|
||||
public function unbind(&$item, $k, $lang)
|
||||
{
|
||||
if ($k == 'gammeSlug' || $k == 'productSlug') {
|
||||
$item = $item->getTranslation('slug', $lang);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ use Illuminate\Http\UploadedFile;
|
|||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Str;
|
||||
use SplFileInfo;
|
||||
|
||||
/**
|
||||
* Some utilities methods
|
||||
*
|
||||
|
|
|
|||
|
|
@ -42,25 +42,25 @@ class Advice extends Model
|
|||
protected static function boot()
|
||||
{
|
||||
static::creating(function (Advice $advice) {
|
||||
if (is_a($advice->picture1,"SplFileInfo")) {
|
||||
if (is_a($advice->picture1, "SplFileInfo")) {
|
||||
$advice->picture1 = Utils::storeImage($advice->picture1, $advice->getTable());
|
||||
}
|
||||
if (is_a($advice->picture2,"SplFileInfo")) {
|
||||
if (is_a($advice->picture2, "SplFileInfo")) {
|
||||
$advice->picture2 = Utils::storeImage($advice->picture2, $advice->getTable());
|
||||
}
|
||||
if (is_a($advice->picture3,"SplFileInfo")) {
|
||||
if (is_a($advice->picture3, "SplFileInfo")) {
|
||||
$advice->picture3 = Utils::storeImage($advice->picture3, $advice->getTable());
|
||||
}
|
||||
});
|
||||
|
||||
static::updating(function (Advice $advice) {
|
||||
if (is_a($advice->picture1,"SplFileInfo")) {
|
||||
if (is_a($advice->picture1, "SplFileInfo")) {
|
||||
$advice->picture1 = Utils::storeImage($advice->picture1, $advice->getTable());
|
||||
}
|
||||
if (is_a($advice->picture2,"SplFileInfo")) {
|
||||
if (is_a($advice->picture2, "SplFileInfo")) {
|
||||
$advice->picture2 = Utils::storeImage($advice->picture2, $advice->getTable());
|
||||
}
|
||||
if (is_a($advice->picture3,"SplFileInfo")) {
|
||||
if (is_a($advice->picture3, "SplFileInfo")) {
|
||||
$advice->picture3 = Utils::storeImage($advice->picture3, $advice->getTable());
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -37,13 +37,13 @@ class Encart extends Model
|
|||
protected static function boot()
|
||||
{
|
||||
static::creating(function (Encart $encart) {
|
||||
if (is_a($encart->picture,"SplFileInfo")) {
|
||||
if (is_a($encart->picture, "SplFileInfo")) {
|
||||
$encart->picture = Utils::storeImage($encart->picture, $encart->getTable());
|
||||
}
|
||||
});
|
||||
|
||||
static::updating(function (Encart $encart) {
|
||||
if (is_a($encart->picture,"SplFileInfo")) {
|
||||
if (is_a($encart->picture, "SplFileInfo")) {
|
||||
$encart->picture = Utils::storeImage($encart->picture, $encart->getTable());
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -33,13 +33,13 @@ class Picto extends Model
|
|||
protected static function boot()
|
||||
{
|
||||
static::creating(function (Picto $picto) {
|
||||
if (is_a($picto->picture,"SplFileInfo")) {
|
||||
if (is_a($picto->picture, "SplFileInfo")) {
|
||||
$picto->picture = Utils::storeImage($picto->picture, $picto->getTable());
|
||||
}
|
||||
});
|
||||
|
||||
static::updating(function (Picto $picto) {
|
||||
if (is_a($picto->picture,"SplFileInfo")) {
|
||||
if (is_a($picto->picture, "SplFileInfo")) {
|
||||
$picto->picture = Utils::storeImage($picto->picture, $picto->getTable());
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -30,13 +30,13 @@ class PictoBrand extends Model
|
|||
protected static function boot()
|
||||
{
|
||||
static::creating(function (PictoBrand $pictoBrand) {
|
||||
if (is_a($pictoBrand->picture,"SplFileInfo")) {
|
||||
if (is_a($pictoBrand->picture, "SplFileInfo")) {
|
||||
$pictoBrand->picture = Utils::storeImage($pictoBrand->picture, $pictoBrand->getTable());
|
||||
}
|
||||
});
|
||||
|
||||
static::updating(function (PictoBrand $pictoBrand) {
|
||||
if (is_a($pictoBrand->picture,"SplFileInfo")) {
|
||||
if (is_a($pictoBrand->picture, "SplFileInfo")) {
|
||||
$pictoBrand->picture = Utils::storeImage($pictoBrand->picture, $pictoBrand->getTable());
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -47,19 +47,19 @@ class Post extends Model
|
|||
protected static function boot()
|
||||
{
|
||||
static::creating(function (Post $post) {
|
||||
if (is_a($post->picture_home,"SplFileInfo")) {
|
||||
if (is_a($post->picture_home, "SplFileInfo")) {
|
||||
$post->picture_home = Utils::storeImage($post->picture_home, $post->getTable());
|
||||
}
|
||||
if (is_a($post->picture_news,"SplFileInfo")) {
|
||||
if (is_a($post->picture_news, "SplFileInfo")) {
|
||||
$post->picture_news = Utils::storeImage($post->picture_news, $post->getTable());
|
||||
}
|
||||
});
|
||||
|
||||
static::updating(function (Post $post) {
|
||||
if (is_a($post->picture_home,"SplFileInfo")) {
|
||||
if (is_a($post->picture_home, "SplFileInfo")) {
|
||||
$post->picture_home = Utils::storeImage($post->picture_home, $post->getTable());
|
||||
}
|
||||
if (is_a($post->picture_news,"SplFileInfo")) {
|
||||
if (is_a($post->picture_news, "SplFileInfo")) {
|
||||
$post->picture_news = Utils::storeImage($post->picture_news, $post->getTable());
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -48,13 +48,13 @@ class Slide extends Model
|
|||
protected static function boot()
|
||||
{
|
||||
static::creating(function (Slide $slide) {
|
||||
if (is_a($slide->picture,"SplFileInfo")) {
|
||||
if (is_a($slide->picture, "SplFileInfo")) {
|
||||
$slide->picture = Utils::storeImage($slide->picture, $slide->getTable());
|
||||
}
|
||||
});
|
||||
|
||||
static::updating(function (Slide $slide) {
|
||||
if (is_a($slide->picture,"SplFileInfo")) {
|
||||
if (is_a($slide->picture, "SplFileInfo")) {
|
||||
$slide->picture = Utils::storeImage($slide->picture, $slide->getTable());
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ namespace App\Providers;
|
|||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
|
|||
|
|
@ -50,17 +50,16 @@ class RouteServiceProvider extends ServiceProvider
|
|||
->group(base_path('routes/web.php'));
|
||||
});
|
||||
|
||||
Route::bind('gammeSlug', function($value, $route) {
|
||||
$gamme = Gamme::where('slug', 'LIKE', '%:"'.$value.'"%')->firstOrFail();
|
||||
Route::bind('gammeSlug', function ($value, $route) {
|
||||
$gamme = Gamme::where('slug', 'LIKE', '%:"' . $value . '"%')->firstOrFail();
|
||||
return $gamme;
|
||||
});
|
||||
|
||||
Route::bind('productSlug', function($value, $route) {
|
||||
Route::bind('productSlug', function ($value, $route) {
|
||||
$gamme = $route->parameter('gammeSlug');
|
||||
$product = Product::where('slug', 'LIKE', '%:"'.$value.'"%')->where('gamme_id', $gamme->id)->firstOrFail();
|
||||
$product = Product::where('slug', 'LIKE', '%:"' . $value . '"%')->where('gamme_id', $gamme->id)->firstOrFail();
|
||||
return $product;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,10 +5,9 @@ namespace App\Traits;
|
|||
use Kwaadpepper\Enum\Traits\CastsEnums;
|
||||
use Spatie\Translatable\HasTranslations;
|
||||
|
||||
trait CastsEnumsHasTranslations {
|
||||
|
||||
use CastsEnums, HasTranslations
|
||||
{
|
||||
trait CastsEnumsHasTranslations
|
||||
{
|
||||
use CastsEnums, HasTranslations {
|
||||
CastsEnums::getAttributeValue as enumGetAttributeValue;
|
||||
CastsEnums::setAttribute as enumSetAttribute;
|
||||
HasTranslations::getAttributeValue as transGetAttributeValue;
|
||||
|
|
@ -21,7 +20,7 @@ trait CastsEnumsHasTranslations {
|
|||
public function getAttributeValue($key)
|
||||
{
|
||||
if ($this->hasEnumCast($key)) {
|
||||
return $this->enumGetAttributeValue($key);
|
||||
return $this->enumGetAttributeValue($key);
|
||||
}
|
||||
|
||||
return $this->transGetAttributeValue($key);
|
||||
|
|
@ -34,9 +33,8 @@ trait CastsEnumsHasTranslations {
|
|||
{
|
||||
if ($this->hasEnumCast($key)) {
|
||||
return $this->enumSetAttribute($key, $value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $this->transSetAttribute($key,$value);
|
||||
return $this->transSetAttribute($key, $value);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'debug' => (bool) env('APP_DEBUG', false),
|
||||
'debug' => (bool)env('APP_DEBUG', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -105,6 +105,6 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
|
||||
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'),
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ return [
|
|||
|
||||
'options' => [
|
||||
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
||||
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
|
||||
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'),
|
||||
],
|
||||
|
||||
'default' => [
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ return [
|
|||
'public' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/public'),
|
||||
'url' => env('APP_URL').'/storage',
|
||||
'url' => env('APP_URL') . '/storage',
|
||||
'visibility' => 'public',
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ return [
|
|||
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
|
||||
'%s%s',
|
||||
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
|
||||
env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : ''
|
||||
env('APP_URL') ? ',' . parse_url(env('APP_URL'), PHP_URL_HOST) : ''
|
||||
))),
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ return [
|
|||
|
||||
'cookie' => env(
|
||||
'SESSION_COOKIE',
|
||||
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
|
||||
Str::slug(env('APP_NAME', 'laravel'), '_') . '_session'
|
||||
),
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ return [
|
|||
'scan_paths' => [
|
||||
//app_path(),
|
||||
//resource_path().'\views\back',
|
||||
resource_path().'/views/front',
|
||||
resource_path().'/views/layouts/frontend',
|
||||
resource_path() . '/views/front',
|
||||
resource_path() . '/views/layouts/frontend',
|
||||
],
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| API Routes
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@ use Illuminate\Support\Facades\Broadcast;
|
|||
*/
|
||||
|
||||
Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
|
||||
return (int) $user->id === (int) $id;
|
||||
return (int)$user->id === (int)$id;
|
||||
});
|
||||
|
|
|
|||
128
routes/web.php
128
routes/web.php
|
|
@ -54,60 +54,60 @@ Route::prefix('bo')
|
|||
->name('bo.')
|
||||
->middleware(['admin-secure'])
|
||||
->group(
|
||||
function () {
|
||||
Auth::routes(
|
||||
[
|
||||
'login' => true,
|
||||
'logout' => true,
|
||||
'register' => false,
|
||||
'reset' => false, // for resetting passwords
|
||||
'confirm' => false, // for additional password confirmations
|
||||
'verify' => false, // for email verification
|
||||
]
|
||||
);
|
||||
Route::middleware(['auth:web', 'back-end-globals', 'lang-check'])
|
||||
->group(
|
||||
function () {
|
||||
Route::get(
|
||||
'/',
|
||||
[
|
||||
HomeController::class,
|
||||
'home'
|
||||
]
|
||||
)->name('home');
|
||||
Route::resources(
|
||||
[
|
||||
'sliders' => SlidersController::class,
|
||||
'slides' => SlidesController::class,
|
||||
]
|
||||
);
|
||||
Route::resource('seo_data', SeoDataController::class)
|
||||
->except(['index', 'create', 'store', 'destroy', 'show']);
|
||||
Route::resource('moments', MomentsController::class)
|
||||
->except(['create', 'store', 'destroy', 'show']);
|
||||
Route::resource('encarts', EncartsController::class)
|
||||
->except(['index', 'create', 'store', 'destroy', 'show']);
|
||||
Route::resource('pictos', PictosController::class)->except(['show']);
|
||||
Route::resource('posts', PostsController::class)->except(['show']);
|
||||
Route::resource('pictobrands', PictoBrandsController::class)->except(['show']);
|
||||
Route::resource('gammes', GammesController::class)->except(['show']);
|
||||
Route::resource('products', ProductsController::class)->except(['show']);
|
||||
Route::resource('advice', AdviceController::class)
|
||||
->except(['index', 'create', 'store', 'destroy', 'show']);
|
||||
Route::resource('texts', TextsController::class)->except(['show']);
|
||||
Route::resource('titles', TitlesController::class)
|
||||
->except(['index', 'create', 'store', 'destroy', 'show']);
|
||||
Route::get(
|
||||
'/slide/change-order/{slide}/{action}',
|
||||
[
|
||||
SlidesController::class,
|
||||
'changeOrder'
|
||||
]
|
||||
)->name('slides.change-order');
|
||||
Route::get('/pictos/{page}', [PictosController::class, 'index'])->name('pictos.content');
|
||||
Route::get('/texts/{page}', [TextsController::class, 'index'])->name('texts.content');
|
||||
}
|
||||
);
|
||||
function () {
|
||||
Auth::routes(
|
||||
[
|
||||
'login' => true,
|
||||
'logout' => true,
|
||||
'register' => false,
|
||||
'reset' => false, // for resetting passwords
|
||||
'confirm' => false, // for additional password confirmations
|
||||
'verify' => false, // for email verification
|
||||
]
|
||||
);
|
||||
Route::middleware(['auth:web', 'back-end-globals', 'lang-check'])
|
||||
->group(
|
||||
function () {
|
||||
Route::get(
|
||||
'/',
|
||||
[
|
||||
HomeController::class,
|
||||
'home'
|
||||
]
|
||||
)->name('home');
|
||||
Route::resources(
|
||||
[
|
||||
'sliders' => SlidersController::class,
|
||||
'slides' => SlidesController::class,
|
||||
]
|
||||
);
|
||||
Route::resource('seo_data', SeoDataController::class)
|
||||
->except(['index', 'create', 'store', 'destroy', 'show']);
|
||||
Route::resource('moments', MomentsController::class)
|
||||
->except(['create', 'store', 'destroy', 'show']);
|
||||
Route::resource('encarts', EncartsController::class)
|
||||
->except(['index', 'create', 'store', 'destroy', 'show']);
|
||||
Route::resource('pictos', PictosController::class)->except(['show']);
|
||||
Route::resource('posts', PostsController::class)->except(['show']);
|
||||
Route::resource('pictobrands', PictoBrandsController::class)->except(['show']);
|
||||
Route::resource('gammes', GammesController::class)->except(['show']);
|
||||
Route::resource('products', ProductsController::class)->except(['show']);
|
||||
Route::resource('advice', AdviceController::class)
|
||||
->except(['index', 'create', 'store', 'destroy', 'show']);
|
||||
Route::resource('texts', TextsController::class)->except(['show']);
|
||||
Route::resource('titles', TitlesController::class)
|
||||
->except(['index', 'create', 'store', 'destroy', 'show']);
|
||||
Route::get(
|
||||
'/slide/change-order/{slide}/{action}',
|
||||
[
|
||||
SlidesController::class,
|
||||
'changeOrder'
|
||||
]
|
||||
)->name('slides.change-order');
|
||||
Route::get('/pictos/{page}', [PictosController::class, 'index'])->name('pictos.content');
|
||||
Route::get('/texts/{page}', [TextsController::class, 'index'])->name('texts.content');
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -120,21 +120,21 @@ foreach ($langs as $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}', [ControllersGammesController::class, 'show'])->name('gammes.show');
|
||||
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}', [ControllersGammesController::class, 'show'])->name('gammes.show');
|
||||
Route::get(
|
||||
'/'.Str::slug(Lang::get('urls.produit',[], $lang)).'/{gammeSlug}/{productSlug}',
|
||||
'/' . Str::slug(Lang::get('urls.produit', [], $lang)) . '/{gammeSlug}/{productSlug}',
|
||||
[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.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::view('/plan-site', 'front.site-map')->name('site-map');
|
||||
Route::get('/'.Str::slug(Lang::get('urls.search',[], $lang)), [ControllersProductsController::class, 'search'])->name('search');
|
||||
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::get('/' . Str::slug(Lang::get('urls.contact', [], $lang)), [ControllersContactController::class, 'contact'])->name('contact');
|
||||
Route::post('/contact', [ControllersContactController::class, 'contactSubmit'])->name('contact.submit');
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue