diff --git a/.vscode/settings.json b/.vscode/settings.json index 60cde933..6352cc94 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,23 @@ { - "phpcs.executablePath": "vendor/bin/phpcs" + "phpcs.executablePath": "vendor/bin/phpcs", + "workbench.colorCustomizations": { + "activityBar.activeBackground": "#c5660c", + "activityBar.activeBorder": "#055a2f", + "activityBar.background": "#c5660c", + "activityBar.foreground": "#e7e7e7", + "activityBar.inactiveForeground": "#e7e7e799", + "activityBarBadge.background": "#055a2f", + "activityBarBadge.foreground": "#e7e7e7", + "sash.hoverBorder": "#c5660c", + "statusBar.background": "#954d09", + "statusBar.foreground": "#e7e7e7", + "statusBarItem.hoverBackground": "#c5660c", + "statusBarItem.remoteBackground": "#954d09", + "statusBarItem.remoteForeground": "#e7e7e7", + "titleBar.activeBackground": "#954d09", + "titleBar.activeForeground": "#e7e7e7", + "titleBar.inactiveBackground": "#954d0999", + "titleBar.inactiveForeground": "#e7e7e799" + }, + "peacock.remoteColor": "#954d09" } diff --git a/app/Casts/HtmlColor.php b/app/Casts/HtmlColor.php index a2eec795..3162bd93 100644 --- a/app/Casts/HtmlColor.php +++ b/app/Casts/HtmlColor.php @@ -15,10 +15,10 @@ class HtmlColor implements CastsAttributes /** * Cast the given value. * - * @param \Illuminate\Database\Eloquent\Model $model - * @param string $key - * @param mixed $value - * @param array $attributes + * @param \Illuminate\Database\Eloquent\Model $model + * @param string $key + * @param mixed $value + * @param array $attributes * @return string */ public function get($model, $key, $value, $attributes) @@ -29,11 +29,11 @@ class HtmlColor implements CastsAttributes /** * Prepare the given value for storage. * - * @param \Illuminate\Database\Eloquent\Model $model - * @param string $key - * @param array $value - * @param array $attributes - * @return int + * @param \Illuminate\Database\Eloquent\Model $model + * @param string $key + * @param array $value + * @param array $attributes + * @return integer */ public function set($model, $key, $value, $attributes) { diff --git a/app/Console/Commands/LdcWebStatusChecker.php b/app/Console/Commands/LdcWebStatusChecker.php index 563db63a..df24f316 100644 --- a/app/Console/Commands/LdcWebStatusChecker.php +++ b/app/Console/Commands/LdcWebStatusChecker.php @@ -5,16 +5,15 @@ namespace App\Console\Commands; use Illuminate\Console\Command; /* -* Command Name: LDC Web Status Checker -* Description: Envoi des infos Serveur/Laravel vers LDC Web -* Version: 1.1 -* Author: Vincent BRIDIER -* Author URI: vincent.bridier@ldc.fr -*/ + * Command Name: LDC Web Status Checker + * Description: Envoi des infos Serveur/Laravel vers LDC Web + * Version: 1.1 + * Author: Vincent BRIDIER + * Author URI: vincent.bridier@ldc.fr + */ class LdcWebStatusChecker extends Command { - /** * The name and signature of the console command. * @@ -36,7 +35,7 @@ class LdcWebStatusChecker extends Command */ public function handle() { - $data = []; + $data = []; $data['uuid'] = config('ldcweb.project_uuid'); // Sitemap.xml ? @@ -53,10 +52,10 @@ class LdcWebStatusChecker extends Command $data['robots'] = 'false'; } - //Check logs + // Check logs $data['logs'] = 0; - $patherror = storage_path('/logs'); - $files = glob($patherror . '/*.log'); + $patherror = storage_path('/logs'); + $files = glob($patherror . '/*.log'); if (count($files) > 0) { foreach ($files as $file) { $data['logs'] = $data['logs'] + filesize($file); @@ -66,8 +65,8 @@ class LdcWebStatusChecker extends Command $data['code']['version'] = app()->version(); // Send by cURL - $url = 'https://ldc-web.ldc.fr/api/status-checker'; - $ch = curl_init($url); + $url = 'https://ldc-web.ldc.fr/api/status-checker'; + $ch = curl_init($url); $payload = ['token' => 'CE8S52Qq7stf5k8frF4T', 'datas' => json_encode($data)]; curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); diff --git a/app/Console/Commands/PurgeNotifications.php b/app/Console/Commands/PurgeNotifications.php index 8e0563ec..f8cbd088 100644 --- a/app/Console/Commands/PurgeNotifications.php +++ b/app/Console/Commands/PurgeNotifications.php @@ -8,7 +8,6 @@ use Illuminate\Console\Command; //phpcs:disable Generic.Files.LineLength.TooLong class PurgeNotifications extends Command { - /** * The name and signature of the console command. * @@ -26,7 +25,7 @@ class PurgeNotifications extends Command /** * Execute the console command. * - * @return int + * @return integer */ public function handle() { diff --git a/app/Console/Commands/UpdateReductions.php b/app/Console/Commands/UpdateReductions.php index 7d448d24..edd5d10b 100644 --- a/app/Console/Commands/UpdateReductions.php +++ b/app/Console/Commands/UpdateReductions.php @@ -8,7 +8,6 @@ use Illuminate\Console\Command; //phpcs:disable Generic.Files.LineLength.TooLong class UpdateReductions extends Command { - /** * The name and signature of the console command. * @@ -26,12 +25,12 @@ class UpdateReductions extends Command /** * Execute the console command. * - * @return int + * @return integer */ public function handle() { $this->info('Running the Job, this could take some time.'); - $job = new JobsUpdateReductions(); + $job = new JobsUpdateReductions(); $job->console = $this; $job->handle(); $this->info('Job completed'); diff --git a/app/Console/Commands/UserChangePassword.php b/app/Console/Commands/UserChangePassword.php index 6544ee5b..894b244c 100644 --- a/app/Console/Commands/UserChangePassword.php +++ b/app/Console/Commands/UserChangePassword.php @@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Hash; class UserChangePassword extends Command { - /** * The name and signature of the console command. * @@ -26,7 +25,7 @@ class UserChangePassword extends Command public function handle() { $email = $this->ask('What is the email?'); - $user = User::where('email', $email)->first(); + $user = User::where('email', $email)->first(); if (!$user) { $this->error(sprintf('User %s could not be found', $email)); @@ -35,7 +34,7 @@ class UserChangePassword extends Command $password = $this->secret('What is the password?'); - $user->password = Hash::make($password); + $user->password = Hash::make($password); $user->saveOrFail(); $this->info('User updated.'); diff --git a/app/Console/Commands/UserCreate.php b/app/Console/Commands/UserCreate.php index 84e81092..da6e71da 100644 --- a/app/Console/Commands/UserCreate.php +++ b/app/Console/Commands/UserCreate.php @@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Hash; class UserCreate extends Command { - /** * The name and signature of the console command. * @@ -26,23 +25,23 @@ class UserCreate extends Command /** * Execute the console command. * - * @return int + * @return integer */ public function handle() { $firstname = $this->ask('What is the firstname?'); $lastname = $this->ask('What is the lastname?'); $email = $this->ask('What is the email?'); - $role = $this->ask('What is the role 1 (SuperAdmin) or 2 (Admin) ?') == '1' ? 1 : 2; + $role = $this->ask('What is the role 1 (SuperAdmin) or 2 (Admin) ?') == '1' ? 1 : 2; $pwd = $this->secret('What is the password?'); - $user = new User(); - $user->firstname = $firstname; - $user->lastname = $lastname; - $user->email = $email; - $user->role = $role; - $user->password = Hash::make($pwd); - $user->email_verified_at = date('Y-m-d H:i:s'); + $user = new User(); + $user->firstname = $firstname; + $user->lastname = $lastname; + $user->email = $email; + $user->role = $role; + $user->password = Hash::make($pwd); + $user->email_verified_at = date('Y-m-d H:i:s'); $user->saveOrFail(); $this->info('User created.'); diff --git a/app/Console/Commands/XSCVMepReader.php b/app/Console/Commands/XSCVMepReader.php index 9fec9745..b17135be 100644 --- a/app/Console/Commands/XSCVMepReader.php +++ b/app/Console/Commands/XSCVMepReader.php @@ -7,7 +7,6 @@ use Illuminate\Console\Command; class XSCVMepReader extends Command { - /** * The name and signature of the console command. * @@ -25,12 +24,12 @@ class XSCVMepReader extends Command /** * Execute the console command. * - * @return int + * @return integer */ public function handle() { $this->info('Running the Job, this could take some time.'); - $job = new JobsXSCVMepReader(); + $job = new JobsXSCVMepReader(); $job->console = $this; $job->handle(); $this->info('Job completed'); diff --git a/app/Console/Commands/XmlEleveursReader.php b/app/Console/Commands/XmlEleveursReader.php index 99a8c0c9..a281a51e 100644 --- a/app/Console/Commands/XmlEleveursReader.php +++ b/app/Console/Commands/XmlEleveursReader.php @@ -7,7 +7,6 @@ use Illuminate\Console\Command; class XmlEleveursReader extends Command { - /** * The name and signature of the console command. * @@ -25,12 +24,12 @@ class XmlEleveursReader extends Command /** * Execute the console command. * - * @return int + * @return integer */ public function handle() { $this->info('Running the Job, this could take some time.'); - $job = new JobsXmlEleveursReader(); + $job = new JobsXmlEleveursReader(); $job->console = $this; $job->handle(); $this->info('Job completed'); diff --git a/app/Console/Commands/XmlIncoReader.php b/app/Console/Commands/XmlIncoReader.php index 6e7c53bc..aee08989 100644 --- a/app/Console/Commands/XmlIncoReader.php +++ b/app/Console/Commands/XmlIncoReader.php @@ -7,7 +7,6 @@ use Illuminate\Console\Command; class XmlIncoReader extends Command { - /** * The name and signature of the console command. * @@ -30,7 +29,7 @@ class XmlIncoReader extends Command public function handle() { $this->info('Running the Job, this could take some time.'); - $job = new JobsXmlIncoReader(); + $job = new JobsXmlIncoReader(); $job->console = $this; $job->handle(); $this->info('Job completed'); diff --git a/app/Console/Commands/XmlTracaReader.php b/app/Console/Commands/XmlTracaReader.php index e0939c90..8024097d 100644 --- a/app/Console/Commands/XmlTracaReader.php +++ b/app/Console/Commands/XmlTracaReader.php @@ -7,7 +7,6 @@ use Illuminate\Console\Command; class XmlTracaReader extends Command { - /** * The name and signature of the console command. * @@ -25,12 +24,12 @@ class XmlTracaReader extends Command /** * Execute the console command. * - * @return int + * @return integer */ public function handle() { $this->info('Running the Job, this could take some time.'); - $job = new JobsXmlTracaReader(); + $job = new JobsXmlTracaReader(); $job->console = $this; $job->handle(); $this->info('Job completed'); diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index c15f4dfd..45f1db59 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -27,7 +27,6 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel { - /** * The Artisan commands provided by your application. * @@ -48,7 +47,7 @@ class Kernel extends ConsoleKernel /** * Define the application's command schedule. * - * @param \Illuminate\Console\Scheduling\Schedule $schedule + * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ protected function schedule(Schedule $schedule) diff --git a/app/Enums/ContactFormType.php b/app/Enums/ContactFormType.php index d042007c..48ee9c8c 100644 --- a/app/Enums/ContactFormType.php +++ b/app/Enums/ContactFormType.php @@ -19,10 +19,12 @@ final class ContactFormType extends BaseEnumRoutable return [ 'none' => 0, 'abuse' => 1, - 'complain' => 3, // special case passerelle + 'complain' => 3, +// special case passerelle 'recipe' => 5, 'games' => 9, - 'onepage' => 10, //special case page nl + 'onepage' => 10, +// special case page nl ]; } protected static function labels(): array diff --git a/app/Enums/Days.php b/app/Enums/Days.php index 89cd4f05..6868d534 100644 --- a/app/Enums/Days.php +++ b/app/Enums/Days.php @@ -52,7 +52,7 @@ final class Days extends BaseEnumRoutable /** * Checks if days contain this day * - * @param int $days + * @param integer $days * @return boolean */ public function has(int $days) diff --git a/app/Events/NewNotification.php b/app/Events/NewNotification.php index c52bf138..bca57c84 100644 --- a/app/Events/NewNotification.php +++ b/app/Events/NewNotification.php @@ -27,9 +27,9 @@ class NewNotification */ public function __construct($type, $content, $model, $customer = null) { - $this->type = $type; - $this->content = $content; - $this->model = $model; + $this->type = $type; + $this->content = $content; + $this->model = $model; $this->customer = $customer; } } diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 9c7da012..eb97ef42 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -9,7 +9,6 @@ use Throwable; class Handler extends ExceptionHandler { - /** * A list of the exception types that are not reported. * diff --git a/app/Exceptions/RedirectTo.php b/app/Exceptions/RedirectTo.php index d99af213..219ab90c 100644 --- a/app/Exceptions/RedirectTo.php +++ b/app/Exceptions/RedirectTo.php @@ -11,7 +11,6 @@ use Exception; */ class RedirectTo extends Exception { - public $url; public function __construct(string $url) diff --git a/app/Http/Controllers/ActuController.php b/app/Http/Controllers/ActuController.php index 5e41b5a7..7ad8d5e6 100644 --- a/app/Http/Controllers/ActuController.php +++ b/app/Http/Controllers/ActuController.php @@ -11,8 +11,8 @@ class ActuController extends Controller { public function index() { - $tags = Tag::has('actus')->get(); - $actus = Actu::where('status', true) + $tags = Tag::has('actus')->get(); + $actus = Actu::where('status', true) ->with('tags:id') ->get(['id']) ->mapWithKeys(function ($actu) { @@ -37,7 +37,7 @@ class ActuController extends Controller public function view(Actu $actu) { - $relatedActus = Actu::whereHas('tags', function ($q) use ($actu) { + $relatedActus = Actu::whereHas('tags', function ($q) use ($actu) { $q->whereIn('id', $actu->tags->pluck('id')); })->where('id', '!=', $actu->id)->whereStatus(true) ->inRandomOrder()->limit(3)->get(); diff --git a/app/Http/Controllers/Auth/ConfirmPasswordController.php b/app/Http/Controllers/Auth/ConfirmPasswordController.php index d90f81e4..f6112b28 100644 --- a/app/Http/Controllers/Auth/ConfirmPasswordController.php +++ b/app/Http/Controllers/Auth/ConfirmPasswordController.php @@ -9,14 +9,14 @@ use Illuminate\Foundation\Auth\ConfirmsPasswords; class ConfirmPasswordController extends Controller { /* - |-------------------------------------------------------------------------- - | Confirm Password Controller - |-------------------------------------------------------------------------- - | - | This controller is responsible for handling password confirmations and - | uses a simple trait to include the behavior. You're free to explore - | this trait and override any functions that require customization. - | + |-------------------------------------------------------------------------- + | Confirm Password Controller + |-------------------------------------------------------------------------- + | + | This controller is responsible for handling password confirmations and + | uses a simple trait to include the behavior. You're free to explore + | this trait and override any functions that require customization. + | */ use ConfirmsPasswords; diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 38b0a734..75ef4e6b 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -8,14 +8,14 @@ use Illuminate\Foundation\Auth\SendsPasswordResetEmails; class ForgotPasswordController extends Controller { /* - |-------------------------------------------------------------------------- - | Password Reset Controller - |-------------------------------------------------------------------------- - | - | This controller is responsible for handling password reset emails and - | includes a trait which assists in sending these notifications from - | your application to your users. Feel free to explore this trait. - | + |-------------------------------------------------------------------------- + | Password Reset Controller + |-------------------------------------------------------------------------- + | + | This controller is responsible for handling password reset emails and + | includes a trait which assists in sending these notifications from + | your application to your users. Feel free to explore this trait. + | */ use SendsPasswordResetEmails; } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 331de723..14f40724 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -9,14 +9,14 @@ use Illuminate\Foundation\Auth\AuthenticatesUsers; class LoginController extends Controller { /* - |-------------------------------------------------------------------------- - | Login Controller - |-------------------------------------------------------------------------- - | - | This controller handles authenticating users for the application and - | redirecting them to your home screen. The controller uses a trait - | to conveniently provide its functionality to your applications. - | + |-------------------------------------------------------------------------- + | Login Controller + |-------------------------------------------------------------------------- + | + | This controller handles authenticating users for the application and + | redirecting them to your home screen. The controller uses a trait + | to conveniently provide its functionality to your applications. + | */ use AuthenticatesUsers; diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index cc909c87..1eddeb9f 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -12,14 +12,14 @@ use Illuminate\Support\Facades\Validator; class RegisterController extends Controller { /* - |-------------------------------------------------------------------------- - | Register Controller - |-------------------------------------------------------------------------- - | - | This controller handles the registration of new users as well as their - | validation and creation. By default this controller uses a trait to - | provide this functionality without requiring any additional code. - | + |-------------------------------------------------------------------------- + | Register Controller + |-------------------------------------------------------------------------- + | + | This controller handles the registration of new users as well as their + | validation and creation. By default this controller uses a trait to + | provide this functionality without requiring any additional code. + | */ use RegistersUsers; @@ -43,7 +43,7 @@ class RegisterController extends Controller /** * Get a validator for an incoming registration request. * - * @param array $data + * @param array $data * @return \Illuminate\Contracts\Validation\Validator */ protected function validator(array $data) @@ -58,7 +58,7 @@ class RegisterController extends Controller /** * Create a new user instance after a valid registration. * - * @param array $data + * @param array $data * @return \App\User */ protected function create(array $data) diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index f858dc63..fa4081b8 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -9,14 +9,14 @@ use Illuminate\Foundation\Auth\ResetsPasswords; class ResetPasswordController extends Controller { /* - |-------------------------------------------------------------------------- - | Password Reset Controller - |-------------------------------------------------------------------------- - | - | This controller is responsible for handling password reset requests - | and uses a simple trait to include this behavior. You're free to - | explore this trait and override any methods you wish to tweak. - | + |-------------------------------------------------------------------------- + | Password Reset Controller + |-------------------------------------------------------------------------- + | + | This controller is responsible for handling password reset requests + | and uses a simple trait to include this behavior. You're free to + | explore this trait and override any methods you wish to tweak. + | */ use ResetsPasswords; diff --git a/app/Http/Controllers/Auth/VerificationController.php b/app/Http/Controllers/Auth/VerificationController.php index 8728d3b1..74ab841b 100644 --- a/app/Http/Controllers/Auth/VerificationController.php +++ b/app/Http/Controllers/Auth/VerificationController.php @@ -9,14 +9,14 @@ use Illuminate\Foundation\Auth\VerifiesEmails; class VerificationController extends Controller { /* - |-------------------------------------------------------------------------- - | Email Verification Controller - |-------------------------------------------------------------------------- - | - | This controller is responsible for handling email verification for any - | user that recently registered with the application. Emails may also - | be re-sent if the user didn't receive the original email message. - | + |-------------------------------------------------------------------------- + | Email Verification Controller + |-------------------------------------------------------------------------- + | + | This controller is responsible for handling email verification for any + | user that recently registered with the application. Emails may also + | be re-sent if the user didn't receive the original email message. + | */ use VerifiesEmails; diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index cdf1fc76..fef26be4 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -27,7 +27,6 @@ use LDC\LDCCRM\Models\Customer as CrmCustomer; class AuthController extends Controller { - /** * Affiche le formulaire utilise view share vars */ @@ -43,7 +42,7 @@ class AuthController extends Controller { $crmCustomer = null; try { - $crmCustomer = new CrmCustomer(\array_intersect_key( + $crmCustomer = new CrmCustomer(\array_intersect_key( $request->all(), [ 'firstname' => '', @@ -62,7 +61,7 @@ class AuthController extends Controller $crmCustomer->password = $request->password; $crmCustomer->save(); - $customer = new Customers($request->all()); + $customer = new Customers($request->all()); $customer->hashcode = $crmCustomer->hashcode; $customer->save(); @@ -85,7 +84,7 @@ class AuthController extends Controller Utils::sendEmailErrorManually($e); // Une erreur critique est survenue avec la CRM return back()->withErrors('Une erreur est survenue, merci de réessayer ultérieurement.'); - } + }//end try return back()->withErrors('Une erreur est survenue, merci de réessayer ultérieurement.'); } @@ -119,7 +118,7 @@ class AuthController extends Controller // Une erreur critique est survenue avec la CRM return view('front.auth.activate') ->with('message', 'Une erreur est survenue, merci de réessayer ultérieurement.'); - } + }//end try return view('front.auth.activate')->with('message', "Ce lien d'activation n'est pas valide."); } @@ -177,7 +176,7 @@ class AuthController extends Controller ]); // On valide les données selon les critères du site LG - $rules = collect((new UpdateInfosRequest())->rules()); + $rules = collect((new UpdateInfosRequest())->rules()); $validator = Validator::make( [ 'birth_date' => $crmCustomer->birth_date, @@ -206,7 +205,7 @@ class AuthController extends Controller throw $e; } Session::push('needCrmInfoUpdate', true); - } + }//end try // Si pas de compte local mais existe en CRM if (!$customer) { @@ -220,14 +219,14 @@ class AuthController extends Controller Utils::sendEmailErrorManually($e); // Une erreur critique est survenue avec la CRM return back()->withErrors('Une erreur est survenue, merci de réessayer ultérieurement.'); - } + }//end try } /** * Handle Api error exception * * @param ApiErrorException $e - * @param LoginRequest $request + * @param LoginRequest $request * @return void */ private function handleLoginApiErrorException(ApiErrorException $e, LoginRequest $request) @@ -267,7 +266,7 @@ class AuthController extends Controller Utils::sendEmailErrorManually($e); // une erreur non gérée return back()->withErrors('Une erreur est survenue, merci de réessayer ultérieurement.'); - } + }//end switch } /** @@ -283,7 +282,7 @@ class AuthController extends Controller $crmCustomer->lastname ); - $customer = Customers::firstOrNew([ + $customer = Customers::firstOrNew([ 'email' => $crmCustomer->email ]); $customer->hashcode = $crmCustomer->hashcode; @@ -297,7 +296,7 @@ class AuthController extends Controller * Login a customer * * @param Customers $customer - * @param bool $remember + * @param boolean $remember * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse */ private function processLogin(Customers $customer, bool $remember) @@ -367,7 +366,7 @@ class AuthController extends Controller Utils::sendEmailErrorManually($e); // Une erreur critique est survenue avec la CRM return back()->withErrors('Une erreur est survenue, merci de réessayer ultérieurement.'); - } + }//end try } /** @@ -383,9 +382,9 @@ class AuthController extends Controller $token = Str::random(80); - $passwordReset = new PasswordReset(); - $passwordReset->email = $email; - $passwordReset->token = $token; + $passwordReset = new PasswordReset(); + $passwordReset->email = $email; + $passwordReset->token = $token; $passwordReset->created_at = now(); $passwordReset->save(); @@ -420,13 +419,13 @@ class AuthController extends Controller * reset mot de passe * * @param ResetCustomerPassword $request - * @param string $token + * @param string $token * @return void */ public function changePassword(ResetCustomerPassword $request, string $token) { $passwordReset = PasswordReset::where('token', $token)->first(); - $customer = Customers::where('email', $passwordReset->email)->first(); + $customer = Customers::where('email', $passwordReset->email)->first(); /** @var \LDC\LDCCRM\CrmApiV2 */ $crm = app('crmAPI'); @@ -501,7 +500,7 @@ class AuthController extends Controller return back()->withErrors('Une erreur est survenue, merci de réessayer ultérieurement.'); } catch (ValidationException $e) { return back()->withErrors(sprintf('Nouveau mot de passe : %s', $e->getMessage())); - } + }//end try return back()->with('success', __("Modifications enregistrés !")); } } diff --git a/app/Http/Controllers/Bo/ActuController.php b/app/Http/Controllers/Bo/ActuController.php index d55b7978..bcdd9069 100644 --- a/app/Http/Controllers/Bo/ActuController.php +++ b/app/Http/Controllers/Bo/ActuController.php @@ -30,8 +30,8 @@ class ActuController extends Controller ); } $searchFields = trans('Titre, Entête, Contenu'); - $actus = $this->sortQuery($actus, ['tags']); - $actus = $actus->paginate(); + $actus = $this->sortQuery($actus, ['tags']); + $actus = $actus->paginate(); return view('bo.actus.index', array_merge( \compact('actus', 'searchFields'), ['ignore' => ['tags']] @@ -111,7 +111,7 @@ class ActuController extends Controller foreach ($actus as $actu) { if (!$oldHighlights->contains($actu)) { - $r = Actu::findOrFail($actu); + $r = Actu::findOrFail($actu); $r->front = true; $r->save(); } @@ -130,7 +130,7 @@ class ActuController extends Controller $actu->front = false; $actu->save(); } - } + }//end if return redirect()->route('bo.actus.highlights')->with('success', 'Enregistré !'); } diff --git a/app/Http/Controllers/Bo/AdsController.php b/app/Http/Controllers/Bo/AdsController.php index cd43c1ae..23640c9c 100644 --- a/app/Http/Controllers/Bo/AdsController.php +++ b/app/Http/Controllers/Bo/AdsController.php @@ -25,8 +25,8 @@ class AdsController extends Controller public function store(Request $request) { - $title = $request->title; - $link = $request->link; + $title = $request->title; + $link = $request->link; $picture = $request->picture; $request->validate([ @@ -38,11 +38,11 @@ class AdsController extends Controller $imageName = Str::slug($title) . '-le-gaulois.' . $picture->extension(); $picture->move(public_path('uploads/images/publicites/' . date('Y') . '/' . date('m')), $imageName); - $a = new Ads(); - $a->title = $title; - $a->link = $link; + $a = new Ads(); + $a->title = $title; + $a->link = $link; $a->picture = 'uploads/images/publicites/' . date('Y') . '/' . date('m') . '/' . $imageName; - $a->status = 0; + $a->status = 0; $a->save(); return redirect()->route('bo.ads.index'); @@ -56,10 +56,10 @@ class AdsController extends Controller public function update(Request $request, Ads $a) { - $title = $request->title; - $link = $request->link; + $title = $request->title; + $link = $request->link; $picture = $request->picture; - $status = $request->status === null ? 0 : 1; + $status = $request->status === null ? 0 : 1; $request->validate([ 'title' => 'required|max:100', @@ -81,7 +81,7 @@ class AdsController extends Controller } $a->title = $title; - $a->link = $link; + $a->link = $link; if ($picture !== null) { $a->picture = 'uploads/images/publicites/' . date('Y') . '/' . date('m') . '/' . $imageName; } diff --git a/app/Http/Controllers/Bo/ArticlesController.php b/app/Http/Controllers/Bo/ArticlesController.php index 223d6ac9..8b849ec7 100644 --- a/app/Http/Controllers/Bo/ArticlesController.php +++ b/app/Http/Controllers/Bo/ArticlesController.php @@ -40,8 +40,8 @@ class ArticlesController extends Controller ) . '-le-gaulois-' . date('d-m-Y') . '_r.' . $request->picture_r->extension(); $request->picture_r->move(public_path('uploads/images/articles/' . date('Y') . '/' . date('m')), $imageName_r); - $article = new Articles($request->validated()); - $article->picture = 'uploads/images/articles/' . date('Y') . '/' . date('m') . '/' . $imageName; + $article = new Articles($request->validated()); + $article->picture = 'uploads/images/articles/' . date('Y') . '/' . date('m') . '/' . $imageName; $article->picture_r = 'uploads/images/articles/' . date('Y') . '/' . date('m') . '/' . $imageName_r; $article->saveOrFail(); if ($request->type == ArticleCategory::sondage()) { @@ -73,7 +73,7 @@ class ArticlesController extends Controller public function update(UpdateArticle $request, Articles $article) { $article->fill($request->validated()); - $picture = $request->picture; + $picture = $request->picture; $picture_r = $request->picture_r; if ($picture !== null && $picture_r !== null) { @@ -125,7 +125,7 @@ class ArticlesController extends Controller // Save New answers foreach ($request->answers as $key => $formAnswer) { if (\strpos($key, '_') !== false) { - $answer = new SurveysAnswers(); + $answer = new SurveysAnswers(); $answer->answer = $formAnswer; $answer->article()->associate($article); $answer->saveOrFail(); @@ -133,11 +133,11 @@ class ArticlesController extends Controller } } else { // remove Sondage elements - $article->question = null; + $article->question = null; $article->multiple_response = null; - $article->stop_poll = null; + $article->stop_poll = null; $article->answers()->delete(); - } + }//end if $article->saveOrFail(); if ($article->type == ArticleCategory::actu() && $article->status === 1) { diff --git a/app/Http/Controllers/Bo/BreederPortraitController.php b/app/Http/Controllers/Bo/BreederPortraitController.php index e9ee1090..6840a499 100644 --- a/app/Http/Controllers/Bo/BreederPortraitController.php +++ b/app/Http/Controllers/Bo/BreederPortraitController.php @@ -29,8 +29,8 @@ class BreederPortraitController extends Controller $breederportrait = new BreederPortrait(); $breederportrait->fill($request->validated()); - $file = $request->file('picture'); - $fileName = sprintf( + $file = $request->file('picture'); + $fileName = sprintf( '%s-portrait-eleveur.%s', time(), $file->extension() @@ -55,8 +55,8 @@ class BreederPortraitController extends Controller $breederportrait->fill($request->validated()); if ($request->has('picture')) { - $file = $request->file('picture'); - $fileName = sprintf( + $file = $request->file('picture'); + $fileName = sprintf( '%s-portrait-eleveur.%s', time(), $file->extension() diff --git a/app/Http/Controllers/Bo/BreedingPageController.php b/app/Http/Controllers/Bo/BreedingPageController.php index de86ffa1..3cd284f7 100644 --- a/app/Http/Controllers/Bo/BreedingPageController.php +++ b/app/Http/Controllers/Bo/BreedingPageController.php @@ -26,8 +26,8 @@ class BreedingPageController extends Controller if ($type) { $query = $query->where('type', $type); } - $query = $this->sortQuery($query); - $pages = $query->paginate(); + $query = $this->sortQuery($query); + $pages = $query->paginate(); $searchFields = trans('Titre, Entête, Contenu'); return view('bo.breeding-page.index', compact('pages', 'type', 'searchFields')); } @@ -39,13 +39,13 @@ class BreedingPageController extends Controller public function store(StoreBreedingPageRequest $request, BreedingPageType $type) { - $data = $request->validated(); + $data = $request->validated(); $data['content'][0] = \array_merge_recursive( $request->content[0] ?? [], ['type' => BreedingBlocType::bloc1()] ); - $page = new BreedingPage($data); - $page->type = $type; + $page = new BreedingPage($data); + $page->type = $type; $this->storeUploadedImage($request, $page, 'picture'); $page->saveOrFail(); return redirect()->route('bo.breeding-page.edit', $page) diff --git a/app/Http/Controllers/Bo/ConsumptionTimesController.php b/app/Http/Controllers/Bo/ConsumptionTimesController.php index 2b460bc8..4deb25d2 100644 --- a/app/Http/Controllers/Bo/ConsumptionTimesController.php +++ b/app/Http/Controllers/Bo/ConsumptionTimesController.php @@ -26,8 +26,8 @@ class ConsumptionTimesController extends Controller public function store(Request $request) { - $name = $request->name; - $slug = Str::slug($name); + $name = $request->name; + $slug = Str::slug($name); $status = $request->status; $request->validate([ @@ -38,9 +38,9 @@ class ConsumptionTimesController extends Controller $status = 0; } - $ct = new ConsumptionTimes(); - $ct->name = $name; - $ct->slug = $slug; + $ct = new ConsumptionTimes(); + $ct->name = $name; + $ct->slug = $slug; $ct->status = $status; $ct->save(); @@ -55,8 +55,8 @@ class ConsumptionTimesController extends Controller public function update(Request $request, $id) { - $name = $request->name; - $slug = Str::slug($name); + $name = $request->name; + $slug = Str::slug($name); $status = $request->status; $request->validate([ @@ -67,9 +67,9 @@ class ConsumptionTimesController extends Controller $status = 0; } - $ct = ConsumptionTimes::findOrFail($id); - $ct->name = $name; - $ct->slug = $slug; + $ct = ConsumptionTimes::findOrFail($id); + $ct->name = $name; + $ct->slug = $slug; $ct->status = $status; $ct->save(); diff --git a/app/Http/Controllers/Bo/FaqQuestionsController.php b/app/Http/Controllers/Bo/FaqQuestionsController.php index 8c0a8f2c..8f6956ca 100644 --- a/app/Http/Controllers/Bo/FaqQuestionsController.php +++ b/app/Http/Controllers/Bo/FaqQuestionsController.php @@ -35,12 +35,12 @@ class FaqQuestionsController extends Controller public function store(Request $request) { - $question = $request->question; - $answer = $request->answer; + $question = $request->question; + $answer = $request->answer; $positiveVote = $request->positive_vote; $negativeVote = $request->negative_vote; - $themeId = $request->theme; - $status = 0; + $themeId = $request->theme; + $status = 0; $request->validate([ 'question' => 'required|max:255', @@ -49,13 +49,13 @@ class FaqQuestionsController extends Controller 'negative_vote' => 'required|min:0', ]); - $q = new FaqQuestions(); - $q->question = $question; - $q->answer = $answer; + $q = new FaqQuestions(); + $q->question = $question; + $q->answer = $answer; $q->positive_vote = intval($positiveVote); $q->negative_vote = intval($negativeVote); $q->faq_themes_id = $themeId; - $q->status = $status; + $q->status = $status; $q->save(); return redirect()->route('bo.faq-questions.index'); @@ -71,12 +71,12 @@ class FaqQuestionsController extends Controller public function update(Request $request, FaqQuestions $q) { - $question = $request->question; - $answer = $request->answer; + $question = $request->question; + $answer = $request->answer; $positiveVote = intval($request->positive_vote); $negativeVote = intval($request->negative_vote); - $themeId = $request->theme; - $status = $request->status === null ? 0 : 1; + $themeId = $request->theme; + $status = $request->status === null ? 0 : 1; $request->validate([ 'question' => 'required|max:255', @@ -85,12 +85,12 @@ class FaqQuestionsController extends Controller 'negative_vote' => 'required|min:0', ]); - $q->question = $question; - $q->answer = $answer; + $q->question = $question; + $q->answer = $answer; $q->positive_vote = $positiveVote; $q->negative_vote = $negativeVote; $q->faq_themes_id = $themeId; - $q->status = $status; + $q->status = $status; $q->save(); return redirect()->route('bo.faq-questions.edit', $q->id)->with('success', 'Enregistré !'); diff --git a/app/Http/Controllers/Bo/FaqThemesController.php b/app/Http/Controllers/Bo/FaqThemesController.php index 638b2a48..1b51be00 100644 --- a/app/Http/Controllers/Bo/FaqThemesController.php +++ b/app/Http/Controllers/Bo/FaqThemesController.php @@ -22,7 +22,7 @@ class FaqThemesController extends Controller public function store(Request $request) { - $name = $request->name; + $name = $request->name; $pictogram = $request->pictogram; $request->validate([ @@ -30,10 +30,10 @@ class FaqThemesController extends Controller 'pictogram' => 'required|max:255', ]); - $f = new FaqThemes(); - $f->name = $name; + $f = new FaqThemes(); + $f->name = $name; $f->pictogram = $pictogram; - $f->order = $this->getLastOrder(); + $f->order = $this->getLastOrder(); $f->save(); return redirect()->route('bo.faq-themes.index'); @@ -47,7 +47,7 @@ class FaqThemesController extends Controller public function update(Request $request, $id) { - $name = $request->name; + $name = $request->name; $pictogram = $request->pictogram; $request->validate([ @@ -57,7 +57,7 @@ class FaqThemesController extends Controller $f = FaqThemes::findOrFail($id); - $f->name = $name; + $f->name = $name; $f->pictogram = $pictogram; $f->save(); @@ -84,14 +84,14 @@ class FaqThemesController extends Controller $current = FaqThemes::findOrFail($id); if ($action === 'up') { - $tmp = FaqThemes::where('order', '<', $current->order)->orderBy('order', 'DESC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; + $tmp = FaqThemes::where('order', '<', $current->order)->orderBy('order', 'DESC')->first(); + $newOrder = $tmp->order; + $tmp->order = $current->order; $current->order = $newOrder; } else { - $tmp = FaqThemes::where('order', '>', $current->order)->orderBy('order', 'ASC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; + $tmp = FaqThemes::where('order', '>', $current->order)->orderBy('order', 'ASC')->first(); + $newOrder = $tmp->order; + $tmp->order = $current->order; $current->order = $newOrder; } $tmp->save(); diff --git a/app/Http/Controllers/Bo/HomeSliderPicturesController.php b/app/Http/Controllers/Bo/HomeSliderPicturesController.php index e94b903b..17fb0972 100644 --- a/app/Http/Controllers/Bo/HomeSliderPicturesController.php +++ b/app/Http/Controllers/Bo/HomeSliderPicturesController.php @@ -27,16 +27,16 @@ class HomeSliderPicturesController extends Controller public function store(Request $request) { $catchPhrase = $request->catch_phrase; - $catchColor = $request->catch_color; - $title = $request->title; - $titleColor = $request->title_color; - $picture = $request->picture; - $picture_r = $request->picture_r; - $linkLabel = $request->link_label; - $link = $request->link; - $linkColor = $request->link_color; - $newTab = $request->new_tab === null ? 0 : 1; - $status = 0; + $catchColor = $request->catch_color; + $title = $request->title; + $titleColor = $request->title_color; + $picture = $request->picture; + $picture_r = $request->picture_r; + $linkLabel = $request->link_label; + $link = $request->link; + $linkColor = $request->link_color; + $newTab = $request->new_tab === null ? 0 : 1; + $status = 0; $request->validate([ 'catch_phrase' => 'required|max:100', @@ -58,25 +58,25 @@ class HomeSliderPicturesController extends Controller $imageName_r ); - $hsp = new HomeSliderPictures(); + $hsp = new HomeSliderPictures(); $hsp->catch_phrase = $catchPhrase; - $hsp->catch_color = $catchColor; - $hsp->title = $title; - $hsp->title_color = $titleColor; - $hsp->picture = 'uploads/images/slider_accueil/' . date('Y') . '/' . date('m') . '/' . $imageName; - $hsp->picture_r = 'uploads/images/slider_accueil/' . date('Y') . '/' . date('m') . '/' . $imageName_r; - $hsp->link_label = $linkLabel; - $hsp->link = $link; - $hsp->link_color = $linkColor; - $hsp->new_tab = $newTab; - $hsp->days = Days::none()->value; + $hsp->catch_color = $catchColor; + $hsp->title = $title; + $hsp->title_color = $titleColor; + $hsp->picture = 'uploads/images/slider_accueil/' . date('Y') . '/' . date('m') . '/' . $imageName; + $hsp->picture_r = 'uploads/images/slider_accueil/' . date('Y') . '/' . date('m') . '/' . $imageName_r; + $hsp->link_label = $linkLabel; + $hsp->link = $link; + $hsp->link_color = $linkColor; + $hsp->new_tab = $newTab; + $hsp->days = Days::none()->value; foreach (Days::toArray() as $day) { if (isset($request[$day->value])) { $hsp->addDay($day); } } $hsp->status = $status; - $hsp->order = $this->getLastOrder(); + $hsp->order = $this->getLastOrder(); $hsp->save(); return redirect()->route('bo.home-slider-pictures.index'); @@ -91,16 +91,16 @@ class HomeSliderPicturesController extends Controller public function update(Request $request, $id) { $catchPhrase = $request->catch_phrase; - $catchColor = $request->catch_color; - $title = $request->title; - $titleColor = $request->title_color; - $picture = $request->picture; - $picture_r = $request->picture_r; - $linkLabel = $request->link_label; - $link = $request->link; - $linkColor = $request->link_color; - $newTab = $request->new_tab === null ? 0 : 1; - $status = $request->status === null ? 0 : 1; + $catchColor = $request->catch_color; + $title = $request->title; + $titleColor = $request->title_color; + $picture = $request->picture; + $picture_r = $request->picture_r; + $linkLabel = $request->link_label; + $link = $request->link; + $linkColor = $request->link_color; + $newTab = $request->new_tab === null ? 0 : 1; + $status = $request->status === null ? 0 : 1; $request->validate([ 'catch_phrase' => 'required|max:100', @@ -151,9 +151,9 @@ class HomeSliderPicturesController extends Controller } $hsp->catch_phrase = $catchPhrase; - $hsp->catch_color = $catchColor; - $hsp->title = $title; - $hsp->title_color = $titleColor; + $hsp->catch_color = $catchColor; + $hsp->title = $title; + $hsp->title_color = $titleColor; if ($picture !== null) { $hsp->picture = 'uploads/images/slider_accueil/' . date('Y') . '/' . date('m') . '/' . $imageName; } @@ -161,9 +161,9 @@ class HomeSliderPicturesController extends Controller $hsp->picture_r = 'uploads/images/slider_accueil/' . date('Y') . '/' . date('m') . '/' . $imageName_r; } $hsp->link_label = $linkLabel; - $hsp->link = $link; + $hsp->link = $link; $hsp->link_color = $linkColor; - $hsp->new_tab = $newTab; + $hsp->new_tab = $newTab; foreach (Days::toArray() as $day) { if (isset($request[$day->value])) { $hsp->addDay($day); @@ -200,14 +200,14 @@ class HomeSliderPicturesController extends Controller $current = HomeSliderPictures::findOrFail($id); if ($action === 'up') { - $tmp = HomeSliderPictures::where('order', '<', $current->order)->orderBy('order', 'DESC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; + $tmp = HomeSliderPictures::where('order', '<', $current->order)->orderBy('order', 'DESC')->first(); + $newOrder = $tmp->order; + $tmp->order = $current->order; $current->order = $newOrder; } else { - $tmp = HomeSliderPictures::where('order', '>', $current->order)->orderBy('order', 'ASC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; + $tmp = HomeSliderPictures::where('order', '>', $current->order)->orderBy('order', 'ASC')->first(); + $newOrder = $tmp->order; + $tmp->order = $current->order; $current->order = $newOrder; } $tmp->save(); diff --git a/app/Http/Controllers/Bo/LabelController.php b/app/Http/Controllers/Bo/LabelController.php index 8563c254..b76799f2 100644 --- a/app/Http/Controllers/Bo/LabelController.php +++ b/app/Http/Controllers/Bo/LabelController.php @@ -23,7 +23,6 @@ class LabelController extends Controller return view('bo.labels.create'); } - // public function store(StoreLabel $request) { (new Label($request->validated()))->saveOrFail(); diff --git a/app/Http/Controllers/Bo/MomentsController.php b/app/Http/Controllers/Bo/MomentsController.php index 91822031..35587f36 100644 --- a/app/Http/Controllers/Bo/MomentsController.php +++ b/app/Http/Controllers/Bo/MomentsController.php @@ -20,7 +20,7 @@ class MomentsController extends Controller { use UpdateModelStatus; - /* TODO: remplacer ce truc moche par un enum */ + // TODO: remplacer ce truc moche par un enum private $colors = [ "color-1" => "Couleur 1", "color-2" => 'Couleur 2', @@ -32,7 +32,7 @@ class MomentsController extends Controller "color-8" => "Couleur 8", ]; - /* TODO: remplacer ce truc moche par un enum */ + // TODO: remplacer ce truc moche par un enum private $featuredTypes = [ "recettes" => "Recettes", "produits" => "Produits", @@ -47,10 +47,10 @@ class MomentsController extends Controller public function create() { - $recipes = Recipes::select('id', 'title')->where('status', 1)->get(); + $recipes = Recipes::select('id', 'title')->where('status', 1)->get(); $articles = Articles::select('id', 'title')->where('status', 1)->get(); $products = Products::select('id', 'name as title')->where('status', 1)->get(); - $strates = json_encode([]); + $strates = json_encode([]); return view('bo.moments.create', compact('recipes', 'articles', 'products', 'strates')) ->with('colors', $this->colors) ->with('featuredTypes', $this->featuredTypes); @@ -73,22 +73,22 @@ class MomentsController extends Controller return back()->withInput()->withErrors("Le texte de la remontée est recquis."); } - $title = $request->title; - $description = $request->description; - $color = $request->color; - $picture = $request->picture; - $picture_bg = $request->picture_bg; - $picture_bg_r = $request->picture_bg_r; - $parallax = $request->parallax === null ? 0 : 1; - $starMoment = 0; - $status = 0; - $featuredTitle = $request->featured_title; - $featuredType = strtolower($request->featured_type); - $featuredIds = $request->featured_ids; + $title = $request->title; + $description = $request->description; + $color = $request->color; + $picture = $request->picture; + $picture_bg = $request->picture_bg; + $picture_bg_r = $request->picture_bg_r; + $parallax = $request->parallax === null ? 0 : 1; + $starMoment = 0; + $status = 0; + $featuredTitle = $request->featured_title; + $featuredType = strtolower($request->featured_type); + $featuredIds = $request->featured_ids; $featuredStatus = $request->featured_status === null ? 0 : 1; $voucherPicture = $request->voucher_picture; - $voucherStatus = $request->voucher_status === null ? 0 : 1; - $strates = json_decode($request->strates); + $voucherStatus = $request->voucher_status === null ? 0 : 1; + $strates = json_decode($request->strates); $featuredIdsString = ''; foreach ($featuredIds as $featuredId) { @@ -113,21 +113,21 @@ class MomentsController extends Controller ); } - $m = new Moments(); - $m->title = $title; - $m->slug = Str::slug($title); - $m->description = $description; - $m->color = $color; - $m->picture = 'uploads/images/moments/' . date('Y') . '/' . date('m') . '/' . $imageName; - $m->picture_bg = 'uploads/images/moments/' . date('Y') . '/' . date('m') . '/' . $imageName_bg; - $m->picture_bg_r = 'uploads/images/moments/' . date('Y') . '/' . date('m') . '/' . $imageName_bg_r; - $m->parallax = $parallax; - $m->star_moment = $starMoment; - $m->status = $status; - $m->featured_title = $featuredTitle; - $m->featured_text = $featuredText; - $m->featured_type = $featuredType; - $m->featured_ids = $featuredIdsString; + $m = new Moments(); + $m->title = $title; + $m->slug = Str::slug($title); + $m->description = $description; + $m->color = $color; + $m->picture = 'uploads/images/moments/' . date('Y') . '/' . date('m') . '/' . $imageName; + $m->picture_bg = 'uploads/images/moments/' . date('Y') . '/' . date('m') . '/' . $imageName_bg; + $m->picture_bg_r = 'uploads/images/moments/' . date('Y') . '/' . date('m') . '/' . $imageName_bg_r; + $m->parallax = $parallax; + $m->star_moment = $starMoment; + $m->status = $status; + $m->featured_title = $featuredTitle; + $m->featured_text = $featuredText; + $m->featured_type = $featuredType; + $m->featured_ids = $featuredIdsString; $m->featured_status = $featuredStatus; if ($voucherPicture !== null) { $m->voucher_picture = 'uploads/images/moments/' . date('Y') . '/' . date('m') . '/' . $imageNameVoucher; @@ -150,12 +150,12 @@ class MomentsController extends Controller } $compteur++; - $s = new MomentStrates(); + $s = new MomentStrates(); $s->moment_id = $m->id; - $s->title = $strate->title; + $s->title = $strate->title; // Gestion de l'image - $image = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $strate->picture)); + $image = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $strate->picture)); $extension = explode('/', mime_content_type($strate->picture))[1]; if (!in_array($extension, ['png', 'jpg', 'jpeg'])) { $m->delete(); @@ -178,24 +178,24 @@ class MomentsController extends Controller $imageName = 'strate' . $compteur . '.' . $extension; $tmpFile->move(public_path("uploads/images/moments/$m->id"), $imageName); - $s->picture = 'uploads/images/moments/' . $m->id . '/' . $imageName; + $s->picture = 'uploads/images/moments/' . $m->id . '/' . $imageName; $s->picture_label = $strate->picture_label; - $s->content = $strate->content; - $s->button_label = $strate->button_label; - $s->button_link = $strate->button_link; - $s->status = $strate->status === null ? 0 : 1; + $s->content = $strate->content; + $s->button_label = $strate->button_label; + $s->button_link = $strate->button_link; + $s->status = $strate->status === null ? 0 : 1; $s->save(); - } + }//end foreach return redirect()->route('bo.moments.index'); } public function edit(Moments $m) { - $recipes = Recipes::select('id', 'title')->where('status', 1)->get(); + $recipes = Recipes::select('id', 'title')->where('status', 1)->get(); $articles = Articles::select('id', 'title')->where('status', 1)->get(); $products = Products::select('id', 'name as title')->where('status', 1)->get(); - $strates = count($m->strates) > 0 ? json_encode($m->strates) : json_encode([]); + $strates = count($m->strates) > 0 ? json_encode($m->strates) : json_encode([]); return view('bo.moments.edit', compact('m', 'recipes', 'articles', 'products')) ->with('colors', $this->colors) ->with('featuredTypes', $this->featuredTypes) @@ -215,22 +215,22 @@ class MomentsController extends Controller return back()->withInput()->withErrors("Le champ texte de la remontée est obligatoire."); } - $title = $request->title; - $description = $request->description; - $color = $request->color; - $picture = $request->picture; - $picture_bg = $request->picture_bg; - $picture_bg_r = $request->picture_bg_r; - $parallax = $request->parallax === null ? 0 : 1; - $status = $request->status === null ? 0 : 1; - $featuredTitle = $request->featured_title; - $featuredText = $request->featured_text; - $featuredType = strtolower($request->featured_type); - $featuredIds = $request->featured_ids; + $title = $request->title; + $description = $request->description; + $color = $request->color; + $picture = $request->picture; + $picture_bg = $request->picture_bg; + $picture_bg_r = $request->picture_bg_r; + $parallax = $request->parallax === null ? 0 : 1; + $status = $request->status === null ? 0 : 1; + $featuredTitle = $request->featured_title; + $featuredText = $request->featured_text; + $featuredType = strtolower($request->featured_type); + $featuredIds = $request->featured_ids; $featuredStatus = $request->featured_status === null ? 0 : 1; $voucherPicture = $request->voucher_picture; - $voucherStatus = $request->voucher_status === null ? 0 : 1; - $strates = json_decode($request->strates); + $voucherStatus = $request->voucher_status === null ? 0 : 1; + $strates = json_decode($request->strates); if ($picture !== null) { $request->validate([ @@ -299,10 +299,10 @@ class MomentsController extends Controller ); } - $m->title = $title; - $m->slug = Str::slug($title); + $m->title = $title; + $m->slug = Str::slug($title); $m->description = $description; - $m->color = $color; + $m->color = $color; if ($picture !== null) { $m->picture = 'uploads/images/moments/' . date('Y') . '/' . date('m') . '/' . $imageName; } @@ -313,15 +313,15 @@ class MomentsController extends Controller $m->picture_bg_r = 'uploads/images/moments/' . date('Y') . '/' . date('m') . '/' . $imageName_bg_r; } $m->parallax = $parallax; - $m->status = $status; + $m->status = $status; // Un moment non publié ne peut pas être moment star if ($status === 0) { $m->star_moment = 0; } - $m->featured_title = $featuredTitle; - $m->featured_text = $featuredText; - $m->featured_type = $featuredType; - $m->featured_ids = $featuredIdsString; + $m->featured_title = $featuredTitle; + $m->featured_text = $featuredText; + $m->featured_type = $featuredType; + $m->featured_ids = $featuredIdsString; $m->featured_status = $featuredStatus; if ($voucherPicture !== null) { $m->voucher_picture = 'uploads/images/moments/' . date('Y') . '/' . date('m') . '/' . $imageNameVoucher; @@ -330,7 +330,7 @@ class MomentsController extends Controller // Gestion des strates $compteur = 0; - $ids = []; + $ids = []; foreach ($strates as $strate) { $validator = Validator::make(get_object_vars($strate), [ 'title' => 'required|max:255', @@ -349,14 +349,14 @@ class MomentsController extends Controller $s = new MomentStrates(); } $s->moment_id = $m->id; - $s->title = $strate->title; + $s->title = $strate->title; // Gestion de l'image if ( ($strate->id !== null && MomentStrates::find($strate->id)->picture !== $strate->picture) || ($strate->id === null && $strate->picture !== null) ) { - $image = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $strate->picture)); + $image = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $strate->picture)); $extension = explode('/', mime_content_type($strate->picture))[1]; if (!in_array($extension, ['png', 'jpg', 'jpeg'])) { return back()->with('strates', json_encode($strates))->withInput() @@ -376,16 +376,16 @@ class MomentsController extends Controller $imageName = 'strate' . $compteur . '.' . $extension; $tmpFile->move(public_path("uploads/images/moments/$m->id"), $imageName); $s->picture = 'uploads/images/moments/' . $m->id . '/' . $imageName; - } + }//end if $s->picture_label = $strate->picture_label; - $s->content = $strate->content; - $s->button_label = $strate->button_label; - $s->button_link = $strate->button_link; - $s->status = $strate->status === null ? 0 : 1; + $s->content = $strate->content; + $s->button_label = $strate->button_label; + $s->button_link = $strate->button_link; + $s->status = $strate->status === null ? 0 : 1; $s->save(); $ids[] = $s->id; - } + }//end foreach if (count($ids) > 0) { $idsExists = []; diff --git a/app/Http/Controllers/Bo/NewsSliderPicturesController.php b/app/Http/Controllers/Bo/NewsSliderPicturesController.php index ea78e6fb..fcea1772 100644 --- a/app/Http/Controllers/Bo/NewsSliderPicturesController.php +++ b/app/Http/Controllers/Bo/NewsSliderPicturesController.php @@ -26,11 +26,11 @@ class NewsSliderPicturesController extends Controller public function store(Request $request) { $catchPhrase = $request->catch_phrase; - $title = $request->title; - $picture = $request->picture; - $link = $request->link; - $newTab = $request->new_tab === null ? 0 : 1; - $status = 0; + $title = $request->title; + $picture = $request->picture; + $link = $request->link; + $newTab = $request->new_tab === null ? 0 : 1; + $status = 0; $request->validate([ 'catch_phrase' => 'required|max:100', @@ -42,14 +42,14 @@ class NewsSliderPicturesController extends Controller $imageName = Str::slug($title) . '-le-gaulois-' . date('d-m-Y') . '.' . $picture->extension(); $picture->move(public_path('uploads/images/slider_actus/' . date('Y') . '/' . date('m') . '/'), $imageName); - $n = new NewsSliderPictures(); + $n = new NewsSliderPictures(); $n->catch_phrase = $catchPhrase; - $n->title = $title; - $n->picture = 'uploads/images/slider_actus/' . date('Y') . '/' . date('m') . '/' . $imageName; - $n->link = $link; - $n->new_tab = $newTab; - $n->status = $status; - $n->order = $this->getLastOrder(); + $n->title = $title; + $n->picture = 'uploads/images/slider_actus/' . date('Y') . '/' . date('m') . '/' . $imageName; + $n->link = $link; + $n->new_tab = $newTab; + $n->status = $status; + $n->order = $this->getLastOrder(); $n->save(); return redirect()->route('bo.news-slider-pictures.index'); @@ -64,11 +64,11 @@ class NewsSliderPicturesController extends Controller public function update(Request $request, $id) { $catchPhrase = $request->catch_phrase; - $title = $request->title; - $picture = $request->picture; - $link = $request->link; - $newTab = $request->new_tab === null ? 0 : 1; - $status = $request->status === null ? 0 : 1; + $title = $request->title; + $picture = $request->picture; + $link = $request->link; + $newTab = $request->new_tab === null ? 0 : 1; + $status = $request->status === null ? 0 : 1; $request->validate([ 'catch_phrase' => 'required|max:100', @@ -93,13 +93,13 @@ class NewsSliderPicturesController extends Controller } $n->catch_phrase = $catchPhrase; - $n->title = $title; + $n->title = $title; if ($picture !== null) { $n->picture = 'uploads/images/slider_actus/' . date('Y') . '/' . date('m') . '/' . $imageName; } - $n->link = $link; + $n->link = $link; $n->new_tab = $newTab; - $n->status = $status; + $n->status = $status; $n->save(); return redirect()->route('bo.news-slider-pictures.index'); @@ -124,14 +124,14 @@ class NewsSliderPicturesController extends Controller $current = NewsSliderPictures::findOrFail($id); if ($action === 'up') { - $tmp = NewsSliderPictures::where('order', '<', $current->order)->orderBy('order', 'DESC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; + $tmp = NewsSliderPictures::where('order', '<', $current->order)->orderBy('order', 'DESC')->first(); + $newOrder = $tmp->order; + $tmp->order = $current->order; $current->order = $newOrder; } else { - $tmp = NewsSliderPictures::where('order', '>', $current->order)->orderBy('order', 'ASC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; + $tmp = NewsSliderPictures::where('order', '>', $current->order)->orderBy('order', 'ASC')->first(); + $newOrder = $tmp->order; + $tmp->order = $current->order; $current->order = $newOrder; } $tmp->save(); diff --git a/app/Http/Controllers/Bo/OCBBreedersController.php b/app/Http/Controllers/Bo/OCBBreedersController.php index 8296c2af..a809340b 100644 --- a/app/Http/Controllers/Bo/OCBBreedersController.php +++ b/app/Http/Controllers/Bo/OCBBreedersController.php @@ -30,7 +30,7 @@ class OCBBreedersController extends Controller ); } $searchFields = trans('Nom, Prénom, Inuav'); - $b = $b->paginate(); + $b = $b->paginate(); return view('bo.ocbbreeders.index', compact('b', 'type', 'searchFields')); } @@ -44,8 +44,8 @@ class OCBBreedersController extends Controller $b = new OCBBreeder(); $b->fill($request->validated()); - $file = $request->file('picture'); - $fileName = sprintf( + $file = $request->file('picture'); + $fileName = sprintf( '%s-%s-%s-le-gaulois.%s', $b->id, Str::slug($b->first_name), @@ -56,8 +56,8 @@ class OCBBreedersController extends Controller for ($i = 1; $i <= 3; $i++) { if ($request->has('picture' . $i)) { - $file = $request->file('picture' . $i); - $fileName = sprintf( + $file = $request->file('picture' . $i); + $fileName = sprintf( '%s-%s-%s-site%d-elevage-le-gaulois.%s', $b->id, Str::slug($b->first_name), @@ -89,8 +89,8 @@ class OCBBreedersController extends Controller $breeder->fill($request->validated()); if ($request->has('picture')) { - $file = $request->file('picture'); - $fileName = sprintf( + $file = $request->file('picture'); + $fileName = sprintf( '%s-%s-%s-le-gaulois.%s', $breeder->id, Str::slug($breeder->first_name), @@ -102,8 +102,8 @@ class OCBBreedersController extends Controller for ($i = 1; $i <= 3; $i++) { if ($request->has('picture' . $i)) { - $file = $request->file('picture' . $i); - $fileName = sprintf( + $file = $request->file('picture' . $i); + $fileName = sprintf( '%s-%s-%s-site%d-elevage-le-gaulois.%s', $breeder->id, Str::slug($breeder->first_name), diff --git a/app/Http/Controllers/Bo/OCBContentController.php b/app/Http/Controllers/Bo/OCBContentController.php index 5ed70ce5..374a63a8 100644 --- a/app/Http/Controllers/Bo/OCBContentController.php +++ b/app/Http/Controllers/Bo/OCBContentController.php @@ -29,8 +29,8 @@ class OCBContentController extends Controller { $picture = $request->picture; $content = $request->content; - $status = 0; - $type = $request->type; + $status = 0; + $type = $request->type; $request->validate([ 'picture' => 'required|image|mimes:jpeg,png,jpg|max:2048|dimensions:width=1366,height=553', @@ -44,12 +44,12 @@ class OCBContentController extends Controller ); $picture->move(public_path('uploads/images/ocb/' . date('Y') . '/' . date('m')), $imageName); - $ocb = new OCBContent(); + $ocb = new OCBContent(); $ocb->picture = sprintf('uploads/images/ocb/%s/%s/%s', date('Y'), date('m'), $imageName); $ocb->content = $content; - $ocb->status = $status; - $ocb->type = $type; - $ocb->order = $this->getLastOrder($ocb->type); + $ocb->status = $status; + $ocb->type = $type; + $ocb->order = $this->getLastOrder($ocb->type); $ocb->save(); return redirect()->route('bo.ocb.content', $type); @@ -65,8 +65,8 @@ class OCBContentController extends Controller { $picture = $request->picture; $content = $request->content; - $status = $request->status === null ? 0 : 1; - $type = $request->type; + $status = $request->status === null ? 0 : 1; + $type = $request->type; if ($picture !== null) { $request->validate([ @@ -92,13 +92,13 @@ class OCBContentController extends Controller ))); } - $ocb->type = $type; + $ocb->type = $type; $ocb->content = $content; if ($picture !== null) { $ocb->picture = sprintf('uploads/images/ocb/%s/%s/%s', date('Y'), date('m'), $imageName); } $ocb->status = $status; - $ocb->type = $type; + $ocb->type = $type; $ocb->save(); return redirect()->route('bo.ocb.edit', $ocb->id)->with('success', 'Enregistré !'); @@ -119,20 +119,20 @@ class OCBContentController extends Controller public function changeOrder(OCBContent $current, $action) { if ($action === 'up') { - $tmp = OCBContent::where([ + $tmp = OCBContent::where([ ['order', '<', $current->order], ['type', $current->type], ])->orderBy('order', 'DESC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; + $newOrder = $tmp->order; + $tmp->order = $current->order; $current->order = $newOrder; } else { - $tmp = OCBContent::where([ + $tmp = OCBContent::where([ ['order', '>', $current->order], ['type', $current->type], ])->orderBy('order', 'ASC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; + $newOrder = $tmp->order; + $tmp->order = $current->order; $current->order = $newOrder; } $tmp->save(); diff --git a/app/Http/Controllers/Bo/ProductPictogramsController.php b/app/Http/Controllers/Bo/ProductPictogramsController.php index 12fb2dc6..0368672b 100644 --- a/app/Http/Controllers/Bo/ProductPictogramsController.php +++ b/app/Http/Controllers/Bo/ProductPictogramsController.php @@ -23,7 +23,7 @@ class ProductPictogramsController extends Controller public function store(Request $request) { - $name = $request->name; + $name = $request->name; $picture = $request->picture; $request->validate([ @@ -34,8 +34,8 @@ class ProductPictogramsController extends Controller $imageName = Str::slug($name) . '.' . $picture->extension(); $picture->move(public_path('uploads/images/pictos/'), $imageName); - $pp = new ProductPictograms(); - $pp->name = $name; + $pp = new ProductPictograms(); + $pp->name = $name; $pp->picture = 'uploads/images/pictos/' . $imageName; $pp->save(); @@ -50,7 +50,7 @@ class ProductPictogramsController extends Controller public function update(Request $request, $id) { - $name = $request->name; + $name = $request->name; $picture = $request->picture; $request->validate([ @@ -73,7 +73,7 @@ class ProductPictogramsController extends Controller public function destroy($id) { - $pp = ProductPictograms::findOrFail($id); + $pp = ProductPictograms::findOrFail($id); $path = public_path() . '/' . $pp->picture; if (file_exists($path)) { unlink($path); diff --git a/app/Http/Controllers/Bo/ProductSliderPicturesController.php b/app/Http/Controllers/Bo/ProductSliderPicturesController.php index 48c81245..e78dd5b9 100644 --- a/app/Http/Controllers/Bo/ProductSliderPicturesController.php +++ b/app/Http/Controllers/Bo/ProductSliderPicturesController.php @@ -25,12 +25,12 @@ class ProductSliderPicturesController extends Controller public function store(Request $request) { - $picture = $request->picture; + $picture = $request->picture; $picture_r = $request->picture_r; - $link = $request->link; - $title = $request->title; - $newTab = $request->new_tab === null ? 0 : 1; - $status = 0; + $link = $request->link; + $title = $request->title; + $newTab = $request->new_tab === null ? 0 : 1; + $status = 0; $request->validate([ 'picture' => 'required|image|mimes:jpeg,png,jpg|max:2048|dimensions:width=1366,height=553', @@ -39,7 +39,7 @@ class ProductSliderPicturesController extends Controller 'title' => 'required|max:255', ]); - $imageName = Str::slug($title) . '-le-gaulois.' . $picture->extension(); + $imageName = Str::slug($title) . '-le-gaulois.' . $picture->extension(); $imageName_r = Str::slug($title) . '-le-gaulois_r.' . $picture->extension(); $picture->move(public_path( 'uploads/images/slider_produits/' . date('Y') . '/' . date('m') . '/' @@ -48,14 +48,14 @@ class ProductSliderPicturesController extends Controller 'uploads/images/slider_produits/' . date('Y') . '/' . date('m') . '/' ), $imageName_r); - $p = new ProductSliderPictures(); - $p->picture = 'uploads/images/slider_produits/' . date('Y') . '/' . date('m') . '/' . $imageName; + $p = new ProductSliderPictures(); + $p->picture = 'uploads/images/slider_produits/' . date('Y') . '/' . date('m') . '/' . $imageName; $p->picture_r = 'uploads/images/slider_produits/' . date('Y') . '/' . date('m') . '/' . $imageName_r; - $p->link = $link; - $p->title = $title; - $p->new_tab = $newTab; - $p->status = $status; - $p->order = $this->getLastOrder(); + $p->link = $link; + $p->title = $title; + $p->new_tab = $newTab; + $p->status = $status; + $p->order = $this->getLastOrder(); $p->save(); return redirect()->route('bo.product-slider-pictures.index'); @@ -69,12 +69,12 @@ class ProductSliderPicturesController extends Controller public function update(Request $request, $id) { - $picture = $request->picture; + $picture = $request->picture; $picture_r = $request->picture_r; - $link = $request->link; - $title = $request->title; - $newTab = $request->new_tab === null ? 0 : 1; - $status = $request->status === null ? 0 : 1; + $link = $request->link; + $title = $request->title; + $newTab = $request->new_tab === null ? 0 : 1; + $status = $request->status === null ? 0 : 1; $request->validate([ 'link' => 'required|max:255', @@ -123,11 +123,11 @@ class ProductSliderPicturesController extends Controller if ($picture_r !== null) { $p->picture_r = 'uploads/images/slider_produits/' . date('Y') . '/' . date('m') . '/' . $imageName_r; } - $p->link = $link; - $p->title = $title; + $p->link = $link; + $p->title = $title; $p->new_tab = $newTab; - $p->status = $status; - $p->order = $this->getLastOrder(); + $p->status = $status; + $p->order = $this->getLastOrder(); $p->save(); return redirect()->route('bo.product-slider-pictures.edit', $p->id)->with('success', 'Enregistré !'); @@ -156,14 +156,14 @@ class ProductSliderPicturesController extends Controller $current = ProductSliderPictures::findOrFail($id); if ($action === 'up') { - $tmp = ProductSliderPictures::where('order', '<', $current->order)->orderBy('order', 'DESC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; + $tmp = ProductSliderPictures::where('order', '<', $current->order)->orderBy('order', 'DESC')->first(); + $newOrder = $tmp->order; + $tmp->order = $current->order; $current->order = $newOrder; } else { - $tmp = ProductSliderPictures::where('order', '>', $current->order)->orderBy('order', 'ASC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; + $tmp = ProductSliderPictures::where('order', '>', $current->order)->orderBy('order', 'ASC')->first(); + $newOrder = $tmp->order; + $tmp->order = $current->order; $current->order = $newOrder; } $tmp->save(); diff --git a/app/Http/Controllers/Bo/ProductsController.php b/app/Http/Controllers/Bo/ProductsController.php index e51ab706..14cdde5a 100644 --- a/app/Http/Controllers/Bo/ProductsController.php +++ b/app/Http/Controllers/Bo/ProductsController.php @@ -35,7 +35,7 @@ class ProductsController extends Controller public function index(SearchProduct $request) { $ranges = Range::all(['id', 'name']); - $p = Products::with('range'); + $p = Products::with('range'); if ($request->search) { $p = $this->searchQuery( $p, @@ -56,25 +56,25 @@ class ProductsController extends Controller $p = $p->whereRangeId($request->rangefilter); } $searchFields = trans('Nom, Desc., Ingr., Cons., Tags, Infos'); - $p = $p->paginate(); + $p = $p->paginate(); return view('bo.products.index', compact('p', 'searchFields', 'ranges')); } public function create() { // Limitation aux champs dont on a besoin sur certaines requêtes pour ne pas surcharger ces dernières - $pictograms = ProductPictograms::paginate(); + $pictograms = ProductPictograms::paginate(); $pictosDatas = []; foreach ($pictograms as $picto) { $pictosDatas[] = ['id' => $picto->id, 'src' => '/' . \ltrim($picto->picture, '/\\'), 'alt' => $picto->name]; } - $pictosSelected = []; - $subranges = SubRange::all(); - $ranges = Range::select('id', 'name')->paginate(); - $meatTypes = MeatTypes::all(); + $pictosSelected = []; + $subranges = SubRange::all(); + $ranges = Range::select('id', 'name')->paginate(); + $meatTypes = MeatTypes::all(); $consumptionTimes = ConsumptionTimes::select('id', 'name')->paginate(); - $labels = Label::all(); - $recipes = Recipes::select('id', 'title')->paginate(); + $labels = Label::all(); + $recipes = Recipes::select('id', 'title')->paginate(); return view('bo.products.create', compact( 'pictosDatas', 'pictosSelected', @@ -89,65 +89,65 @@ class ProductsController extends Controller public function store(StoreProductRequest $request) { - $name = $request->name; - $slug = Str::slug($name); - $seo_title = $request->seo_title; - $seo_description = $request->seo_description; - $tags = $request->tags; - $subtitle = $request->subtitle; - $info1 = $request->info1; - $info2 = $request->info2; - $description = $request->description; - $numberPortion = intval($request->number_portion); - $typePortion = $request->type_portion; + $name = $request->name; + $slug = Str::slug($name); + $seo_title = $request->seo_title; + $seo_description = $request->seo_description; + $tags = $request->tags; + $subtitle = $request->subtitle; + $info1 = $request->info1; + $info2 = $request->info2; + $description = $request->description; + $numberPortion = intval($request->number_portion); + $typePortion = $request->type_portion; $theoreticalAverageWeight = $request->theoretical_average_weight; - $otherFormat = $request->other_format; - $rangeId = $request->range_id; - $meatTypeId = $request->meat_type_id; - $consumptionTimesId = $request->consumption_times_id; - $labelId = (\is_string($request->label_id) and \strlen($request->label_id)) ? $request->label_id : null; - $preparationAdvice = $request->preparation_advice; - $ingredients = $request->ingredients; - $tips = $request->tips; - $recipeId = $request->recipe_id; - $videoLink = $request->video_link; - $status = 0; - $pictos = json_decode($request->pictos); + $otherFormat = $request->other_format; + $rangeId = $request->range_id; + $meatTypeId = $request->meat_type_id; + $consumptionTimesId = $request->consumption_times_id; + $labelId = (\is_string($request->label_id) and \strlen($request->label_id)) ? $request->label_id : null; + $preparationAdvice = $request->preparation_advice; + $ingredients = $request->ingredients; + $tips = $request->tips; + $recipeId = $request->recipe_id; + $videoLink = $request->video_link; + $status = 0; + $pictos = json_decode($request->pictos); $p = new Products(); $this->storeUploadedImage($request, $p, 'picture'); $this->storeUploadedImage($request, $p, 'pictureVideo'); - $p->name = $name; - $p->slug = $slug; - $p->seo_title = $seo_title; - $p->seo_description = $seo_description; - $p->tags = $tags; - $p->subtitle = $subtitle; - $p->info1 = $info1; - $p->info2 = $info2; - $p->description = $description; - $p->number_portion = $numberPortion; - $p->type_portion = $typePortion; + $p->name = $name; + $p->slug = $slug; + $p->seo_title = $seo_title; + $p->seo_description = $seo_description; + $p->tags = $tags; + $p->subtitle = $subtitle; + $p->info1 = $info1; + $p->info2 = $info2; + $p->description = $description; + $p->number_portion = $numberPortion; + $p->type_portion = $typePortion; $p->theoretical_average_weight = $theoreticalAverageWeight; - $p->other_format = $otherFormat; - $p->range_id = $rangeId; - $p->sub_range_id = $request->sub_range_id ?: null; - $p->meat_type_id = $meatTypeId; - $p->consumption_times_id = $consumptionTimesId; - $p->label_id = $labelId; - $p->preparation_advice = $preparationAdvice; - $p->ingredients = $ingredients; - $p->tips = $tips; + $p->other_format = $otherFormat; + $p->range_id = $rangeId; + $p->sub_range_id = $request->sub_range_id ?: null; + $p->meat_type_id = $meatTypeId; + $p->consumption_times_id = $consumptionTimesId; + $p->label_id = $labelId; + $p->preparation_advice = $preparationAdvice; + $p->ingredients = $ingredients; + $p->tips = $tips; if (!empty($recipeId)) { $p->recipe_id = $recipeId; } - $p->video_link = $videoLink; - $p->status = $status; - $p->order = $this->getLastOrder(); - $p->star = 0; - $p->show_rsm = 0; + $p->video_link = $videoLink; + $p->status = $status; + $p->order = $this->getLastOrder(); + $p->star = 0; + $p->show_rsm = 0; $p->xml_inco_id = $request->xml_inco; $p->saveOrFail(); @@ -170,19 +170,19 @@ class ProductsController extends Controller public function edit(Products $p) { // Limitation aux champs dont on a besoin sur certaines requêtes pour ne pas surcharger ces dernières - $pictograms = ProductPictograms::all(); + $pictograms = ProductPictograms::all(); $pictosDatas = []; foreach ($pictograms as $picto) { $pictosDatas[] = ['id' => $picto->id, 'src' => '/' . \ltrim($picto->picture, '/\\'), 'alt' => $picto->name]; } - $subranges = SubRange::all(); - $ranges = Range::select('id', 'name')->with('subranges')->get(); - $meatTypes = MeatTypes::all(); - $labels = Label::all(); + $subranges = SubRange::all(); + $ranges = Range::select('id', 'name')->with('subranges')->get(); + $meatTypes = MeatTypes::all(); + $labels = Label::all(); $consumptionTimes = ConsumptionTimes::select('id', 'name')->get(); - $recipes = Recipes::select('id', 'title')->get(); - $pictosSelected = []; + $recipes = Recipes::select('id', 'title')->get(); + $pictosSelected = []; foreach ($p->pictograms as $pictoSelected) { $pictosSelected[] = [ 'id' => $pictoSelected->id, @@ -206,33 +206,33 @@ class ProductsController extends Controller public function update(UpdateProductRequest $request, Products $p) { - $name = $request->name; - $slug = Str::slug($name); - $seo_description = $request->seo_description; - $seo_title = $request->seo_title; - $picture = $request->picture; - $tags = $request->tags; - $subtitle = $request->subtitle; - $info1 = $request->info1; - $info2 = $request->info2; - $description = $request->description; - $numberPortion = intval($request->number_portion); - $typePortion = $request->type_portion; + $name = $request->name; + $slug = Str::slug($name); + $seo_description = $request->seo_description; + $seo_title = $request->seo_title; + $picture = $request->picture; + $tags = $request->tags; + $subtitle = $request->subtitle; + $info1 = $request->info1; + $info2 = $request->info2; + $description = $request->description; + $numberPortion = intval($request->number_portion); + $typePortion = $request->type_portion; $theoreticalAverageWeight = $request->theoretical_average_weight; - $otherFormat = $request->other_format; - $rangeId = $request->range_id; - $meatTypeId = $request->meat_type_id; - $consumptionTimesId = $request->consumption_times_id; - $labelId = (\is_string($request->label_id) and \strlen($request->label_id)) ? $request->label_id : null; - $preparationAdvice = $request->preparation_advice; - $ingredients = $request->ingredients; - $tips = $request->tips; - $recipeId = $request->recipe_id; - $videoLink = $request->video_link; - $pictureVideo = $request->picture_video; - $status = $request->status === null ? 0 : 1; - $show_rsm = $request->show_rsm === null ? 0 : 1; - $pictos = json_decode($request->pictos); + $otherFormat = $request->other_format; + $rangeId = $request->range_id; + $meatTypeId = $request->meat_type_id; + $consumptionTimesId = $request->consumption_times_id; + $labelId = (\is_string($request->label_id) and \strlen($request->label_id)) ? $request->label_id : null; + $preparationAdvice = $request->preparation_advice; + $ingredients = $request->ingredients; + $tips = $request->tips; + $recipeId = $request->recipe_id; + $videoLink = $request->video_link; + $pictureVideo = $request->picture_video; + $status = $request->status === null ? 0 : 1; + $show_rsm = $request->show_rsm === null ? 0 : 1; + $pictos = json_decode($request->pictos); $this->storeUploadedImage($request, $p, 'picture'); $this->storeUploadedImage($request, $p, 'pictureVideo'); @@ -251,33 +251,33 @@ class ProductsController extends Controller } $p->pictograms()->sync($pictosIds); - $p->name = $name; - $p->slug = $slug; - $p->tags = $tags; - $p->subtitle = $subtitle; - $p->seo_title = $seo_title; - $p->seo_description = $seo_description; - $p->info1 = $info1; - $p->info2 = $info2; - $p->description = $description; - $p->number_portion = $numberPortion; - $p->type_portion = $typePortion; + $p->name = $name; + $p->slug = $slug; + $p->tags = $tags; + $p->subtitle = $subtitle; + $p->seo_title = $seo_title; + $p->seo_description = $seo_description; + $p->info1 = $info1; + $p->info2 = $info2; + $p->description = $description; + $p->number_portion = $numberPortion; + $p->type_portion = $typePortion; $p->theoretical_average_weight = $theoreticalAverageWeight; - $p->other_format = $otherFormat; - $p->range_id = $rangeId; - $p->sub_range_id = $request->sub_range_id ?: null; - $p->meat_type_id = $meatTypeId; - $p->consumption_times_id = $consumptionTimesId; - $p->label_id = $labelId; - $p->preparation_advice = $preparationAdvice; - $p->ingredients = $ingredients; - $p->tips = $tips; + $p->other_format = $otherFormat; + $p->range_id = $rangeId; + $p->sub_range_id = $request->sub_range_id ?: null; + $p->meat_type_id = $meatTypeId; + $p->consumption_times_id = $consumptionTimesId; + $p->label_id = $labelId; + $p->preparation_advice = $preparationAdvice; + $p->ingredients = $ingredients; + $p->tips = $tips; if (!empty($recipeId)) { $p->recipe_id = $recipeId; } $p->video_link = $videoLink; - $p->show_rsm = $show_rsm; - $p->status = $status; + $p->show_rsm = $show_rsm; + $p->status = $status; $p->saveOrFail(); return redirect()->route('bo.products.edit', $p->id)->with('success', 'Enregistré !'); @@ -316,9 +316,9 @@ class ProductsController extends Controller $q->whereId($target->id); }); } - $tmp = $tmp->firstOrFail(); - $newOrder = $tmp->order; - $tmp->order = $product->order; + $tmp = $tmp->firstOrFail(); + $newOrder = $tmp->order; + $tmp->order = $product->order; $product->order = $newOrder; if (!$product->save() or !$tmp->save()) { throw new \ErrorException("Error Processing Request", 1); @@ -328,7 +328,7 @@ class ProductsController extends Controller Session::flash('error', trans('Erreur lors de la modification de l\'ordre :message', [ 'message' => $e->getMessage() ])); - } + }//end try return redirect()->back(); } @@ -375,7 +375,7 @@ class ProductsController extends Controller if (File::exists(storage_path($product->xmlInco->picture))) { $this->removeUploadedImage($product, 'picture'); - $ext = pathinfo($product->xmlInco->picture, PATHINFO_EXTENSION); + $ext = pathinfo($product->xmlInco->picture, PATHINFO_EXTENSION); $imageName = $product->slug . '-le-gaulois.' . $ext; $file = new UploadedFile(storage_path($product->xmlInco->picture), $imageName); diff --git a/app/Http/Controllers/Bo/RangeController.php b/app/Http/Controllers/Bo/RangeController.php index 34a46d31..b8e5db29 100644 --- a/app/Http/Controllers/Bo/RangeController.php +++ b/app/Http/Controllers/Bo/RangeController.php @@ -39,8 +39,8 @@ class RangeController extends Controller public function edit(Range $range) { $productSubRanges = $range->subRanges()->orderBy('order')->get(); - $subranges = SubRange::whereNotIn('id', $productSubRanges->pluck('id'))->get(); - $products = Products::where('range_id', $range->id)->get(); + $subranges = SubRange::whereNotIn('id', $productSubRanges->pluck('id'))->get(); + $products = Products::where('range_id', $range->id)->get(); return view('bo.ranges.edit', compact('range', 'products', 'subranges', 'productSubRanges')); } @@ -105,16 +105,16 @@ class RangeController extends Controller { $current = Range::findOrFail($id); if ($action === 'up') { - $tmp = Range::where('order', '<', $current->order) + $tmp = Range::where('order', '<', $current->order) ->orderBy('order', 'DESC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; + $newOrder = $tmp->order; + $tmp->order = $current->order; $current->order = $newOrder; } else { - $tmp = Range::where('order', '>', $current->order) + $tmp = Range::where('order', '>', $current->order) ->orderBy('order', 'ASC')->first(); - $newOrder = $tmp->order; - $tmp->order = $current->order; + $newOrder = $tmp->order; + $tmp->order = $current->order; $current->order = $newOrder; } $tmp->save(); diff --git a/app/Http/Controllers/Bo/RecipesController.php b/app/Http/Controllers/Bo/RecipesController.php index 63cf0d88..2bde618b 100644 --- a/app/Http/Controllers/Bo/RecipesController.php +++ b/app/Http/Controllers/Bo/RecipesController.php @@ -47,7 +47,7 @@ class RecipesController extends Controller $r = $r->orderBy('ranges.name', $request->sort_way); } $searchFields = trans('Titre, Description, Ingredient, Préparation, Conseils'); - $r = $r->paginate(); + $r = $r->paginate(); return view('bo.recipes.index', compact('r', 'searchFields')); } @@ -68,7 +68,7 @@ class RecipesController extends Controller if ($request->associated_product2) { $associatedP[] = intval($request->associated_product2); } - $r = new Recipes($request->validated()); + $r = new Recipes($request->validated()); $imageName = Str::slug($r->title) . '.' . $request->picture->extension(); $request->picture->move( public_path('uploads/images/recettes/' . date('Y') . '/' . date('m') . '/'), @@ -95,9 +95,9 @@ class RecipesController extends Controller public function edit(Recipes $r) { - $c = ConsumptionTimes::all(); - $p = Products::with(['recipes', 'consumptionTimes'])->get(); - $a = Articles::where('type', ArticleCategory::actu())->get(); + $c = ConsumptionTimes::all(); + $p = Products::with(['recipes', 'consumptionTimes'])->get(); + $a = Articles::where('type', ArticleCategory::actu())->get(); $raIds = []; foreach ($r->articles as $recipe_article) { $raIds[] = $recipe_article->id; diff --git a/app/Http/Controllers/Bo/ReductionsController.php b/app/Http/Controllers/Bo/ReductionsController.php index 401b28de..022fb106 100644 --- a/app/Http/Controllers/Bo/ReductionsController.php +++ b/app/Http/Controllers/Bo/ReductionsController.php @@ -16,16 +16,16 @@ class ReductionsController extends Controller public function index() { - $r = Reduction::paginate(); + $r = Reduction::paginate(); $ranges = Range::with('products')->get(); return view('bo.reductions.index', compact('r', 'ranges')); } public function saveDatas(UpdateReductionRequest $request) { - $reductionId = $request->reductionId; - $products = $request->products; - $ranges = $request->ranges; + $reductionId = $request->reductionId; + $products = $request->products; + $ranges = $request->ranges; $notification = $request->notification === null ? 0 : 1; $reduction = Reduction::find($reductionId); diff --git a/app/Http/Controllers/Bo/TagController.php b/app/Http/Controllers/Bo/TagController.php index c2324f0a..b7d79420 100644 --- a/app/Http/Controllers/Bo/TagController.php +++ b/app/Http/Controllers/Bo/TagController.php @@ -10,7 +10,6 @@ use Illuminate\Http\Request; class TagController extends Controller { - public function __construct() { $this->authorizeResource(Tag::class, 'tag'); @@ -27,8 +26,8 @@ class TagController extends Controller ); } $searchFields = trans('Tag'); - $tags = $this->sortQuery($tags, []); - $tags = $tags->paginate(); + $tags = $this->sortQuery($tags, []); + $tags = $tags->paginate(); return view('bo.tags.index', \compact('tags', 'searchFields')); } diff --git a/app/Http/Controllers/Bo/TraceabilityController.php b/app/Http/Controllers/Bo/TraceabilityController.php index e3d0fff7..c1fcd190 100644 --- a/app/Http/Controllers/Bo/TraceabilityController.php +++ b/app/Http/Controllers/Bo/TraceabilityController.php @@ -9,7 +9,6 @@ use Carbon\Carbon; class TraceabilityController extends Controller { - private $responseType = [ 1 => "Produit trouvé", 2 => "Produit non trouvé", @@ -20,10 +19,10 @@ class TraceabilityController extends Controller public function index() { - $t = Traceability::orderBy('created_at', 'DESC')->paginate(40); - $c = $this->countRequest(); + $t = Traceability::orderBy('created_at', 'DESC')->paginate(40); + $c = $this->countRequest(); $dateDebut = null; - $dateFin = null; + $dateFin = null; return view( 'bo.traceability.index', compact('t', 'c', 'dateDebut', 'dateFin') @@ -32,10 +31,10 @@ class TraceabilityController extends Controller public function filter(Request $request) { - $dateDebut = $request->date_debut; - $dateFin = $request->date_fin; + $dateDebut = $request->date_debut; + $dateFin = $request->date_fin; $cDateDebut = null; - $cDateFin = null; + $cDateFin = null; if ($dateDebut !== null) { $cDateDebut = Carbon::createFromFormat('Y-m-d', $dateDebut); diff --git a/app/Http/Controllers/Bo/UploadController.php b/app/Http/Controllers/Bo/UploadController.php index b8bea07f..19161e39 100644 --- a/app/Http/Controllers/Bo/UploadController.php +++ b/app/Http/Controllers/Bo/UploadController.php @@ -10,7 +10,7 @@ class UploadController extends Controller public function uploadFile(UploadFileRequest $request) { /** @var \Illuminate\Http\UploadedFile $image */ - $image = $request->upload; + $image = $request->upload; $newPath = $this->prepareMoveFile($image->getClientOriginalName(), 'uploads'); $newPath = str_replace(storage_path('app'), '', $newPath); $image->storePubliclyAs(pathinfo($newPath, \PATHINFO_DIRNAME), pathinfo($newPath, \PATHINFO_BASENAME)); diff --git a/app/Http/Controllers/Bo/UsersController.php b/app/Http/Controllers/Bo/UsersController.php index cc5de833..7333729c 100644 --- a/app/Http/Controllers/Bo/UsersController.php +++ b/app/Http/Controllers/Bo/UsersController.php @@ -24,17 +24,17 @@ class UsersController extends Controller public function store(Request $request) { $firstname = $request->firstname; - $lastname = $request->lastname; - $email = $request->email; - $pwd = $request->password; - $role = $request->role; + $lastname = $request->lastname; + $email = $request->email; + $pwd = $request->password; + $role = $request->role; - $user = new User(); + $user = new User(); $user->firstname = $firstname; - $user->lastname = $lastname; - $user->email = $email; - $user->password = Hash::make($pwd); - $user->role = $role; + $user->lastname = $lastname; + $user->email = $email; + $user->password = Hash::make($pwd); + $user->role = $role; $user->save(); return redirect()->route('bo.users.index'); } @@ -48,15 +48,15 @@ class UsersController extends Controller public function update(Request $request, $id) { $firstname = $request->firstname; - $lastname = $request->lastname; - $email = $request->email; - $pwd = $request->password; - $role = $request->role; + $lastname = $request->lastname; + $email = $request->email; + $pwd = $request->password; + $role = $request->role; - $user = User::findOrFail($id); + $user = User::findOrFail($id); $user->firstname = $firstname; - $user->lastname = $lastname; - $user->email = $email; + $user->lastname = $lastname; + $user->email = $email; if (!empty($pwd)) { $user->password = Hash::make($pwd); } @@ -69,7 +69,7 @@ class UsersController extends Controller /** * Remove the specified resource from storage. * - * @param int $id + * @param integer $id * @return \Illuminate\Http\Response */ public function destroy($id) diff --git a/app/Http/Controllers/BourseController.php b/app/Http/Controllers/BourseController.php index 4c102cd7..05bf30af 100644 --- a/app/Http/Controllers/BourseController.php +++ b/app/Http/Controllers/BourseController.php @@ -53,9 +53,9 @@ class BourseController extends Controller public function bourseSearch(SearchCustomerCollectionRequest $request, DepartaimantCollectionType $type) { - $output = collect(); - $state = DepartaimantStatus::make((int)$request->state); - $pseudo = $request->pseudo; + $output = collect(); + $state = DepartaimantStatus::make((int)$request->state); + $pseudo = $request->pseudo; $departaimant = str_replace(['-', ' ', '\''], '', strtolower($request->departaimant ?? '')); $departaimant = Utils::replaceSpecChar($departaimant); @@ -71,12 +71,12 @@ class BourseController extends Controller } /** @var \App\Models\Customers */ - $customer = Auth::guard('customer')->user(); - $ids = collect(BlockList::select('customer_id', 'blocked_id') + $customer = Auth::guard('customer')->user(); + $ids = collect(BlockList::select('customer_id', 'blocked_id') ->where('customer_id', $customer->id) ->orWhere('blocked_id', $customer->id)->get()->toArray()); - $ids = $ids->flatten()->unique()->all(); - $userDep = $customer->departaimantsCollections()->where('type', $type->value)->first(); + $ids = $ids->flatten()->unique()->all(); + $userDep = $customer->departaimantsCollections()->where('type', $type->value)->first(); $userDepStatus = []; foreach ($userDep->getAllDepartaimants() as $dep) { if ($dep->status->value === $state->value) { @@ -127,8 +127,8 @@ class BourseController extends Controller 'date' => (new NiceDate())->get(null, '', $depCollection->updated_at, []) ]); } - } - } + }//end foreach + }//end foreach $output->sortBy('date'); diff --git a/app/Http/Controllers/BoutiqueController.php b/app/Http/Controllers/BoutiqueController.php index ff0386db..63401ce3 100644 --- a/app/Http/Controllers/BoutiqueController.php +++ b/app/Http/Controllers/BoutiqueController.php @@ -41,11 +41,11 @@ class BoutiqueController extends Controller */ public function validateBuy(BoutiqueBuyRequest $request) { - $items = []; + $items = []; $orderTotalPrice = 0; foreach ($request->cart as $item) { - $sellItem = SellItem::where('id', $item['item']['id'])->firstOrFail(); - $items[] = [ + $sellItem = SellItem::where('id', $item['item']['id'])->firstOrFail(); + $items[] = [ 'id' => $sellItem->id, 'name' => $sellItem->name, 'quantity' => $item['count'], @@ -58,10 +58,10 @@ class BoutiqueController extends Controller // Pseudo mutex let database fail (unique ref) to check if order has already been processed try { - $order = new Order(); - $order->ref = str_replace('-', '', $request->ref); + $order = new Order(); + $order->ref = str_replace('-', '', $request->ref); $order->payementType = OrderType::make((int)$request->payementMethod); - $order->status = OrderStatus::waiting(); + $order->status = OrderStatus::waiting(); $order->fill($request->coords); $order->saveOrFail(); } catch (QueryException $e) { @@ -79,7 +79,7 @@ class BoutiqueController extends Controller )]); } abort(500, sprintf('Order already exists but type is unkown %d', $order->id)); - } + }//end try /** @var \App\Models\Customers */ $customer = auth('customer')->user(); @@ -120,10 +120,11 @@ class BoutiqueController extends Controller } finally { return response()->json(['redirect' => route('club.boutique.validated', compact('order'))]); } - break; // not used + break; +// not used default: abort(422); - } + }//end switch } /** @@ -204,7 +205,7 @@ class BoutiqueController extends Controller 'Un handled response from Mercanet Lib %s', json_encode($payment) )); - } + }//end switch } catch (ModelNotFoundException | CBPayementError $e) { report($e); Log::critical(sprintf( @@ -213,12 +214,12 @@ class BoutiqueController extends Controller $e->getMessage() )); return view('front.club.boutique.error'); - } + }//end try } /** - ** Pas de validate ou custom request sur la réponse de mercanet, - ** c'est la Lib mercanet qui fait + * * Pas de validate ou custom request sur la réponse de mercanet, + * * c'est la Lib mercanet qui fait */ public function confirmCbFromMercanet(Request $request, Order $order) { @@ -265,7 +266,8 @@ class BoutiqueController extends Controller $ref, json_encode($returnDatas) )); - default: // ERROR + default: +// ERROR if ( !$order->confirmMailSent and !$order->status->equals(OrderStatus::payed()) @@ -279,7 +281,7 @@ class BoutiqueController extends Controller $ref, json_encode($returnDatas) )); - } + }//end switch } catch (ModelNotFoundException | CBPayementError | \Exception $e) { report($e); Log::critical(sprintf( @@ -289,16 +291,16 @@ class BoutiqueController extends Controller )); } finally { return response('', 200); - } + }//end try } /** * - ** Pas de validate ou custom request sur la réponse de mercanet, - ** c'est la Lib mercanet qui fait + * * Pas de validate ou custom request sur la réponse de mercanet, + * * c'est la Lib mercanet qui fait * * @param Request $request - * @param Order $order + * @param Order $order * @return void */ public function confirmCb(Request $request, Order $order) @@ -330,7 +332,7 @@ class BoutiqueController extends Controller // phpcs:ignore PSR2.ControlStructures.SwitchDeclaration.TerminatingComment case PaymentResponse::ok(): try { - $status = $order->status; + $status = $order->status; $order->status = OrderStatus::payed(); $order->saveOrFail(); @@ -374,7 +376,7 @@ class BoutiqueController extends Controller 'Un handled response from Mercanet Lib %s', json_encode($returnDatas) )); - } + }//end switch } catch (ModelNotFoundException | CBPayementError $e) { report($e); Log::critical(sprintf( @@ -383,7 +385,7 @@ class BoutiqueController extends Controller $e->getMessage() )); return view('front.club.boutique.error'); - } + }//end try } /** @@ -408,14 +410,14 @@ class BoutiqueController extends Controller */ private function getMercanetData(Request $request): array { - $formDatas = []; + $formDatas = []; $returnDatas = explode("|", $request->post('Data')); foreach ($returnDatas as $item) { - $tmp = explode("=", $item); + $tmp = explode("=", $item); $formDatas[$tmp[0]] = $tmp[1]; } - $ref = $formDatas['transactionReference']; + $ref = $formDatas['transactionReference']; $responseCode = $formDatas['responseCode']; return compact('ref', 'responseCode', 'returnDatas'); } diff --git a/app/Http/Controllers/ClubController.php b/app/Http/Controllers/ClubController.php index 449a21b8..c2163708 100644 --- a/app/Http/Controllers/ClubController.php +++ b/app/Http/Controllers/ClubController.php @@ -55,7 +55,7 @@ class ClubController extends Controller { self::getNotifications(); - $articles = Articles::where('status', 1)->orderBy('updated_at', 'DESC')->get(); + $articles = Articles::where('status', 1)->orderBy('updated_at', 'DESC')->get(); $categories = Articles::select('type')->where('status', true)->groupBy('type')->get()->pluck('type'); $montantReduction = Reduction::whereStatus(true)->sum('value'); @@ -198,7 +198,7 @@ class ClubController extends Controller { self::getNotifications(); /** @var \App\Models\Customers */ - $customer = auth('customer')->user(); + $customer = auth('customer')->user(); $notificationsIds = $customer->getAllNotifications() ->pluck('id')->toArray(); // Handle multiple access to this critical part @@ -247,7 +247,7 @@ class ClubController extends Controller $customer = Auth::guard('customer')->user(); /** @var \LDC\LDCCRM\Models\Customer */ $crmCustomer = $customer->apiData; - $murBr = []; + $murBr = []; $mesBR->updateCustomer( $crmCustomer->hashcode, @@ -272,7 +272,7 @@ class ClubController extends Controller /** @var \App\Lib\MesBR */ $mesBR = app('mesBR'); /** @var \App\Models\Customers $customer */ - $customer = Auth::guard('customer')->user(); + $customer = Auth::guard('customer')->user(); $crmCustomer = $customer->apiData; if ($crmCustomer->status === "KO") { throw new Exception( @@ -315,7 +315,7 @@ class ClubController extends Controller if (Auth::guard('customer')->check()) { $answersIds = $publishedArticle->answers()->pluck('id')->toArray(); /** @var \App\Models\Customers */ - $customer = Auth::guard('customer')->user(); + $customer = Auth::guard('customer')->user(); $alreadyAnswered = $customer->surveysAnswers() ->whereIn('surveys_answer_id', $answersIds)->count() > 0 ? true : false; } @@ -362,10 +362,10 @@ class ClubController extends Controller { self::getNotifications(); /** @var \App\Models\Customers */ - $customer = Auth::guard('customer')->user(); + $customer = Auth::guard('customer')->user(); $conversations = $customer->conversations(); - $ids = collect($conversations)->pluck('to_id'); - $blockList = BlockList::where('customer_id', $customer->id) + $ids = collect($conversations)->pluck('to_id'); + $blockList = BlockList::where('customer_id', $customer->id) ->whereIn('blocked_id', $ids)->get(); return view('front.club.messages', compact('conversations', 'blockList')); } @@ -389,10 +389,10 @@ class ClubController extends Controller ) { return response()->json(-2); } - $message = new Message($request->all()); - $message->to = $customer->id; + $message = new Message($request->all()); + $message->to = $customer->id; $message->from = Auth::guard('customer')->user()->id; - $censor = new CensorWords(); + $censor = new CensorWords(); try { $censor->setDictionary(['en-us', 'en-uk', config('app.locale')]); } catch (RuntimeException $e) { @@ -416,8 +416,8 @@ class ClubController extends Controller public function deleteMessage(DeleteMessagesRequest $request) { /** @var \App\Models\Customers */ - $customer = Auth::guard('customer')->user(); - $message = Message::findOrFail($request->message); + $customer = Auth::guard('customer')->user(); + $message = Message::findOrFail($request->message); $conversations = (object)$customer->conversations(); foreach ($conversations as $conversation) { $conversation = (object)$conversation; @@ -445,9 +445,9 @@ class ClubController extends Controller public function blockCustomer(BlockCustomerRequest $request, bool $status) { /** @var \App\Models\Customers */ - $customer = Auth::guard('customer')->user(); + $customer = Auth::guard('customer')->user(); $customerToBlock = Customers::where('username', $request->username)->firstOrFail(); - $blockCustomer = BlockList::firstOrNew([ + $blockCustomer = BlockList::firstOrNew([ 'customer_id' => $customer->id, 'blocked_id' => $customerToBlock->id, ]); @@ -465,7 +465,7 @@ class ClubController extends Controller return; } /** @var \App\Models\Customers */ - $customer = Auth::guard('customer')->user(); + $customer = Auth::guard('customer')->user(); $notifications = $customer->getAllNotifications(); View::share('notifications', count($notifications) - $customer->readNotifications()->count()); View::share('notificationsList', $notifications); diff --git a/app/Http/Controllers/ContactController.php b/app/Http/Controllers/ContactController.php index 807232d9..f6bcfe10 100644 --- a/app/Http/Controllers/ContactController.php +++ b/app/Http/Controllers/ContactController.php @@ -17,9 +17,9 @@ class ContactController extends Controller { public function contact(Request $request, ContactFormType $type = null) { - $user = null; - $status = $request->session()->get('status'); - $type = $type ?? ContactFormType::none(); + $user = null; + $status = $request->session()->get('status'); + $type = $type ?? ContactFormType::none(); $username = $request->username ?? ''; return view('front.contact.contact', compact('type', 'user', 'status', 'username')); } diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 380896b7..bee183e2 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -45,8 +45,8 @@ class Controller extends BaseController /** * Undocumented function * - * @param Builder $query The eloquent query builder - * @param string $search The query string + * @param Builder $query The eloquent query builder + * @param string $search The query string * @param string|array ...$field Either a simple array or a string * In case of a string the two fields would be concatenate to make the search * @return Builder @@ -81,7 +81,7 @@ class Controller extends BaseController * Sort columns with a query * * @param Builder $query - * @param array $ignore + * @param array $ignore * @return Builder */ protected function sortQuery(Builder $query, array $ignore = []): Builder @@ -118,8 +118,8 @@ class Controller extends BaseController * and put into model the image path * * @param Request $request - * @param Model $model - * @param string $attribute + * @param Model $model + * @param string $attribute * @return void * @throws Illuminate\Validation\ValidationException if save failed */ @@ -129,7 +129,7 @@ class Controller extends BaseController // try delete old file $this->removeUploadedImage($model, $attribute); /** @var \Illuminate\Http\UploadedFile $image */ - $image = $request->{$attribute}; + $image = $request->{$attribute}; $newPath = $this->prepareMoveFile($image->getClientOriginalName(), $model->getTable()); $newPath = str_replace(storage_path('app'), '', $newPath); // phpcs:ignore Generic.Files.LineLength.TooLong diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php index 1fac086e..68bde9e2 100644 --- a/app/Http/Controllers/CustomerController.php +++ b/app/Http/Controllers/CustomerController.php @@ -16,27 +16,25 @@ use LDC\LDCCRM\Models\Customer; class CustomerController extends Controller { - public function unscribeNewsletter(Request $request) { $message = null; // TODO: handle single optin avec hashcode // try { - // if ($request->hashcode) { - // SingleOptin::setStatus($request->email, true); - // $message = trans('Votre désinscription à la newsletter a été prise en compte'); - // } - // } catch (ApiErrorException $e) { - // if (!$e->getApiError()->equals(ApiError::singleOptinCustomerExists())) { - // Utils::sendEmailErrorManually($e); - // $message = trans('Une erreur est survenue, merci de réessayer ultérieurement'); - // } - // } catch (CrmException $e) { - // Utils::sendEmailErrorManually($e); - // $message = trans('Une erreur est survenue, merci de réessayer ultérieurement'); + // if ($request->hashcode) { + // SingleOptin::setStatus($request->email, true); + // $message = trans('Votre désinscription à la newsletter a été prise en compte'); + // } + // } catch (ApiErrorException $e) { + // if (!$e->getApiError()->equals(ApiError::singleOptinCustomerExists())) { + // Utils::sendEmailErrorManually($e); + // $message = trans('Une erreur est survenue, merci de réessayer ultérieurement'); + // } + // } catch (CrmException $e) { + // Utils::sendEmailErrorManually($e); + // $message = trans('Une erreur est survenue, merci de réessayer ultérieurement'); // } - try { if ($request->hashcode and ($customer = Customer::find($request->hashcode))) { $customer->opt_in = false; @@ -57,7 +55,7 @@ class CustomerController extends Controller } catch (CrmException $e) { Utils::sendEmailErrorManually($e); $message = trans('Une erreur est survenue, merci de réessayer ultérieurement'); - } + }//end try if (!$message) { $message = trans('Le lien de déinscription est invalide'); diff --git a/app/Http/Controllers/FaqController.php b/app/Http/Controllers/FaqController.php index 3351e002..4df0e2aa 100644 --- a/app/Http/Controllers/FaqController.php +++ b/app/Http/Controllers/FaqController.php @@ -24,7 +24,7 @@ class FaqController extends Controller */ public function index() { - return view('front.faq.index', [ + return view('front.faq.index', [ 'themes' => FaqThemes::with(['questions' => function ($q) { return $q->select('faq_questions.*') ->selectRaw( @@ -36,7 +36,7 @@ class FaqController extends Controller public function updateSatisfactionStat(UpdateStatisfationStatRequest $request, FaqQuestions $question) { - $opinion = (bool)$request->opinion; + $opinion = (bool)$request->opinion; $sessionKey = sprintf('faq.questions.%d', $question->id); if (!session()->has($sessionKey)) { session()->put($sessionKey, true); diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 1da5fbe1..c6a8e95d 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -48,8 +48,8 @@ class HomeController extends Controller /** * Call the CRM to add a single optin - * @param String $email Email to add as a single optin - * @return String Message to print to the customer + * @param string $email Email to add as a single optin + * @return string Message to print to the customer */ public function addOptIn(SingleOptinRequest $request) { diff --git a/app/Http/Controllers/MomentsController.php b/app/Http/Controllers/MomentsController.php index 5e1e28e4..b02409e1 100644 --- a/app/Http/Controllers/MomentsController.php +++ b/app/Http/Controllers/MomentsController.php @@ -18,7 +18,7 @@ class MomentsController extends Controller ['slug', '<>', $moment->slug], ['status', 1] ])->inRandomOrder()->limit(2)->get(); - $featuredIds = array_unique(explode(';', $moment->featured_ids)); + $featuredIds = array_unique(explode(';', $moment->featured_ids)); $featuredObjects = []; switch ($moment->featured_type) { diff --git a/app/Http/Controllers/OCBController.php b/app/Http/Controllers/OCBController.php index 9897f7ea..ca30799a 100644 --- a/app/Http/Controllers/OCBController.php +++ b/app/Http/Controllers/OCBController.php @@ -57,7 +57,7 @@ class OCBController extends Controller ->where('status', true) ->orderBy('order') ->get(); - $breeder = OCBBreeder::ocbValidated()->where('status', true) + $breeder = OCBBreeder::ocbValidated()->where('status', true) ->inRandomOrder()->first(); return view('front.ocb.poultry', compact('breeder', 'ocbContents')); } diff --git a/app/Http/Controllers/OnePageController.php b/app/Http/Controllers/OnePageController.php index 1188de64..483ee57c 100644 --- a/app/Http/Controllers/OnePageController.php +++ b/app/Http/Controllers/OnePageController.php @@ -13,7 +13,7 @@ class OnePageController extends Controller app()->setLocale('nl'); $type = ContactFormType::onepage(); $user = null; - $ads = Ads::where('status', true)->orderBy('updated_at', 'DESC')->limit(3)->get(); + $ads = Ads::where('status', true)->orderBy('updated_at', 'DESC')->limit(3)->get(); return view('front.onepage.index', compact('ads', 'type', 'user')); } } diff --git a/app/Http/Controllers/ProductsController.php b/app/Http/Controllers/ProductsController.php index a903c386..f3e5b767 100644 --- a/app/Http/Controllers/ProductsController.php +++ b/app/Http/Controllers/ProductsController.php @@ -19,10 +19,10 @@ class ProductsController extends Controller public function index() { $productsSlides = ProductSliderPictures::where('status', 1)->orderBy('order', 'ASC')->get(); - $meatTypes = MeatTypes::select('name', 'slug')->where('status', 1)->get(); - $ct = ConsumptionTimes::select('name', 'slug')->where('status', 1)->get(); - $labels = Label::select('name', 'slug')->where('status', 1)->get(); - $ranges = Range::where('status', 1)->with('products', function ($q) { + $meatTypes = MeatTypes::select('name', 'slug')->where('status', 1)->get(); + $ct = ConsumptionTimes::select('name', 'slug')->where('status', 1)->get(); + $labels = Label::select('name', 'slug')->where('status', 1)->get(); + $ranges = Range::where('status', 1)->with('products', function ($q) { $q->select(['id', 'range_id', 'picture']) ->whereStatus(true)->whereStar(true); })->get(); @@ -34,26 +34,26 @@ class ProductsController extends Controller { // On récupère les mêmes données qu'au dessus pour l'affichage $productsSlides = ProductSliderPictures::where('status', 1)->orderBy('order', 'ASC')->get(); - $ranges = Range::where('status', 1)->get(); - $meatTypes = MeatTypes::select('name', 'slug')->where('status', 1)->get(); - $ct = ConsumptionTimes::select('name', 'slug')->where('status', 1)->get(); - $labels = Label::select('name', 'slug')->where('status', 1)->get(); + $ranges = Range::where('status', 1)->get(); + $meatTypes = MeatTypes::select('name', 'slug')->where('status', 1)->get(); + $ct = ConsumptionTimes::select('name', 'slug')->where('status', 1)->get(); + $labels = Label::select('name', 'slug')->where('status', 1)->get(); - $type = explode('/', Route::getCurrentRoute()->uri)[1]; + $type = explode('/', Route::getCurrentRoute()->uri)[1]; $productsList = null; - $title = null; - $gamme = false; - $typeViande = false; - $momentConso = false; - $subranges = false; + $title = null; + $gamme = false; + $typeViande = false; + $momentConso = false; + $subranges = false; switch ($type) { case 'gamme': /** @var \App\Models\Range */ - $gamme = $model; + $gamme = $model; $subranges = $gamme->subranges()->orderBy('order')->get(); if ($subrange) { - $title = $gamme->name; + $title = $gamme->name; $productsList = $gamme->products() ->where('status', true) ->where('sub_range_id', $subrange->id) @@ -61,34 +61,34 @@ class ProductsController extends Controller ->get(); } else { $productsList = $gamme->products->where('status', 1)->sortBy('order'); - $title = $gamme->name; + $title = $gamme->name; } break; case 'type-viande': /** @var \App\Models\MeatTypes */ - $meatType = $model; + $meatType = $model; $productsList = $meatType->products->where('status', 1)->sortBy('order'); - $title = $meatType->name; - $typeViande = true; + $title = $meatType->name; + $typeViande = true; break; case 'moment-consommations': /** @var \App\Models\ConsumptionTimes */ $consumptionTime = $model; - $productsList = $consumptionTime->products->where('status', 1)->sortBy('order'); - $title = $consumptionTime->name; - $momentConso = true; + $productsList = $consumptionTime->products->where('status', 1)->sortBy('order'); + $title = $consumptionTime->name; + $momentConso = true; break; case 'label': /** @var \App\Models\Label */ - $label = $model; + $label = $model; $productsList = $label->products->where('status', 1)->sortBy('order'); - $title = $label->name; - $momentConso = true; + $title = $label->name; + $momentConso = true; break; default: abort(404); break; - } + }//end switch return view('front.products.index', compact( 'productsList', @@ -111,14 +111,14 @@ class ProductsController extends Controller $recipeVideo = $product->recipe()->first(); $recipes = $product->recipes()->get(); - $ids = []; + $ids = []; foreach ($recipes as $r) { $ids[] = $r->id; } - $ids = array_unique($ids); + $ids = array_unique($ids); $generalConfig = app()->view->getShared()['GeneralConfigGlobal'] ?? null; $generalConfig = $generalConfig ? $generalConfig->where('type', GeneralConfigType::rsm())->first() : null; - $recipes = Recipes::whereIn('id', $ids)->where('status', true)->get(); + $recipes = Recipes::whereIn('id', $ids)->where('status', true)->get(); return view('front.products.product', compact('product', 'recipes', 'recipeVideo', 'generalConfig')); } diff --git a/app/Http/Controllers/RecipesController.php b/app/Http/Controllers/RecipesController.php index d9c4f817..0efe1552 100644 --- a/app/Http/Controllers/RecipesController.php +++ b/app/Http/Controllers/RecipesController.php @@ -81,11 +81,11 @@ class RecipesController extends Controller break; } break; - } + }//end switch $recipes = $recipes->paginate(); - $type = $request->type ? RecipeFilter::make($request->type) : null; + $type = $request->type ? RecipeFilter::make($request->type) : null; try { $value = $request->value ? RecipeFilterTimes::make($request->value) : null; } catch (BadMethodCallException $e) { @@ -120,7 +120,7 @@ class RecipesController extends Controller public function kitchenside() { - $recipesLimit = 3; + $recipesLimit = 3; $featuredRecipes = Recipes::where('highlight', true) ->where('status', true) ->where('type', RecipeType::classic()) diff --git a/app/Http/Controllers/TraceabilityController.php b/app/Http/Controllers/TraceabilityController.php index 7d057426..16c5f0d4 100644 --- a/app/Http/Controllers/TraceabilityController.php +++ b/app/Http/Controllers/TraceabilityController.php @@ -17,8 +17,8 @@ class TraceabilityController extends Controller } $searchCode = filter_var($request->code, FILTER_SANITIZE_NUMBER_INT); $tracaDatas = XmlTraceability::where('lot_code', $searchCode)->first(); - $log = new Traceability(); - $log->code = $searchCode; + $log = new Traceability(); + $log->code = $searchCode; if (!$tracaDatas) { // Produit non trouvé @@ -66,7 +66,7 @@ class TraceabilityController extends Controller // Produit trouvé $log->response_type = 1; $log->save(); - } + }//end if return json_encode(['status' => 'OK', 'code' => 200, 'breeder' => $breeder]); } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index f5d12b45..72fe1664 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -7,7 +7,6 @@ use Illuminate\Foundation\Http\Kernel as HttpKernel; class Kernel extends HttpKernel { - /** * The application's global HTTP middleware stack. * diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 4a3e2502..6f8f5de7 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -11,7 +11,7 @@ class Authenticate extends Middleware /** * Get the path the user should be redirected to when they are not authenticated. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return string|null */ protected function redirectTo($request) diff --git a/app/Http/Middleware/CheckForMaintenanceMode.php b/app/Http/Middleware/CheckForMaintenanceMode.php index 20799fb2..9037ddfc 100644 --- a/app/Http/Middleware/CheckForMaintenanceMode.php +++ b/app/Http/Middleware/CheckForMaintenanceMode.php @@ -6,13 +6,11 @@ use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware; class CheckForMaintenanceMode extends Middleware { - /** * The URIs that should be reachable while maintenance mode is enabled. * * @var array */ protected $except = [ - // - ]; + ]; } diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php index 5cf30b3f..20c50392 100644 --- a/app/Http/Middleware/EncryptCookies.php +++ b/app/Http/Middleware/EncryptCookies.php @@ -6,13 +6,11 @@ use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; class EncryptCookies extends Middleware { - /** * The names of the cookies that should not be encrypted. * * @var array */ protected $except = [ - // - ]; + ]; } diff --git a/app/Http/Middleware/IsAdmin.php b/app/Http/Middleware/IsAdmin.php index 498d0f36..82a7d188 100644 --- a/app/Http/Middleware/IsAdmin.php +++ b/app/Http/Middleware/IsAdmin.php @@ -10,8 +10,8 @@ class IsAdmin /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next + * @param \Illuminate\Http\Request $request + * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index ff3664e5..7b6956fb 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -10,9 +10,9 @@ class RedirectIfAuthenticated /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard * @return mixed */ public function handle($request, Closure $next, $guard = null) diff --git a/app/Http/Middleware/SecureHeaders.php b/app/Http/Middleware/SecureHeaders.php index f4281e74..fd3c511b 100644 --- a/app/Http/Middleware/SecureHeaders.php +++ b/app/Http/Middleware/SecureHeaders.php @@ -6,7 +6,6 @@ use Closure; class SecureHeaders { - // Enumerate headers which you do not want in your application's responses. // Great starting point would be to go check out @Scott_Helme's: // https://securityheaders.com/ diff --git a/app/Http/Middleware/SessionPreviousUrl.php b/app/Http/Middleware/SessionPreviousUrl.php index 78bd7ab0..f75ee1f2 100644 --- a/app/Http/Middleware/SessionPreviousUrl.php +++ b/app/Http/Middleware/SessionPreviousUrl.php @@ -10,8 +10,8 @@ class SessionPreviousUrl /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next + * @param \Illuminate\Http\Request $request + * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) diff --git a/app/Http/Middleware/TrimStrings.php b/app/Http/Middleware/TrimStrings.php index 7eb899a6..5a50e7b5 100644 --- a/app/Http/Middleware/TrimStrings.php +++ b/app/Http/Middleware/TrimStrings.php @@ -6,7 +6,6 @@ use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware; class TrimStrings extends Middleware { - /** * The names of the attributes that should not be trimmed. * diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 919aec9e..03b78905 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -7,7 +7,6 @@ use Illuminate\Http\Request; class TrustProxies extends Middleware { - /** * The trusted proxies for this application. * @@ -18,7 +17,7 @@ class TrustProxies extends Middleware /** * The headers that should be used to detect proxies. * - * @var int + * @var integer */ protected $headers = Request::HEADER_X_FORWARDED_ALL; } diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index 8ae555b7..d0b0dac1 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -8,7 +8,6 @@ use Illuminate\Contracts\Foundation\Application; class VerifyCsrfToken extends Middleware { - /** * The URIs that should be excluded from CSRF verification. * diff --git a/app/Http/Middleware/XssSanitizer.php b/app/Http/Middleware/XssSanitizer.php index 9426ad5c..87c9b1b8 100644 --- a/app/Http/Middleware/XssSanitizer.php +++ b/app/Http/Middleware/XssSanitizer.php @@ -10,8 +10,8 @@ class XssSanitizer /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next + * @param \Illuminate\Http\Request $request + * @param \Closure $next * @return mixed */ public function handle($request, Closure $next, ...$params) diff --git a/app/Http/Requests/BlockCustomerRequest.php b/app/Http/Requests/BlockCustomerRequest.php index 8b904ef5..4d119ae3 100644 --- a/app/Http/Requests/BlockCustomerRequest.php +++ b/app/Http/Requests/BlockCustomerRequest.php @@ -10,7 +10,7 @@ class BlockCustomerRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/BoutiqueBuyRequest.php b/app/Http/Requests/BoutiqueBuyRequest.php index d279565e..22d37ff5 100644 --- a/app/Http/Requests/BoutiqueBuyRequest.php +++ b/app/Http/Requests/BoutiqueBuyRequest.php @@ -12,7 +12,7 @@ class BoutiqueBuyRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/ComplainFormRequest.php b/app/Http/Requests/ComplainFormRequest.php index 74933e71..f0360ffb 100644 --- a/app/Http/Requests/ComplainFormRequest.php +++ b/app/Http/Requests/ComplainFormRequest.php @@ -7,7 +7,7 @@ class ComplainFormRequest extends ContactFormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/ContactFormRequest.php b/app/Http/Requests/ContactFormRequest.php index 771c6e82..1bda94be 100644 --- a/app/Http/Requests/ContactFormRequest.php +++ b/app/Http/Requests/ContactFormRequest.php @@ -12,7 +12,7 @@ class ContactFormRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { @@ -42,7 +42,8 @@ class ContactFormRequest extends FormRequest 'firstname' => 'required|min:2', 'address' => 'required|min:4', 'email' => 'required|email:rfc,dns,spoof', - 'postal' => 'required|min:3|max:10', // max arcadia 10 chars + 'postal' => 'required|min:3|max:10', +// max arcadia 10 chars 'town' => 'required|min:3|max:90', 'phone' => 'required|min:8|max:14', 'onepagesubject' => 'sometimes|min:10|max:250', diff --git a/app/Http/Requests/CopyProductXmlInco.php b/app/Http/Requests/CopyProductXmlInco.php index 70357ffc..0b6b8b4b 100644 --- a/app/Http/Requests/CopyProductXmlInco.php +++ b/app/Http/Requests/CopyProductXmlInco.php @@ -9,7 +9,7 @@ class CopyProductXmlInco extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/CustomerCollectionRequest.php b/app/Http/Requests/CustomerCollectionRequest.php index 0ca1dba6..96a9b35b 100644 --- a/app/Http/Requests/CustomerCollectionRequest.php +++ b/app/Http/Requests/CustomerCollectionRequest.php @@ -12,7 +12,6 @@ use Kwaadpepper\Enum\Rules\EnumIsValidRule; abstract class CustomerCollectionRequest extends FormRequest { - /** * populated in rules function * @@ -23,7 +22,7 @@ abstract class CustomerCollectionRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize(): bool { diff --git a/app/Http/Requests/CustomerRegisterRequest.php b/app/Http/Requests/CustomerRegisterRequest.php index 76e1fe07..08c9f5e7 100644 --- a/app/Http/Requests/CustomerRegisterRequest.php +++ b/app/Http/Requests/CustomerRegisterRequest.php @@ -13,7 +13,7 @@ class CustomerRegisterRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/CustomerUpdatePassword.php b/app/Http/Requests/CustomerUpdatePassword.php index f71c1bd5..22893b89 100644 --- a/app/Http/Requests/CustomerUpdatePassword.php +++ b/app/Http/Requests/CustomerUpdatePassword.php @@ -10,7 +10,7 @@ class CustomerUpdatePassword extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/DeleteMessagesRequest.php b/app/Http/Requests/DeleteMessagesRequest.php index 32fc1314..5dea3164 100644 --- a/app/Http/Requests/DeleteMessagesRequest.php +++ b/app/Http/Requests/DeleteMessagesRequest.php @@ -10,7 +10,7 @@ class DeleteMessagesRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/DownloadBRFileRequest.php b/app/Http/Requests/DownloadBRFileRequest.php index 187cd479..0612a492 100644 --- a/app/Http/Requests/DownloadBRFileRequest.php +++ b/app/Http/Requests/DownloadBRFileRequest.php @@ -9,7 +9,7 @@ class DownloadBRFileRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/GetMapBreeders.php b/app/Http/Requests/GetMapBreeders.php index f3b2a48b..7ee48d4a 100644 --- a/app/Http/Requests/GetMapBreeders.php +++ b/app/Http/Requests/GetMapBreeders.php @@ -10,7 +10,7 @@ class GetMapBreeders extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/GetProductXmlInco.php b/app/Http/Requests/GetProductXmlInco.php index e4400155..bbc99d94 100644 --- a/app/Http/Requests/GetProductXmlInco.php +++ b/app/Http/Requests/GetProductXmlInco.php @@ -9,7 +9,7 @@ class GetProductXmlInco extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/LoginRequest.php b/app/Http/Requests/LoginRequest.php index c2742b23..726ad8f7 100644 --- a/app/Http/Requests/LoginRequest.php +++ b/app/Http/Requests/LoginRequest.php @@ -9,7 +9,7 @@ class LoginRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/RecipeHighlightsUpdate.php b/app/Http/Requests/RecipeHighlightsUpdate.php index c2698a8a..c7cd1319 100644 --- a/app/Http/Requests/RecipeHighlightsUpdate.php +++ b/app/Http/Requests/RecipeHighlightsUpdate.php @@ -9,7 +9,7 @@ class RecipeHighlightsUpdate extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/RecipeIndexRequest.php b/app/Http/Requests/RecipeIndexRequest.php index 6994a59f..9f8b3255 100644 --- a/app/Http/Requests/RecipeIndexRequest.php +++ b/app/Http/Requests/RecipeIndexRequest.php @@ -11,7 +11,7 @@ class RecipeIndexRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/RecipeRateRequest.php b/app/Http/Requests/RecipeRateRequest.php index 2500b2e1..26d83590 100644 --- a/app/Http/Requests/RecipeRateRequest.php +++ b/app/Http/Requests/RecipeRateRequest.php @@ -9,7 +9,7 @@ class RecipeRateRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/ResetCustomerPassword.php b/app/Http/Requests/ResetCustomerPassword.php index 3bd00ce5..7cc05992 100644 --- a/app/Http/Requests/ResetCustomerPassword.php +++ b/app/Http/Requests/ResetCustomerPassword.php @@ -10,7 +10,7 @@ class ResetCustomerPassword extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/SearchProduct.php b/app/Http/Requests/SearchProduct.php index 3fefd7a2..34e6b6cd 100644 --- a/app/Http/Requests/SearchProduct.php +++ b/app/Http/Requests/SearchProduct.php @@ -9,7 +9,7 @@ class SearchProduct extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/SearchRequest.php b/app/Http/Requests/SearchRequest.php index 4d33229b..4a0fa6a2 100644 --- a/app/Http/Requests/SearchRequest.php +++ b/app/Http/Requests/SearchRequest.php @@ -9,7 +9,7 @@ class SearchRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/SendMessageRequest.php b/app/Http/Requests/SendMessageRequest.php index 0e8f9c03..6b23648e 100644 --- a/app/Http/Requests/SendMessageRequest.php +++ b/app/Http/Requests/SendMessageRequest.php @@ -10,7 +10,7 @@ class SendMessageRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/SetProductXmlInco.php b/app/Http/Requests/SetProductXmlInco.php index 79c03ad9..815e6030 100644 --- a/app/Http/Requests/SetProductXmlInco.php +++ b/app/Http/Requests/SetProductXmlInco.php @@ -9,7 +9,7 @@ class SetProductXmlInco extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/SingleOptinRequest.php b/app/Http/Requests/SingleOptinRequest.php index 9b48a471..a4f2059a 100644 --- a/app/Http/Requests/SingleOptinRequest.php +++ b/app/Http/Requests/SingleOptinRequest.php @@ -9,7 +9,7 @@ class SingleOptinRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/StoreActuRequest.php b/app/Http/Requests/StoreActuRequest.php index 83004026..a379adb4 100644 --- a/app/Http/Requests/StoreActuRequest.php +++ b/app/Http/Requests/StoreActuRequest.php @@ -10,7 +10,7 @@ class StoreActuRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/StoreActusHighlights.php b/app/Http/Requests/StoreActusHighlights.php index 091b41f4..c664bcd1 100644 --- a/app/Http/Requests/StoreActusHighlights.php +++ b/app/Http/Requests/StoreActusHighlights.php @@ -9,7 +9,7 @@ class StoreActusHighlights extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/StoreArticle.php b/app/Http/Requests/StoreArticle.php index 8dcba81b..3fe28086 100644 --- a/app/Http/Requests/StoreArticle.php +++ b/app/Http/Requests/StoreArticle.php @@ -11,7 +11,7 @@ class StoreArticle extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/StoreBreederPortrait.php b/app/Http/Requests/StoreBreederPortrait.php index a88fde5c..278bf990 100644 --- a/app/Http/Requests/StoreBreederPortrait.php +++ b/app/Http/Requests/StoreBreederPortrait.php @@ -9,7 +9,7 @@ class StoreBreederPortrait extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/StoreBreedingPageRequest.php b/app/Http/Requests/StoreBreedingPageRequest.php index 9d2a6d35..b6620a8c 100644 --- a/app/Http/Requests/StoreBreedingPageRequest.php +++ b/app/Http/Requests/StoreBreedingPageRequest.php @@ -8,7 +8,6 @@ use Illuminate\Support\Str; class StoreBreedingPageRequest extends StoreMiniAcfRequest { - protected $model = BreedingPage::class; public function authorize() diff --git a/app/Http/Requests/StoreLabel.php b/app/Http/Requests/StoreLabel.php index 2659f716..75e4fbfe 100644 --- a/app/Http/Requests/StoreLabel.php +++ b/app/Http/Requests/StoreLabel.php @@ -10,7 +10,7 @@ class StoreLabel extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/StoreMeatType.php b/app/Http/Requests/StoreMeatType.php index d1a3ce40..75f09bc2 100644 --- a/app/Http/Requests/StoreMeatType.php +++ b/app/Http/Requests/StoreMeatType.php @@ -10,7 +10,7 @@ class StoreMeatType extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/StoreMiniAcfRequest.php b/app/Http/Requests/StoreMiniAcfRequest.php index 30c38799..df9ffafe 100644 --- a/app/Http/Requests/StoreMiniAcfRequest.php +++ b/app/Http/Requests/StoreMiniAcfRequest.php @@ -11,7 +11,6 @@ use Illuminate\Validation\ValidationException; class StoreMiniAcfRequest extends FormRequest { - protected $isStore = true; /** @@ -34,7 +33,7 @@ class StoreMiniAcfRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { @@ -70,7 +69,8 @@ class StoreMiniAcfRequest extends FormRequest // If is update request if ($this->modelVarName) { $this->generatedRules = $this->genRules($this->{$this->modelVarName}->content); - } else { // This is store request + } else { +// This is store request $model = $this->model; // Nasty hack to get all block data as array beurk ! $this->generatedRules = $this->genRules(\json_decode(\json_encode((new $model())->getBlocks()), true)); @@ -126,7 +126,7 @@ class StoreMiniAcfRequest extends FormRequest return $this->handleMiniBlocArray($coords, $inputKey); case InputType::labelArray()->value: return $this->handleLabelArray($coords, $inputKey); - } + }//end switch throw new Exception(sprintf( 'Unknown input type %s', InputType::make($inputType)->label @@ -135,16 +135,16 @@ class StoreMiniAcfRequest extends FormRequest private function handleVideoVimeo(string $inputKey) { - return ["$inputKey.value" => 'required|url|regex:/^https:\/\/vimeo\.com\/[0-9]{8,10}$/']; + return ["$inputKey.value" => 'required|url|regex:/^https:\/\/vimeo\.com\/[0-9]{8,10}$/']; } private function handleImageArray(array $coords, string $inputKey, array $ipt): array { \extract($coords); $rules = []; - $ipt = $all['content'][$i]['content'][$iptName]; - $max = isset($ipt['dimensionsMax']); - $dim = collect(explode( + $ipt = $all['content'][$i]['content'][$iptName]; + $max = isset($ipt['dimensionsMax']); + $dim = collect(explode( ',', $ipt['dimensions'] ?? $ipt['dimensionsMax'] ))->mapWithKeys(function ($v) { @@ -155,7 +155,7 @@ class StoreMiniAcfRequest extends FormRequest "$inputKey.value.*" => 'sometimes|array' ]); if (is_array($this->input("$inputKey.value.*"))) { - $all = $this->all(); + $all = $this->all(); $images = $this->input("$inputKey.value"); if (is_array($images)) { ksort($images); @@ -182,8 +182,8 @@ class StoreMiniAcfRequest extends FormRequest "$inputKey.value.$imageK" => 'string' ]); } - } - } + }//end foreach + }//end if return $rules; } @@ -234,19 +234,19 @@ class StoreMiniAcfRequest extends FormRequest private function handleBoolean(string $inputKey): array { - $all = $this->all(); + $all = $this->all(); $nested = Utils::dotStringToNestedArray( "$inputKey.value", $this->input("$inputKey.value") ? 1 : 0 ); - $all = array_merge_recursive_distinct($all, $nested); + $all = array_merge_recursive_distinct($all, $nested); $this->merge($all); return ["$inputKey.value" => 'required|boolean']; } private function handleUrl(string $inputKey): array { - $all = $this->all(); + $all = $this->all(); $status = Utils::dotStringToNestedArray( "$inputKey.status", $this->input("$inputKey.status") ? true : false @@ -255,8 +255,8 @@ class StoreMiniAcfRequest extends FormRequest "$inputKey.newtab", $this->input("$inputKey.newtab") ? true : false ); - $all = array_merge_recursive_distinct($all, $status); - $all = array_merge_recursive_distinct($all, $newtab); + $all = array_merge_recursive_distinct($all, $status); + $all = array_merge_recursive_distinct($all, $newtab); $this->merge($all); return [ "$inputKey.value" => [ @@ -278,8 +278,8 @@ class StoreMiniAcfRequest extends FormRequest private function handleImage(string $inputKey, array $ipt): array { - $max = isset($ipt['dimensionsMax']); - $dim = collect(explode( + $max = isset($ipt['dimensionsMax']); + $dim = collect(explode( ',', $ipt['dimensions'] ?? $ipt['dimensionsMax'] ?? '' ))->mapWithKeys(function ($v) { @@ -308,7 +308,7 @@ class StoreMiniAcfRequest extends FormRequest private function handleText(string $inputKey): array { - return ["$inputKey.html" => 'required|string|min:15']; + return ["$inputKey.html" => 'required|string|min:15']; } private function handleString(string $inputKey): array diff --git a/app/Http/Requests/StoreOcbBreeder.php b/app/Http/Requests/StoreOcbBreeder.php index 436a0d2a..d1cf01aa 100644 --- a/app/Http/Requests/StoreOcbBreeder.php +++ b/app/Http/Requests/StoreOcbBreeder.php @@ -14,7 +14,7 @@ class StoreOcbBreeder extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/StoreProductRequest.php b/app/Http/Requests/StoreProductRequest.php index cd0fa912..39d361d1 100644 --- a/app/Http/Requests/StoreProductRequest.php +++ b/app/Http/Requests/StoreProductRequest.php @@ -10,7 +10,7 @@ class StoreProductRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/StoreRange.php b/app/Http/Requests/StoreRange.php index 4cebb06b..4c33512a 100644 --- a/app/Http/Requests/StoreRange.php +++ b/app/Http/Requests/StoreRange.php @@ -12,7 +12,7 @@ class StoreRange extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/StoreRecipe.php b/app/Http/Requests/StoreRecipe.php index dae9b5bc..edaba802 100644 --- a/app/Http/Requests/StoreRecipe.php +++ b/app/Http/Requests/StoreRecipe.php @@ -12,7 +12,7 @@ class StoreRecipe extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/StoreSubRange.php b/app/Http/Requests/StoreSubRange.php index 47318dbd..7abcd8d1 100644 --- a/app/Http/Requests/StoreSubRange.php +++ b/app/Http/Requests/StoreSubRange.php @@ -12,7 +12,7 @@ class StoreSubRange extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/StoreTagRequest.php b/app/Http/Requests/StoreTagRequest.php index 922de43c..0fe4cd9c 100644 --- a/app/Http/Requests/StoreTagRequest.php +++ b/app/Http/Requests/StoreTagRequest.php @@ -10,7 +10,7 @@ class StoreTagRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/SurveyAnswersRequest.php b/app/Http/Requests/SurveyAnswersRequest.php index 6afd039f..4a174694 100644 --- a/app/Http/Requests/SurveyAnswersRequest.php +++ b/app/Http/Requests/SurveyAnswersRequest.php @@ -10,7 +10,7 @@ class SurveyAnswersRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/UpdateActuRequest.php b/app/Http/Requests/UpdateActuRequest.php index 4de43798..fddbd631 100644 --- a/app/Http/Requests/UpdateActuRequest.php +++ b/app/Http/Requests/UpdateActuRequest.php @@ -4,7 +4,6 @@ namespace App\Http\Requests; class UpdateActuRequest extends StoreActuRequest { - /** * Get the validation rules that apply to the request. * diff --git a/app/Http/Requests/UpdateArticle.php b/app/Http/Requests/UpdateArticle.php index eb38a7c2..ebfeb2b2 100644 --- a/app/Http/Requests/UpdateArticle.php +++ b/app/Http/Requests/UpdateArticle.php @@ -4,7 +4,6 @@ namespace App\Http\Requests; class UpdateArticle extends StoreArticle { - public function rules() { return array_merge( diff --git a/app/Http/Requests/UpdateBreedingPageRequest.php b/app/Http/Requests/UpdateBreedingPageRequest.php index 5a725beb..6af7f4bf 100644 --- a/app/Http/Requests/UpdateBreedingPageRequest.php +++ b/app/Http/Requests/UpdateBreedingPageRequest.php @@ -8,7 +8,6 @@ use Illuminate\Support\Str; class UpdateBreedingPageRequest extends UpdateMiniAcfRequest { - protected $modelVarName = 'breeding_page'; public function authorize() diff --git a/app/Http/Requests/UpdateEngagement.php b/app/Http/Requests/UpdateEngagement.php index 5f2dcff6..6f3b424c 100644 --- a/app/Http/Requests/UpdateEngagement.php +++ b/app/Http/Requests/UpdateEngagement.php @@ -13,7 +13,7 @@ class UpdateEngagement extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { @@ -59,9 +59,9 @@ class UpdateEngagement extends FormRequest ]); break; case InputType::image()->value: - $ipt = $this->engagement->content[$i]['content'][$iptName]; - $max = isset($ipt['dimensionsMax']); - $dim = collect(explode( + $ipt = $this->engagement->content[$i]['content'][$iptName]; + $max = isset($ipt['dimensionsMax']); + $dim = collect(explode( ',', $ipt['dimensions'] ?? $ipt['dimensionsMax'] ))->mapWithKeys(function ($v) { @@ -85,9 +85,9 @@ class UpdateEngagement extends FormRequest ]); break; case InputType::imageArray()->value: - $ipt = $this->engagement->content[$i]['content'][$iptName]; - $max = isset($ipt['dimensionsMax']); - $dim = collect(explode( + $ipt = $this->engagement->content[$i]['content'][$iptName]; + $max = isset($ipt['dimensionsMax']); + $dim = collect(explode( ',', $ipt['dimensions'] ?? $ipt['dimensionsMax'] ))->mapWithKeys(function ($v) { @@ -98,7 +98,7 @@ class UpdateEngagement extends FormRequest "content.$i.content.$iptName.value.*" => 'sometimes|array' ]); if (is_array($this->input("content.$i.content.$iptName.value.*"))) { - $all = $this->all(); + $all = $this->all(); $images = $this->input("content.$i.content.$iptName.value"); if (is_array($images)) { ksort($images); @@ -125,8 +125,8 @@ class UpdateEngagement extends FormRequest "content.$i.content.$iptName.value.$imageK" => 'string' ]); } - } - } + }//end foreach + }//end if break; case InputType::url()->value: $rules = array_merge($rules, [ @@ -161,21 +161,21 @@ class UpdateEngagement extends FormRequest $this->merge($all); break; case InputType::boolean()->value: - $all = $this->all(); + $all = $this->all(); $nested = Utils::dotStringToNestedArray( "content.$i.content.$iptName.value", $this->input("content.$i.content.$iptName.value") ? true : false ); - $all = array_merge_recursive_distinct($all, $nested); + $all = array_merge_recursive_distinct($all, $nested); $this->merge($all); $rules = array_merge($rules, [ "content.$i.content.$iptName.value" => 'boolean' ]); break; - } - } - } - } + }//end switch + }//end foreach + }//end foreach + }//end if return $rules; } } diff --git a/app/Http/Requests/UpdateGeneralConfig.php b/app/Http/Requests/UpdateGeneralConfig.php index 0458b4ba..09bb7204 100644 --- a/app/Http/Requests/UpdateGeneralConfig.php +++ b/app/Http/Requests/UpdateGeneralConfig.php @@ -4,6 +4,5 @@ namespace App\Http\Requests; class UpdateGeneralConfig extends UpdateMiniCrudRequest { - protected $modelName = 'general_config'; } diff --git a/app/Http/Requests/UpdateInfosRequest.php b/app/Http/Requests/UpdateInfosRequest.php index 319bfd27..698a32f3 100644 --- a/app/Http/Requests/UpdateInfosRequest.php +++ b/app/Http/Requests/UpdateInfosRequest.php @@ -13,7 +13,7 @@ class UpdateInfosRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/UpdateMiniAcfRequest.php b/app/Http/Requests/UpdateMiniAcfRequest.php index d21eb847..8b960241 100644 --- a/app/Http/Requests/UpdateMiniAcfRequest.php +++ b/app/Http/Requests/UpdateMiniAcfRequest.php @@ -6,7 +6,6 @@ use Illuminate\Contracts\Validation\Factory as ValidationFactory; class UpdateMiniAcfRequest extends StoreMiniAcfRequest { - protected $isStore = false; /** diff --git a/app/Http/Requests/UpdateMiniCrudRequest.php b/app/Http/Requests/UpdateMiniCrudRequest.php index 0e9d1541..bda32416 100644 --- a/app/Http/Requests/UpdateMiniCrudRequest.php +++ b/app/Http/Requests/UpdateMiniCrudRequest.php @@ -9,14 +9,13 @@ use Illuminate\Validation\ValidationException; abstract class UpdateMiniCrudRequest extends FormRequest { - /** The model parameter name */ protected $modelName = null; /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { @@ -52,14 +51,14 @@ abstract class UpdateMiniCrudRequest extends FormRequest } return $rule; }); - $rules = array_merge($rules, [ + $rules = array_merge($rules, [ "data.$iptName.text" => $mergeRules ]); break; case InputType::image()->value: - $ipt = $this->data[$iptName]; - $max = isset($ipt['dimensionsMax']); - $dim = collect(explode( + $ipt = $this->data[$iptName]; + $max = isset($ipt['dimensionsMax']); + $dim = collect(explode( ',', $ipt['dimensionsMax'] ?? $input['dimensions'] ))->mapWithKeys(function ($v) { @@ -100,19 +99,19 @@ abstract class UpdateMiniCrudRequest extends FormRequest ]); break; case InputType::boolean()->value: - $all = $this->all(); + $all = $this->all(); $nested = Utils::dotStringToNestedArray( "data.$iptName.value", $this->input("data.$iptName.value") ? true : false ); - $all = array_merge_recursive_distinct($all, $nested); + $all = array_merge_recursive_distinct($all, $nested); $this->merge($all); $rules = array_merge($rules, [ "data.$iptName.value" => 'boolean' ]); break; - } - } + }//end switch + }//end foreach return $rules; } @@ -130,7 +129,7 @@ abstract class UpdateMiniCrudRequest extends FormRequest } /** @var array */ $inputValidate = explode('|', $input['validate']); - $out = explode('|', $inputTypeValidate); + $out = explode('|', $inputTypeValidate); foreach ($inputValidate as $validate) { if (!\in_array($validate, $out)) { $out[] = $validate; diff --git a/app/Http/Requests/UpdateNutritionPageRequest.php b/app/Http/Requests/UpdateNutritionPageRequest.php index d7ec3687..d4c3b466 100644 --- a/app/Http/Requests/UpdateNutritionPageRequest.php +++ b/app/Http/Requests/UpdateNutritionPageRequest.php @@ -4,7 +4,6 @@ namespace App\Http\Requests; class UpdateNutritionPageRequest extends UpdateMiniAcfRequest { - protected $modelVarName = 'nutrition_page'; /** diff --git a/app/Http/Requests/UpdatePageJoinus.php b/app/Http/Requests/UpdatePageJoinus.php index d974d685..fab341a8 100644 --- a/app/Http/Requests/UpdatePageJoinus.php +++ b/app/Http/Requests/UpdatePageJoinus.php @@ -10,7 +10,7 @@ class UpdatePageJoinus extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { @@ -24,7 +24,7 @@ class UpdatePageJoinus extends FormRequest */ public function rules() { - $joinus = PageJoinus::firstOrNew(); + $joinus = PageJoinus::firstOrNew(); $imageRule = 'image|mimes:jpeg,png,jpg|max:2048'; return [ 'offer_image_1' => (!$joinus->offer_image_1 ? 'required|' : '') . $imageRule, diff --git a/app/Http/Requests/UpdatePoultryPageRequest.php b/app/Http/Requests/UpdatePoultryPageRequest.php index f7407511..da4a6caf 100644 --- a/app/Http/Requests/UpdatePoultryPageRequest.php +++ b/app/Http/Requests/UpdatePoultryPageRequest.php @@ -4,7 +4,6 @@ namespace App\Http\Requests; class UpdatePoultryPageRequest extends UpdateMiniAcfRequest { - protected $modelVarName = 'poultry_page'; /** diff --git a/app/Http/Requests/UpdateProductRequest.php b/app/Http/Requests/UpdateProductRequest.php index 1f362d45..a3f87fda 100644 --- a/app/Http/Requests/UpdateProductRequest.php +++ b/app/Http/Requests/UpdateProductRequest.php @@ -10,7 +10,7 @@ class UpdateProductRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/UpdateRange.php b/app/Http/Requests/UpdateRange.php index 5027e3ec..e7838d38 100644 --- a/app/Http/Requests/UpdateRange.php +++ b/app/Http/Requests/UpdateRange.php @@ -7,7 +7,6 @@ use App\Models\Range; class UpdateRange extends StoreRange { - public function authorize() { $this->merge([ diff --git a/app/Http/Requests/UpdateReductionRequest.php b/app/Http/Requests/UpdateReductionRequest.php index 80279008..7b65a05c 100644 --- a/app/Http/Requests/UpdateReductionRequest.php +++ b/app/Http/Requests/UpdateReductionRequest.php @@ -9,7 +9,7 @@ class UpdateReductionRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { @@ -24,7 +24,6 @@ class UpdateReductionRequest extends FormRequest public function rules() { return [ - // - ]; + ]; } } diff --git a/app/Http/Requests/UpdateStatisfationStatRequest.php b/app/Http/Requests/UpdateStatisfationStatRequest.php index 5f8ff6f6..83805cf5 100644 --- a/app/Http/Requests/UpdateStatisfationStatRequest.php +++ b/app/Http/Requests/UpdateStatisfationStatRequest.php @@ -9,7 +9,7 @@ class UpdateStatisfationStatRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Requests/UpdateTagRequest.php b/app/Http/Requests/UpdateTagRequest.php index 7145833a..89ea0f5e 100644 --- a/app/Http/Requests/UpdateTagRequest.php +++ b/app/Http/Requests/UpdateTagRequest.php @@ -4,7 +4,6 @@ namespace App\Http\Requests; class UpdateTagRequest extends StoreTagRequest { - /** * Get the validation rules that apply to the request. * diff --git a/app/Http/Requests/UploadFileRequest.php b/app/Http/Requests/UploadFileRequest.php index 53d9e5de..66a05374 100644 --- a/app/Http/Requests/UploadFileRequest.php +++ b/app/Http/Requests/UploadFileRequest.php @@ -9,7 +9,7 @@ class UploadFileRequest extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ public function authorize() { diff --git a/app/Http/Resources/BreederMapCollection.php b/app/Http/Resources/BreederMapCollection.php index e33a0edf..940357f9 100644 --- a/app/Http/Resources/BreederMapCollection.php +++ b/app/Http/Resources/BreederMapCollection.php @@ -7,7 +7,6 @@ use Illuminate\Http\Resources\Json\ResourceCollection; class BreederMapCollection extends ResourceCollection { - /** * The resource that this resource collects. * diff --git a/app/Http/Resources/CustomerCrmResource.php b/app/Http/Resources/CustomerCrmResource.php index f7137c29..467b9b6f 100644 --- a/app/Http/Resources/CustomerCrmResource.php +++ b/app/Http/Resources/CustomerCrmResource.php @@ -7,7 +7,6 @@ use App\Models\Customers; class CustomerCrmResource extends JsonResource { - /** @var Customers */ private $customer; public function __construct(Customers $customer) diff --git a/app/Http/Resources/XmlIncoCollection.php b/app/Http/Resources/XmlIncoCollection.php index ed6ccd6f..5da93e94 100644 --- a/app/Http/Resources/XmlIncoCollection.php +++ b/app/Http/Resources/XmlIncoCollection.php @@ -7,7 +7,6 @@ use Illuminate\Http\Resources\Json\ResourceCollection; class XmlIncoCollection extends ResourceCollection { - /** * The resource that this resource collects. * diff --git a/app/Jobs/SendBoutiqueMails.php b/app/Jobs/SendBoutiqueMails.php index 689bde36..836ff85c 100644 --- a/app/Jobs/SendBoutiqueMails.php +++ b/app/Jobs/SendBoutiqueMails.php @@ -53,7 +53,7 @@ class SendBoutiqueMails implements ShouldQueue Mail::to($this->order->email) ->send(new MailOrder($this->order)); $this->order->confirmMailSent = true; - $this->order->status = OrderStatus::payed(); + $this->order->status = OrderStatus::payed(); $this->order->saveOrFail(); Log::debug('Boutique mail is sent', $this->order->toArray()); } else { diff --git a/app/Jobs/SendOrderToArchadia.php b/app/Jobs/SendOrderToArchadia.php index 8d8a7c05..81d553b3 100644 --- a/app/Jobs/SendOrderToArchadia.php +++ b/app/Jobs/SendOrderToArchadia.php @@ -52,9 +52,9 @@ class SendOrderToArchadia implements ShouldQueue 'operation' => env('BOUTIQUE_ARCHADIA_OP_CODE', 16), 'support_code' => $sellItem->archadia_id, 'label_type_support' => $sellItem->name, - //format : DD/MM/YYYY + // format : DD/MM/YYYY 'order_date' => Carbon::parse($this->order->created_at)->format('Y/m/d H:i:s'), - //format 9 numeric characters + // format 9 numeric characters 'order_num' => $this->order->id, 'state_order' => $this->order->payementType->equals(OrderType::cb()) ? ArcadiaOrderType::cb() : ArcadiaOrderType::check(), @@ -68,8 +68,8 @@ class SendOrderToArchadia implements ShouldQueue 'phone' => $deliver->phone ]); $mail->send(); - } - } + }//end for + }//end foreach Log::debug(sprintf('Order %d sent to archadia', $this->order->id)); } diff --git a/app/Jobs/XArcadiaFlux.php b/app/Jobs/XArcadiaFlux.php index 712aceef..56818a09 100644 --- a/app/Jobs/XArcadiaFlux.php +++ b/app/Jobs/XArcadiaFlux.php @@ -89,7 +89,7 @@ abstract class XArcadiaFlux implements ShouldQueue return; } if ($this->getDisk()->exists(sprintf('%s/%s', $this->archiveFolderName, $filename))) { - $ext = \pathinfo($filename, \PATHINFO_EXTENSION); + $ext = \pathinfo($filename, \PATHINFO_EXTENSION); $newFileName = \sprintf( '%s_%d.%s', \substr($filename, 0, 0 - (strlen($ext) + 1)), @@ -126,7 +126,7 @@ abstract class XArcadiaFlux implements ShouldQueue */ protected function clearOldArchives(): void { - $disk = $this->getDisk(); + $disk = $this->getDisk(); $archives = $disk->files($this->archiveFolderName); // /** @var File */ @@ -157,7 +157,7 @@ abstract class XArcadiaFlux implements ShouldQueue /** * Logs data * - * @param string $message + * @param string $message * @param LogType $logtype * @return void */ @@ -188,14 +188,14 @@ abstract class XArcadiaFlux implements ShouldQueue break; default: throw new Exception(sprintf('%s : unhandled log type %s', get_class($this), $logtype->label)); - } + }//end switch $this->consolePrint($message, $logtype); } /** * Prints to the console * - * @param string $message + * @param string $message * @param LogType $logtype * @return void */ diff --git a/app/Jobs/XSCVMepReader.php b/app/Jobs/XSCVMepReader.php index e694d110..fb7cd5d0 100644 --- a/app/Jobs/XSCVMepReader.php +++ b/app/Jobs/XSCVMepReader.php @@ -16,7 +16,6 @@ use TypeError; class XSCVMepReader extends XArcadiaFlux { - /** * The Laravel disk name * @@ -58,7 +57,7 @@ class XSCVMepReader extends XArcadiaFlux $ocbBreeders = OCBBreeder::all(); $progress = 1; - $total = count(array_filter($files, function ($filename) { + $total = count(array_filter($files, function ($filename) { if ($this->fileHasToBeIgnored($filename)) { return false; } @@ -75,12 +74,12 @@ class XSCVMepReader extends XArcadiaFlux /** @var string $data */ $data = $disk->get($filename); - //load the CSV document from a file path + // load the CSV document from a file path $csv = Reader::createFromString($data); $csv->setDelimiter(';'); $csv->setHeaderOffset(0); - $header = $csv->getHeader(); + $header = $csv->getHeader(); $records = $csv->getRecords(); try { @@ -88,7 +87,7 @@ class XSCVMepReader extends XArcadiaFlux foreach ($records as $record) { $noElev = $record['No Eleveur']; - $inuav = trim(substr($noElev, strlen($noElev) - 7, strlen($noElev))); + $inuav = trim(substr($noElev, strlen($noElev) - 7, strlen($noElev))); // Check if inuav exists // attemps to fix weird issue on ocb waiting list if ( @@ -96,7 +95,7 @@ class XSCVMepReader extends XArcadiaFlux return in_array($inuav, $breeder->inuavs); })->count() ) { - $iWL = OCBWaitingList::where('inuav_code', $inuav)->firstOrNew(); + $iWL = OCBWaitingList::where('inuav_code', $inuav)->firstOrNew(); $iWL->inuav_code = $inuav; $NP = explode(' ', $record['Nom Prenom Eleveur'], 2); @@ -115,7 +114,7 @@ class XSCVMepReader extends XArcadiaFlux ]); $iWL->save(); } - } + }//end foreach } catch (ErrorException | TypeError $e) { $this->log( sprintf( @@ -126,7 +125,8 @@ class XSCVMepReader extends XArcadiaFlux ), LogType::critical() ); - continue; // ignore the file + continue; +// ignore the file } catch (AbortCsvImportException $e) { $this->log( sprintf( @@ -137,7 +137,8 @@ class XSCVMepReader extends XArcadiaFlux ), LogType::error() ); - continue; // ignore the file + continue; +// ignore the file } catch (QueryException $e) { // this happens because of concurent jobs $this->log( @@ -149,11 +150,12 @@ class XSCVMepReader extends XArcadiaFlux ), LogType::debug() ); - continue; // ignore the file - } + continue; +// ignore the file + }//end try $this->moveToArchives($filename); - } + }//end foreach // Clear old archives $this->clearOldArchives(); diff --git a/app/Jobs/XmlEleveursReader.php b/app/Jobs/XmlEleveursReader.php index 8e203d73..7cd27f8a 100644 --- a/app/Jobs/XmlEleveursReader.php +++ b/app/Jobs/XmlEleveursReader.php @@ -6,7 +6,6 @@ use App\Models\XmlBreeder; class XmlEleveursReader extends XmlJobs { - protected $disk = 'eleveurs'; protected $takeColumns = [ diff --git a/app/Jobs/XmlIncoReader.php b/app/Jobs/XmlIncoReader.php index cc32f778..d163fbe0 100644 --- a/app/Jobs/XmlIncoReader.php +++ b/app/Jobs/XmlIncoReader.php @@ -8,14 +8,13 @@ use SimpleXMLElement; class XmlIncoReader extends XmlJobs { - protected $disk = 'inco'; protected $imagesPath = 'images'; protected $takeColumns = [ - 'NO_ART' => 'id', // primary key on model - + 'NO_ART' => 'id', +// primary key on model 'ID_SOCIETE' => 'id_societe', 'NOM_SOCIETE' => 'nom_societe', @@ -43,7 +42,8 @@ class XmlIncoReader extends XmlJobs 'ALLEGAT_AUTRE' => 'allegat_autre', - 'INCO_COMPO' => 'inco_compo', // Consider this sub array + 'INCO_COMPO' => 'inco_compo', +// Consider this sub array 'INCO_COMPO.VAL_ENERG_KJ_NUT' => 'val_energ_kj_nut', 'INCO_COMPO.VAL_ENERG_KJ_R' => 'val_energ_kj_r', 'INCO_COMPO.VAL_ENERG_KCAL_R' => 'val_energ_kcal_r', @@ -405,14 +405,14 @@ class XmlIncoReader extends XmlJobs foreach ($imagesArray as $image) { $imageData = trim((string)$image); if (strlen($imageData)) { - $imageData = base64_decode($imageData); - $imgName = strval($xmlData->INCO->NO_ART); + $imageData = base64_decode($imageData); + $imgName = strval($xmlData->INCO->NO_ART); $imgNamePath = sprintf('%s/%s', rtrim($this->imagesPath, '/'), $imgName); $disk = $this->getDisk(); - $info = getimagesizefromstring($imageData); - $mime = $info['mime']; + $info = getimagesizefromstring($imageData); + $mime = $info['mime']; $imgExtension = null; switch ($mime) { case 'image/jpeg': @@ -429,12 +429,12 @@ class XmlIncoReader extends XmlJobs // pour itérer sur toutes les images // et juste ne pas prendre l'image, on laissera ça à incollector // throw new AbortXmlImportException(sprintf( - // 'Unknown image type on %s : raw data %s', - // $imgName, - // \json_encode($info) + // 'Unknown image type on %s : raw data %s', + // $imgName, + // \json_encode($info) // )); break; - } + }//end switch if (!$imgExtension) { continue; @@ -447,8 +447,8 @@ class XmlIncoReader extends XmlJobs } return $imgNamePath; - } - } + }//end if + }//end foreach return null; } } diff --git a/app/Jobs/XmlJobs.php b/app/Jobs/XmlJobs.php index 54914da2..f3665631 100644 --- a/app/Jobs/XmlJobs.php +++ b/app/Jobs/XmlJobs.php @@ -20,7 +20,6 @@ use TypeError; abstract class XmlJobs extends XArcadiaFlux { - /** * invalid xml folder * @@ -67,7 +66,7 @@ abstract class XmlJobs extends XArcadiaFlux $files = $disk->files(); $progress = 1; - $total = count(array_filter($files, function ($filename) { + $total = count(array_filter($files, function ($filename) { if ($this->fileHasToBeIgnored($filename)) { return false; } @@ -151,7 +150,8 @@ abstract class XmlJobs extends XArcadiaFlux LogType::critical() ); $this->sendErrorParseEmailToServiceWeb($e); - continue; // ignore the file + continue; +// ignore the file } catch (AbortXmlImportException $e) { $this->log( sprintf( @@ -163,7 +163,8 @@ abstract class XmlJobs extends XArcadiaFlux LogType::error() ); $this->sendErrorParseEmailToServiceWeb($e); - continue; // ignore the file + continue; +// ignore the file } catch (FileNotFoundException | QueryException $e) { // This happens because of concurent xml jobs read $message = $e->getMessage(); @@ -179,10 +180,11 @@ abstract class XmlJobs extends XArcadiaFlux ), LogType::debug() ); - continue; // ignore the file - } + continue; +// ignore the file + }//end try $this->moveToArchives($filename); - } + }//end foreach // Clear old archives $this->clearOldArchives(); @@ -252,7 +254,7 @@ abstract class XmlJobs extends XArcadiaFlux } else { $result[$key] = $field; } - } + }//end foreach return $result; } diff --git a/app/Jobs/XmlTracaReader.php b/app/Jobs/XmlTracaReader.php index 8139ed1e..e0440b3e 100644 --- a/app/Jobs/XmlTracaReader.php +++ b/app/Jobs/XmlTracaReader.php @@ -6,7 +6,6 @@ use App\Models\XmlTraceability; class XmlTracaReader extends XmlJobs { - protected $disk = 'tracabilite'; protected $takeColumns = [ diff --git a/app/Lib/Mercanet/Mercanet.php b/app/Lib/Mercanet/Mercanet.php index 369edd88..962dd01f 100644 --- a/app/Lib/Mercanet/Mercanet.php +++ b/app/Lib/Mercanet/Mercanet.php @@ -9,15 +9,15 @@ use Normalizer; class Mercanet { - public const TEST = "https://payment-webinit-mercanet.test.sips-atos.com/rs-services/v2/paymentInit"; + public const TEST = "https://payment-webinit-mercanet.test.sips-atos.com/rs-services/v2/paymentInit"; public const SIMULATION = "https://payment-webinit.simu.mercanet.bnpparibas.net/rs-services/v2/paymentInit"; public const PRODUCTION = "https://payment-webinit.mercanet.bnpparibas.net/rs-services/v2/paymentInit"; public const INTERFACE_VERSION = "IR_WS_2.20"; - public const INSTALMENT = "INSTALMENT"; + public const INSTALMENT = "INSTALMENT"; // BYPASS3DS - public const BYPASS3DS_ALL = "ALL"; + public const BYPASS3DS_ALL = "ALL"; public const BYPASS3DS_MERCHANTWALLET = "MERCHANTWALLET"; private $brandsmap = array( @@ -123,10 +123,10 @@ class Mercanet public function __construct($secret, $MerchantId, $env, $returnUrl, $automaticUrl = false) { - $this->secretKey = $secret; + $this->secretKey = $secret; $this->parameters['merchantId'] = $MerchantId; - $this->env = $env; - $this->returnUrl = $returnUrl; + $this->env = $env; + $this->returnUrl = $returnUrl; if ($automaticUrl !== false) { $this->automaticUrl = $automaticUrl; } @@ -410,7 +410,6 @@ class Mercanet } // Methodes liees a la lutte contre la fraude - public function setFraudDataBypass3ds($value) { if (strlen($value) > 128) { @@ -420,7 +419,6 @@ class Mercanet } // Methodes liees au paiement one-click - public function setMerchantWalletId($wallet) { if (strlen($wallet) > 21) { @@ -438,7 +436,6 @@ class Mercanet } // Methodes liees au paiement en n-fois - public function setInstalmentDataNumber($number) { if (strlen($number) > 2) { @@ -502,7 +499,7 @@ class Mercanet { ksort($this->parameters); $seal = $this->getShaSign(); - $tmp = array_merge($this->parameters, ['seal' => $seal]); + $tmp = array_merge($this->parameters, ['seal' => $seal]); return json_encode($tmp, JSON_UNESCAPED_SLASHES); } @@ -565,17 +562,17 @@ class Mercanet */ private function filterRequestParameters(array $httpRequest) { - //filter request for Sips parameters + // filter request for Sips parameters if (!array_key_exists(self::DATA_FIELD, $httpRequest) || $httpRequest[self::DATA_FIELD] == '') { throw new InvalidArgumentException('Data parameter not present in parameters.'); } - $parameters = array(); + $parameters = array(); $this->responseData = $httpRequest[self::DATA_FIELD]; - $dataString = $httpRequest[self::DATA_FIELD]; - $this->dataString = $dataString; - $dataParams = explode('|', $dataString); + $dataString = $httpRequest[self::DATA_FIELD]; + $this->dataString = $dataString; + $dataParams = explode('|', $dataString); foreach ($dataParams as $dataParamString) { - $dataKeyValue = explode('=', $dataParamString, 2); + $dataKeyValue = explode('=', $dataParamString, 2); $parameters[$dataKeyValue[0]] = $dataKeyValue[1]; } @@ -598,21 +595,21 @@ class Mercanet /** * Checks if the response is valid - * @return bool + * @return boolean */ public function isValid() { $resultat = false; $signature = $this->responseData; - $compute = hash('sha256', utf8_encode($signature . $this->secretKey)); + $compute = hash('sha256', utf8_encode($signature . $this->secretKey)); if (strcmp($this->shaSign, $compute) == 0) { // phpcs:ignore PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace // if ( - // (strcmp($this->parameters['responseCode'], "00") == 0) || - // (strcmp($this->parameters['responseCode'], "60") == 0) + // (strcmp($this->parameters['responseCode'], "00") == 0) || + // (strcmp($this->parameters['responseCode'], "60") == 0) // ) { - // $resultat = true; + // $resultat = true; // } // phpcs:ignore PSR12.ControlStructures.ControlStructureSpacing.FirstExpressionLine if (in_array($this->parameters['responseCode'], [ @@ -638,15 +635,18 @@ class Mercanet ) { $resultat = true; } - } + }//end if return $resultat; } public function getXmlValueByTag($inXmlset, $needle) { - $resource = xml_parser_create(); //Create an XML parser - xml_parse_into_struct($resource, $inXmlset, $outArray); // Parse XML data into an array structure - xml_parser_free($resource); //Free an XML parser + $resource = xml_parser_create(); +// Create an XML parser + xml_parse_into_struct($resource, $inXmlset, $outArray); +// Parse XML data into an array structure + xml_parser_free($resource); +// Free an XML parser $count = count($outArray); for ($i = 0; $i < $count; $i++) { if ($outArray[$i]['tag'] == strtoupper($needle)) { @@ -682,7 +682,7 @@ class Mercanet curl_setopt($ch, CURLOPT_PORT, 443); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); $result = curl_exec($ch); - $info = curl_getinfo($ch); + $info = curl_getinfo($ch); if (!$result) { dd('toto', $this->parameters['transactionReference']); @@ -731,7 +731,7 @@ class Mercanet $this->parameters['transactionReference'] )); return (object)['status' => 'KO', 'code' => 500]; - } + }//end if } public function quickPayment($amount, $ref) diff --git a/app/Lib/MesBR.php b/app/Lib/MesBR.php index c5617076..926bbae4 100644 --- a/app/Lib/MesBR.php +++ b/app/Lib/MesBR.php @@ -4,7 +4,6 @@ namespace App\Lib; class MesBR { - private $endpoint; private $refCamp; @@ -12,7 +11,7 @@ class MesBR public function __construct($endpoint, $refCamp) { $this->endpoint = $endpoint; - $this->refCamp = $refCamp; + $this->refCamp = $refCamp; } public function createCustomer(string $hashcode, string $email, string $country) { @@ -38,7 +37,7 @@ class MesBR } private function callApi($method, $url, $data = []) { - $url = $this->endpoint . '/api/v1' . $url; + $url = $this->endpoint . '/api/v1' . $url; $curl = curl_init(); switch ($method) { case "POST": diff --git a/app/Lib/Utils.php b/app/Lib/Utils.php index 06972517..2d27816f 100644 --- a/app/Lib/Utils.php +++ b/app/Lib/Utils.php @@ -106,9 +106,9 @@ class Utils /** * Multibyte strtr * - * @param string $str + * @param string $str * @param string|array $from - * @param string|null $to + * @param string|null $to * @return string */ public static function mbStrtr($str, $from, $to = null): string @@ -137,7 +137,7 @@ class Utils '/(?P(?:http[s]?:\/\/.)?(?:www\.)?[-a-zA-Z0-9@%._\+~#=]{2,256}\.[a-z]{2,6}\b(?:[-a-zA-Z0-9@:%_\+.~#?&\/\/=]*))/', function ($matches) use ($routes, $field) { $match = collect($matches)->first() ?? ''; - $url = $match; + $url = $match; try { $request = Request::create($url); // if a route is match then it do not throws exception @@ -159,7 +159,7 @@ class Utils public static function dotStringToNestedArray($path, $value, $separator = '.') { - $arr = $value; + $arr = $value; $keys = array_reverse(explode($separator, $path)); foreach ($keys as $key) { @@ -173,14 +173,14 @@ class Utils * if a string is passed then the store action is ignored and the strieng is returned * * @param \Illuminate\Http\UploadedFile|\SplFileInfo|string $image - * @param string $folderName + * @param string $folderName * @return string The storage path */ public static function storeImage($image, string $folderName): string { if (\is_object($image) and get_class($image) === UploadedFile::class) { /** @var UploadedFile */ - $image = $image; + $image = $image; $newPath = self::prepareMoveFile($image->getClientOriginalName(), $folderName); $newPath = str_replace(storage_path('app'), '', $newPath); $image->storePubliclyAs(pathinfo($newPath, \PATHINFO_DIRNAME), pathinfo($newPath, \PATHINFO_BASENAME)); @@ -188,7 +188,7 @@ class Utils } if (\is_object($image) and get_class($image) === SplFileInfo::class) { /** @var SplFileInfo */ - $image = $image; + $image = $image; $newPath = self::prepareMoveFile($image->getBaseName(), $folderName); if (!File::copy($image->getRealPath(), $newPath)) { throw new \Exception(sprintf( @@ -256,8 +256,8 @@ class Utils /** * Generate an unique pseudo * - * @param string $firstname - * @param string $lastname + * @param string $firstname + * @param string $lastname * @param integer $i * @return void */ @@ -294,20 +294,20 @@ class Utils */ private static function getAnonymizedStackTrace(Throwable $e): string { - $projectPath = \realpath(\sprintf('%s/../', \app_path())); - $traceStack = $e->getTrace(); - $traceStr = ''; + $projectPath = \realpath(\sprintf('%s/../', \app_path())); + $traceStack = $e->getTrace(); + $traceStr = ''; $maxStackStage = 0; foreach ($traceStack as $stackStage => $stack) { $maxStackStage = $stackStage; - $traceStr .= \sprintf( + $traceStr .= \sprintf( '#%s %s(%d): ', $stackStage, str_replace($projectPath, '', $stack['file']), $stack['line'] ); - $traceStr .= "{$stack['class']}->{$stack['function']}("; - $traceArgs = ''; + $traceStr .= "{$stack['class']}->{$stack['function']}("; + $traceArgs = ''; if (isset($stack['args'])) { $argsCount = count($stack['args']); for ($i = 0; $i < $argsCount; $i++) { @@ -328,9 +328,9 @@ class Utils $traceArgs .= ($i !== ($argsCount - 1) ? ',' : ''); } $traceStr .= $traceArgs; - } + }//end if $traceStr .= ")\n"; - } + }//end foreach $maxStackStage++; $traceStr .= "#$maxStackStage {main}"; return $traceStr; diff --git a/app/Listeners/CreateNotification.php b/app/Listeners/CreateNotification.php index d5e51527..2a3daaa4 100644 --- a/app/Listeners/CreateNotification.php +++ b/app/Listeners/CreateNotification.php @@ -9,7 +9,7 @@ class CreateNotification /** * Handle the event. * - * @param NewNotification $event + * @param NewNotification $event * @return void */ public function handle(NewNotification $event) diff --git a/app/Mail/ContactMail.php b/app/Mail/ContactMail.php index f35041ac..465f7813 100644 --- a/app/Mail/ContactMail.php +++ b/app/Mail/ContactMail.php @@ -84,14 +84,14 @@ class ContactMail extends Mailable */ protected function makeCsvFile(): string { - //we create the CSV into memory - // FILENAME + // we create the CSV into memory + // FILENAME $csv = Writer::createFromFileObject(new SplTempFileObject()); $csv->setDelimiter(';'); $csv->setEnclosure('"'); $csv->setOutputBOM(Writer::BOM_UTF8); - //we insert the CSV header + // we insert the CSV header $csv->insertOne([ 'EMETTEUR_DATE', 'EMETTEUR_HEURE', 'EMETTEUR_CIVILITE', 'EMETTEUR_NOM', 'EMETTEUR_PRENOM', 'EMETTEUR_ADRESSE', 'EMETTEUR_CP', 'EMETTEUR_VILLE', 'EMETTEUR_EMAIL', 'EMETTEUR_OBJETDEMANDE', diff --git a/app/Mail/ContactMailNL.php b/app/Mail/ContactMailNL.php index 22c34ae3..e980f75c 100644 --- a/app/Mail/ContactMailNL.php +++ b/app/Mail/ContactMailNL.php @@ -79,14 +79,14 @@ class ContactMailNL extends Mailable */ protected function makeCsvFile(): string { - //we create the CSV into memory - // FILENAME + // we create the CSV into memory + // FILENAME $csv = Writer::createFromFileObject(new SplTempFileObject()); $csv->setDelimiter(';'); $csv->setEnclosure('"'); $csv->setOutputBOM(Writer::BOM_UTF8); - //we insert the CSV header + // we insert the CSV header $csv->insertOne([ 'EMETTEUR_DATE', 'EMETTEUR_HEURE', 'EMETTEUR_CIVILITE', 'EMETTEUR_NOM', 'EMETTEUR_PRENOM', 'EMETTEUR_ADRESSE', 'EMETTEUR_CP', 'EMETTEUR_VILLE', 'EMETTEUR_EMAIL', 'EMETTEUR_OBJETDEMANDE', diff --git a/app/Mail/PasswordResetMail.php b/app/Mail/PasswordResetMail.php index c1f0b7dd..5409dfff 100644 --- a/app/Mail/PasswordResetMail.php +++ b/app/Mail/PasswordResetMail.php @@ -31,7 +31,7 @@ class PasswordResetMail extends Mailable */ public function build() { - $token = $this->token; + $token = $this->token; $moment = Moments::where('status', 1)->orderBy('updated_at', 'DESC')->first(); return $this->subject("Réinitialiser votre accès au Club Le Gaulois") ->view('front.mails.password-reset', compact('token', 'moment')); diff --git a/app/Mail/RegisterConfirmMail.php b/app/Mail/RegisterConfirmMail.php index 72f99347..50214c41 100644 --- a/app/Mail/RegisterConfirmMail.php +++ b/app/Mail/RegisterConfirmMail.php @@ -26,7 +26,7 @@ class RegisterConfirmMail extends Mailable public function __construct(Customers $customer, string $firstname = null) { $this->firstname = $firstname; - $this->customer = $customer; + $this->customer = $customer; } /** @@ -36,7 +36,7 @@ class RegisterConfirmMail extends Mailable */ public function build() { - $customer = $this->customer; + $customer = $this->customer; $firstname = $this->firstname; return $this->subject("Confirmation d'inscription au Club Le Gaulois") ->view('front.mails.register-ok', compact('customer', 'firstname')); diff --git a/app/Models/Actu.php b/app/Models/Actu.php index 88163140..cf5a9596 100644 --- a/app/Models/Actu.php +++ b/app/Models/Actu.php @@ -29,8 +29,8 @@ class Actu extends Model protected static function booted() { static::creating(function (Actu $actu) { - $actu->slug = Str::slug($actu->title); - $actu->header = clean($actu->header); + $actu->slug = Str::slug($actu->title); + $actu->header = clean($actu->header); $actu->content = clean($actu->content); // actu non mise en avvant si pas publié if (!$actu->status) { @@ -38,8 +38,8 @@ class Actu extends Model } }); static::updating(function (Actu $actu) { - $actu->slug = Str::slug($actu->title); - $actu->header = clean($actu->header); + $actu->slug = Str::slug($actu->title); + $actu->header = clean($actu->header); $actu->content = clean($actu->content); // actu non mise en avvant si pas publié if (!$actu->status) { diff --git a/app/Models/Ads.php b/app/Models/Ads.php index 810b9c94..6f397ad2 100644 --- a/app/Models/Ads.php +++ b/app/Models/Ads.php @@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model; class Ads extends Model { - // } diff --git a/app/Models/BlockList.php b/app/Models/BlockList.php index 93069954..06536808 100644 --- a/app/Models/BlockList.php +++ b/app/Models/BlockList.php @@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model; class BlockList extends Model { - protected $fillable = [ 'customer_id','blocked_id' ]; diff --git a/app/Models/BreederPortrait.php b/app/Models/BreederPortrait.php index 656b7409..cf3b94a6 100644 --- a/app/Models/BreederPortrait.php +++ b/app/Models/BreederPortrait.php @@ -6,7 +6,6 @@ use Illuminate\Support\Facades\Storage; class BreederPortrait extends BreederForGmap { - protected $fillable = [ 'title', 'subtitle', diff --git a/app/Models/Contact.php b/app/Models/Contact.php index 1470711e..3c283c9d 100644 --- a/app/Models/Contact.php +++ b/app/Models/Contact.php @@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Model; class Contact extends Model { - protected $primaryKey = 'date'; public $timestamps = false; @@ -19,7 +18,8 @@ class Contact extends Model return $contact; }); static::updating(function ($contact) { - $contact->all++; // increment general counter + $contact->all++; +// increment general counter return $contact; }); } diff --git a/app/Models/Customers.php b/app/Models/Customers.php index e6623dcf..d3ee6cb0 100644 --- a/app/Models/Customers.php +++ b/app/Models/Customers.php @@ -51,7 +51,7 @@ class Customers extends Authenticatable */ public function conversations(): array { - $dateSort = function ($a, $b) { + $dateSort = function ($a, $b) { return Carbon::parse( $a->getRawOriginal('created_at') )->timestamp < Carbon::parse($b->getRawOriginal('created_at'))->timestamp; @@ -59,7 +59,7 @@ class Customers extends Authenticatable $messageFilter = function ($item) { return $item->all(); }; - $messageWith = [ + $messageWith = [ 'fromCustomer' => function ($q) { $q->select(['id', 'username', 'created_at']); }, @@ -83,7 +83,7 @@ class Customers extends Authenticatable $output = $receivedM->mapWithKeys(function ($messagesArray, $fromUsername) use (&$sentM, $dateSort) { $responses = collect(\array_merge($sentM->pull($fromUsername) ?? [], $messagesArray))->sort($dateSort); - $last = $responses->first(); + $last = $responses->first(); return [$fromUsername => collect([ 'to' => $fromUsername, 'to_id' => collect($messagesArray)->first()->fromCustomer->id, @@ -96,8 +96,8 @@ class Customers extends Authenticatable })->toBase(); // map sur les message envoyés (qui n'ont pas encore eu de réponses) $outputSentM = $sentM->mapWithKeys(function ($messagesArray) { - $sent = collect($messagesArray); - $last = $sent->first(); + $sent = collect($messagesArray); + $last = $sent->first(); $toCustomer = $last->toCustomer; $toUserName = $toCustomer->username; return [$toUserName => collect([ @@ -211,8 +211,8 @@ class Customers extends Authenticatable * Set the rating for this customer * * @param Recipes $recipe - * @param float $rating - * @return bool + * @param float $rating + * @return boolean */ public function setRecipeRating(Recipes $recipe, float $rating) { @@ -237,7 +237,7 @@ class Customers extends Authenticatable public function getApiDataAttribute(): CrmCustomer { /** @var \LDC\LDCCRM\CrmApiV2 */ - $crm = app('crmAPI'); + $crm = app('crmAPI'); $crmCustomer = $crm->getCustomer($this->hashcode); if (!$crmCustomer) { throw new CrmException('CRM get Customer returned null'); @@ -262,7 +262,7 @@ class Customers extends Authenticatable $data = $resource->toArray(null); /** @var \LDC\LDCCRM\CrmApiV2 */ - $crm = app('crmAPI'); + $crm = app('crmAPI'); $crmCustomer = $crm->getCustomer($data['hashcode']); if (!$crmCustomer) { throw new CrmException('CRM get Customer returned null'); diff --git a/app/Models/DepartaimantsCollection.php b/app/Models/DepartaimantsCollection.php index 31d64541..9c223afd 100644 --- a/app/Models/DepartaimantsCollection.php +++ b/app/Models/DepartaimantsCollection.php @@ -33,14 +33,15 @@ class DepartaimantsCollection extends Model protected $table = 'departaimants'; - private static $columnTableNamePrefix = 'col'; // Le prefix d'un table departaimant - - private static $tableFields = 4; // Le nombre de colonnes des departaimants - - private static $departementWidth = 2; // La largeur en bits d'un départaimant - + private static $columnTableNamePrefix = 'col'; +// Le prefix d'un table departaimant + private static $tableFields = 4; +// Le nombre de colonnes des departaimants + private static $departementWidth = 2; +// La largeur en bits d'un départaimant public $attributes = [ - 'type' => 'current' // to be set in construct + 'type' => 'current' +// to be set in construct ]; public $fillable = [ @@ -105,7 +106,7 @@ class DepartaimantsCollection extends Model * Checks if this collection has a Departaimant * * @param Departaimant $departaimant - * @return bool + * @return boolean */ public function has(Departaimant $departaimant): bool { @@ -115,28 +116,29 @@ class DepartaimantsCollection extends Model /** * Set the Departaimant to a specific status * - * @param Departaimant $departaimant + * @param Departaimant $departaimant * @param DepartaimantStatus $status * @return void */ public function set(Departaimant $departaimant, DepartaimantStatus $status): void { - $depCol = static::depColInTable($this->type, $departaimant); + $depCol = static::depColInTable($this->type, $departaimant); $tableName = sprintf('%s%d', static::$columnTableNamePrefix, static::depField($this->type, $departaimant)); $this->reset($departaimant); - $this->$tableName |= ($status->value << $depCol); // OR + $this->$tableName |= ($status->value << $depCol); +// OR } /** * Test the Departaimant status * - * @param Departaimant $departaimant + * @param Departaimant $departaimant * @param DepartaimantStatus $status - * @return bool + * @return boolean */ public function status(Departaimant $departaimant, DepartaimantStatus $status): bool { - $depCol = static::depColInTable($this->type, $departaimant); + $depCol = static::depColInTable($this->type, $departaimant); $tableName = sprintf('%s%d', static::$columnTableNamePrefix, static::depField($this->type, $departaimant)); /** * On créer le masque, puis on le décale vers la gauche de $depCol @@ -152,8 +154,8 @@ class DepartaimantsCollection extends Model * Get all Customer which has their departaimant with a status * * @param DepartaimantCollectionType $depColtype - * @param Departaimant $departaimant - * @param DepartaimantStatus $status + * @param Departaimant $departaimant + * @param DepartaimantStatus $status * @return Illuminate\Database\Eloquent\Builder */ public static function getCustomersWithStatusAndDepartaimant( @@ -161,7 +163,7 @@ class DepartaimantsCollection extends Model Departaimant $departaimant, DepartaimantStatus $status ): Builder { - $depCol = self::depColInTable($depColtype, $departaimant); + $depCol = self::depColInTable($depColtype, $departaimant); $tableName = sprintf('%s%d', self::$columnTableNamePrefix, self::depField($depColtype, $departaimant)); /** * On créer le masque, puis on le décale vers la gauche de $depCol @@ -179,8 +181,8 @@ class DepartaimantsCollection extends Model /** * Get all Customer which has their departaimant with a status * - * @param array $departaimants - * @param DepartaimantStatus $status + * @param array $departaimants + * @param DepartaimantStatus $status * @param DepartaimantCollectionType $type * @return Builder */ @@ -189,12 +191,12 @@ class DepartaimantsCollection extends Model DepartaimantStatus $status, DepartaimantCollectionType $type ): Builder { - $req = static::where('type', $type->value); + $req = static::where('type', $type->value); $whereReq = ''; - $i = 0; + $i = 0; foreach ($departaimants as $k => $departaimant) { - $depCol = self::depColInTable($type, $departaimant); + $depCol = self::depColInTable($type, $departaimant); $tableName = sprintf('%s%d', self::$columnTableNamePrefix, self::depField($type, $departaimant)); /** * On créer le masque, puis on le décale vers la gauche de $depCol @@ -202,7 +204,7 @@ class DepartaimantsCollection extends Model * Puis on la redécale vers la droite * Enfin on la compare à l'énum DepartaimantStatus::has()->value */ - $mask = bindec(str_replace('0', '1', decbin(self::$departementWidth))) << $depCol; + $mask = bindec(str_replace('0', '1', decbin(self::$departementWidth))) << $depCol; $whereReq .= sprintf('((%d << %d) = (%s & %d)) ', $status->value, $depCol, $tableName, $mask); if ($i++ !== count($departaimants) - 1) { $whereReq .= " OR "; @@ -222,7 +224,7 @@ class DepartaimantsCollection extends Model */ public function getStatus(Departaimant $departaimant): DepartaimantStatus { - $depCol = static::depColInTable($this->type, $departaimant); + $depCol = static::depColInTable($this->type, $departaimant); $tableName = sprintf('%s%d', static::$columnTableNamePrefix, static::depField($this->type, $departaimant)); /** * On créer le masque, puis on le décale vers la gauche de $depCol @@ -248,7 +250,7 @@ class DepartaimantsCollection extends Model $departaimant = static::getDepType($this->type); foreach (static::getDepKeys($this->type) as $depKey) { /** @var Departaimant */ - $dep = \forward_static_call([\get_class($departaimant), 'make'], $depKey); + $dep = \forward_static_call([\get_class($departaimant), 'make'], $depKey); $deps[$depKey] = (object)[ 'departaimant' => $dep, 'status' => $this->getStatus($dep) @@ -261,7 +263,7 @@ class DepartaimantsCollection extends Model * Get a list of all the departaimants and their status * * @param DepartaimantCollectionType $depColtype - * @param DepartaimantStatus $status + * @param DepartaimantStatus $status * @uses Departaimant * @uses DepartaimantStatus * @return array[object] with departaimant: \App\Enums\Departaimant, status:\App\Enums\DepartaimantStatus @@ -294,9 +296,10 @@ class DepartaimantsCollection extends Model */ private function reset(Departaimant $departaimant): void { - $depCol = static::depColInTable($this->type, $departaimant); - $tableName = sprintf('%s%d', static::$columnTableNamePrefix, static::depField($this->type, $departaimant)); - $this->$tableName &= ~(DepartaimantStatus::wants()->value << $depCol); // AND max enum value + $depCol = static::depColInTable($this->type, $departaimant); + $tableName = sprintf('%s%d', static::$columnTableNamePrefix, static::depField($this->type, $departaimant)); + $this->$tableName &= ~(DepartaimantStatus::wants()->value << $depCol); +// AND max enum value } /** @@ -304,14 +307,14 @@ class DepartaimantsCollection extends Model * le département * * @param DepartaimantCollectionType $depColtype - * @param Departaimant $dep - * @return int + * @param Departaimant $dep + * @return integer */ public static function depField(DepartaimantCollectionType $depColtype, Departaimant $dep): int { - $fieldCols = self::getTableColumnWith(); + $fieldCols = self::getTableColumnWith(); $totalFieldCols = self::$tableFields * $fieldCols; - $depsPerField = floor($totalFieldCols / self::$tableFields); + $depsPerField = floor($totalFieldCols / self::$tableFields); return (int)floor((array_search( '.' . $dep->value, array_keys(self::getDeps($depColtype)) @@ -323,15 +326,15 @@ class DepartaimantsCollection extends Model * Dans sa 'table' (colonne SQL) * * @param DepartaimantCollectionType $depColtype - * @param Departaimant $dep - * @return int + * @param Departaimant $dep + * @return integer */ public static function depColInTable(DepartaimantCollectionType $depColtype, Departaimant $dep): int { $tableColumnWith = self::getTableColumnWith(); - $depsKeys = self::getDepKeys($depColtype); - $size = count($depsKeys); - $i = 0; + $depsKeys = self::getDepKeys($depColtype); + $size = count($depsKeys); + $i = 0; for ($a = 0; $a < $size; $a++) { if ($dep->value == $depsKeys[$a]) { return $i * self::$departementWidth; @@ -345,7 +348,7 @@ class DepartaimantsCollection extends Model * Donne la valeur (masque binaire) d'un département * * @param Departaimant $dep - * @return int + * @return integer */ public function depVal(Departaimant $dep): int { @@ -361,14 +364,14 @@ class DepartaimantsCollection extends Model private static function getDeps(DepartaimantCollectionType $depColtype): array { $tableColumnWith = self::getTableColumnWith(); - $o = []; - $i = 0; - $depsKeys = self::getDepKeys($depColtype); - $size = count($depsKeys); + $o = []; + $i = 0; + $depsKeys = self::getDepKeys($depColtype); + $size = count($depsKeys); for ($a = 0; $a < $size; $a++) { // Appending '.' as a hack to prevent PHP from casting numeric indexes $o['.' . $depsKeys[$a]] = 1 << $i * self::$departementWidth; - $i = $i >= ($tableColumnWith - 1) ? 0 : $i + 1; + $i = $i >= ($tableColumnWith - 1) ? 0 : $i + 1; } return $o; } diff --git a/app/Models/Engagement.php b/app/Models/Engagement.php index 2e6826a6..8f2fca5e 100644 --- a/app/Models/Engagement.php +++ b/app/Models/Engagement.php @@ -36,7 +36,8 @@ class Engagement extends Model 'pretitle' => '', 'metaTitle' => '', 'metaDescription' => '', - 'type' => 1, // EngagementType article + 'type' => 1, +// EngagementType article ]; protected static function booted() @@ -61,7 +62,7 @@ class Engagement extends Model /** * Fill the model with an array of attributes. * - * @param array $attributes + * @param array $attributes * @return $this * * @throws \Illuminate\Database\Eloquent\MassAssignmentException @@ -324,9 +325,9 @@ class Engagement extends Model 'Unknown input Type %s', $input['inputType']->label ?? $input['inputType']['label'] )); - } - } - } + }//end switch + }//end foreach + }//end foreach return json_encode($content); } @@ -334,7 +335,7 @@ class Engagement extends Model { if (\is_object($image) and get_class($image) === UploadedFile::class) { /** @var UploadedFile */ - $image = $image; + $image = $image; $newPath = $this->prepareMoveFile($image->getClientOriginalName()); $newPath = str_replace(storage_path('app'), '', $newPath); $image->storePubliclyAs(pathinfo($newPath, \PATHINFO_DIRNAME), pathinfo($newPath, \PATHINFO_BASENAME)); @@ -342,7 +343,7 @@ class Engagement extends Model } if (\is_object($image) and get_class($image) === SplFileInfo::class) { /** @var SplFileInfo */ - $image = $image; + $image = $image; $newPath = $this->prepareMoveFile($image->getBaseName()); if (!File::copy($image->getRealPath(), $newPath)) { throw new \Exception(sprintf( diff --git a/app/Models/FaqQuestions.php b/app/Models/FaqQuestions.php index 1c75829e..81d897d0 100644 --- a/app/Models/FaqQuestions.php +++ b/app/Models/FaqQuestions.php @@ -15,7 +15,7 @@ class FaqQuestions extends Model { $pourcent = 0; if ($this->positive_vote >= $this->negative_vote && $this->positive_vote > 0 && $this->negative_vote > 0) { - $ratio = $this->negative_vote / $this->positive_vote; + $ratio = $this->negative_vote / $this->positive_vote; $pourcent = ceil((1 - $ratio) * 100); } diff --git a/app/Models/HomeSliderPictures.php b/app/Models/HomeSliderPictures.php index e29dc4f8..c8e1e104 100644 --- a/app/Models/HomeSliderPictures.php +++ b/app/Models/HomeSliderPictures.php @@ -8,7 +8,6 @@ use Illuminate\Database\Eloquent\Model; class HomeSliderPictures extends Model { - /** * The attributes that should be cast. * diff --git a/app/Models/IncoNutritionalValues.php b/app/Models/IncoNutritionalValues.php index f5aacb74..941d0399 100644 --- a/app/Models/IncoNutritionalValues.php +++ b/app/Models/IncoNutritionalValues.php @@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model; class IncoNutritionalValues extends Model { - protected $fillable = [ 'energy', 'energy_kj', @@ -50,7 +49,7 @@ class IncoNutritionalValues extends Model 'sel_r' => 'salt', 'pourcent_apport_ref_salteq_r' => 'salt_percent' ]; - $o = []; + $o = []; foreach ($cvt as $k => $t) { $o[$t] = $xmlInco[$k] ?? null; diff --git a/app/Models/Label.php b/app/Models/Label.php index 1dc0476c..b1836c98 100644 --- a/app/Models/Label.php +++ b/app/Models/Label.php @@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Model; class Label extends Model { - protected $fillable = [ 'name', 'status' diff --git a/app/Models/MailContactData.php b/app/Models/MailContactData.php index f1e4cfe1..44fe02f1 100644 --- a/app/Models/MailContactData.php +++ b/app/Models/MailContactData.php @@ -150,10 +150,14 @@ class MailContactData extends Model 'LIEU_ACHAT' => $this->buyPlace, // FUCK passerelle et leur DTD qui n'existe pas cf: resources/documents - 'EMETTEUR_OBJETDEMANDE' => 3, // Recla conso ? - 'EMETTEUR_OPT_IN' => '', // doit être vide ? - 'REPONSE_ETAT' => 0, // c'est quoi ça ? - 'TYPE_REPONSE' => 'mail' // ok + 'EMETTEUR_OBJETDEMANDE' => 3, +// Recla conso ? + 'EMETTEUR_OPT_IN' => '', +// doit être vide ? + 'REPONSE_ETAT' => 0, +// c'est quoi ça ? + 'TYPE_REPONSE' => 'mail' +// ok ]; } } diff --git a/app/Models/MeatTypes.php b/app/Models/MeatTypes.php index 0acb41f8..8de954bb 100644 --- a/app/Models/MeatTypes.php +++ b/app/Models/MeatTypes.php @@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Model; class MeatTypes extends Model { - protected $fillable = [ 'name', 'status' diff --git a/app/Models/Message.php b/app/Models/Message.php index cdffc5f3..60d67ab0 100644 --- a/app/Models/Message.php +++ b/app/Models/Message.php @@ -8,7 +8,6 @@ use Illuminate\Support\Carbon; class Message extends Model { - protected $casts = [ 'created_at' => NiceDate::class, ]; diff --git a/app/Models/MomentStrates.php b/app/Models/MomentStrates.php index dbca2162..6620c594 100644 --- a/app/Models/MomentStrates.php +++ b/app/Models/MomentStrates.php @@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model; class MomentStrates extends Model { - protected $table = "moment_strates"; protected static function booted() diff --git a/app/Models/NewsSliderPictures.php b/app/Models/NewsSliderPictures.php index b8cdf7b0..68f69eb5 100644 --- a/app/Models/NewsSliderPictures.php +++ b/app/Models/NewsSliderPictures.php @@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model; class NewsSliderPictures extends Model { - protected $hidden = [ 'id', 'order', diff --git a/app/Models/Notifications.php b/app/Models/Notifications.php index 5708fd68..6555484b 100644 --- a/app/Models/Notifications.php +++ b/app/Models/Notifications.php @@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Model; class Notifications extends Model { - protected $enumCasts = [ 'type' => NotificationType::class ]; diff --git a/app/Models/OCBWaitingList.php b/app/Models/OCBWaitingList.php index 16c6994f..f82f223a 100644 --- a/app/Models/OCBWaitingList.php +++ b/app/Models/OCBWaitingList.php @@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model; class OCBWaitingList extends Model { - protected $table = 'ocb_breeder_inauv_waiting_list'; protected $fillable = [ diff --git a/app/Models/OrderSellItem.php b/app/Models/OrderSellItem.php index 3ef426b4..aa6c3122 100644 --- a/app/Models/OrderSellItem.php +++ b/app/Models/OrderSellItem.php @@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Relations\Pivot; class OrderSellItem extends Pivot { - // } diff --git a/app/Models/PageJoinus.php b/app/Models/PageJoinus.php index 642febb9..ae3b2794 100644 --- a/app/Models/PageJoinus.php +++ b/app/Models/PageJoinus.php @@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model; class PageJoinus extends Model { - protected $table = 'page_joinus'; public $timestamps = false; diff --git a/app/Models/PasswordReset.php b/app/Models/PasswordReset.php index 0816d67b..f00a505a 100644 --- a/app/Models/PasswordReset.php +++ b/app/Models/PasswordReset.php @@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model; class PasswordReset extends Model { - protected $table = "password_resets"; public $timestamps = false; diff --git a/app/Models/Products.php b/app/Models/Products.php index 85cb6d29..96d2192a 100644 --- a/app/Models/Products.php +++ b/app/Models/Products.php @@ -7,7 +7,6 @@ use Illuminate\Support\Facades\Session; class Products extends Model { - protected $casts = [ 'star' => 'boolean' ]; @@ -20,14 +19,14 @@ class Products extends Model $inc->product()->associate($inc); } $product->preparation_advice = clean($product->preparation_advice); - $product->ingredients = clean($product->ingredients); - $product->tips = clean($product->tips); + $product->ingredients = clean($product->ingredients); + $product->tips = clean($product->tips); self::setStarLogic($product); }); static::updating(function (Products $product) { $product->preparation_advice = clean($product->preparation_advice); - $product->ingredients = clean($product->ingredients); - $product->tips = clean($product->tips); + $product->ingredients = clean($product->ingredients); + $product->tips = clean($product->tips); self::setStarLogic($product); if ($product->status !== $product->getOriginal('status')) { @@ -121,7 +120,7 @@ class Products extends Model $rangeStarProductQuery = Products::whereStar(true)->whereHas('range', function ($q) use ($product) { $q->whereId($product->range_id); }); - $removedAllStar = false; + $removedAllStar = false; // * Make sur only one product is star if ($product->star and $product->range_id) { // * Ensure only one product will be star for this range diff --git a/app/Models/Range.php b/app/Models/Range.php index a696a323..a05734ca 100644 --- a/app/Models/Range.php +++ b/app/Models/Range.php @@ -7,7 +7,6 @@ use Illuminate\Support\Str; class Range extends Model { - protected $attributes = [ 'flagship_product' => null ]; diff --git a/app/Models/Rating.php b/app/Models/Rating.php index 191e7a23..1e7dc61b 100644 --- a/app/Models/Rating.php +++ b/app/Models/Rating.php @@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model; class Rating extends Model { - protected $fillable = [ 'total', 'count', 'rating' ]; diff --git a/app/Models/Recipes.php b/app/Models/Recipes.php index 121ce0e8..38765cb7 100644 --- a/app/Models/Recipes.php +++ b/app/Models/Recipes.php @@ -45,16 +45,16 @@ class Recipes extends Model protected static function booted() { static::creating(function ($recipe) { - $recipe->slug = Str::slug($recipe->title); + $recipe->slug = Str::slug($recipe->title); $recipe->ingredients = clean($recipe->ingredients); $recipe->preparation = clean($recipe->preparation); - $recipe->advice = clean($recipe->advice); + $recipe->advice = clean($recipe->advice); }); static::updating(function ($recipe) { - $recipe->slug = Str::slug($recipe->title); + $recipe->slug = Str::slug($recipe->title); $recipe->ingredients = clean($recipe->ingredients); $recipe->preparation = clean($recipe->preparation); - $recipe->advice = clean($recipe->advice); + $recipe->advice = clean($recipe->advice); }); } @@ -74,10 +74,10 @@ class Recipes extends Model */ public function associatedRecipes() { - $recipesLimit = 3; - $rangeID = $this->products()->first()->range->id ?? 0; + $recipesLimit = 3; + $rangeID = $this->products()->first()->range->id ?? 0; $preparationTime = $this->preparation_time ?? 0; - $cookingTime = $this->cooking_time ?? 0; + $cookingTime = $this->cooking_time ?? 0; $recipes = Recipes::where('id', '!=', $this->id) ->where('status', true) @@ -174,7 +174,7 @@ class Recipes extends Model { $total = ($this->rating->total ?? 0) + $rating; $count = ($this->rating->count ?? 0) + 1; - $o = [ + $o = [ 'total' => $total, 'count' => $count, 'rating' => $count ? floatval($total / $count) : 0 diff --git a/app/Models/RecipesArticles.php b/app/Models/RecipesArticles.php index 7e741120..1b2369de 100644 --- a/app/Models/RecipesArticles.php +++ b/app/Models/RecipesArticles.php @@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Model; class RecipesArticles extends Model { - // } diff --git a/app/Models/Reduction.php b/app/Models/Reduction.php index 3fcc2633..8ea8320a 100644 --- a/app/Models/Reduction.php +++ b/app/Models/Reduction.php @@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Model; class Reduction extends Model { - public $fillable = [ 'code', 'name', 'value', 'used', 'desktop_image_available', 'mobile_image_available' @@ -32,7 +31,7 @@ class Reduction extends Model { // On récupère les réductions depuis MesBR /** @var \App\Lib\MesBR */ - $mesBR = app('mesBR'); + $mesBR = app('mesBR'); $mesBrReduction = $mesBR->getMur(); if ($mesBrReduction->status !== 'OK' or !isset($mesBrReduction->coupons)) { diff --git a/app/Models/SubRange.php b/app/Models/SubRange.php index 35910143..b2eced04 100644 --- a/app/Models/SubRange.php +++ b/app/Models/SubRange.php @@ -25,14 +25,14 @@ class SubRange extends Model protected static function booted() { static::creating(function (SubRange $subRange) { - $subRange->title = clean($subRange->title); + $subRange->title = clean($subRange->title); $subRange->content = clean($subRange->content); - $subRange->slug = Str::slug($subRange->name); + $subRange->slug = Str::slug($subRange->name); }); static::updating(function (SubRange $subRange) { - $subRange->title = clean($subRange->title); + $subRange->title = clean($subRange->title); $subRange->content = clean($subRange->content); - $subRange->slug = Str::slug($subRange->name); + $subRange->slug = Str::slug($subRange->name); }); } diff --git a/app/Models/SurveysAnswers.php b/app/Models/SurveysAnswers.php index 2cbf9538..f12b2f80 100644 --- a/app/Models/SurveysAnswers.php +++ b/app/Models/SurveysAnswers.php @@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model; class SurveysAnswers extends Model { - protected $table = 'surveys_answers'; protected $fillable = ['answer']; diff --git a/app/Models/Traceability.php b/app/Models/Traceability.php index 1252faa9..5a618f22 100644 --- a/app/Models/Traceability.php +++ b/app/Models/Traceability.php @@ -6,6 +6,5 @@ use Illuminate\Database\Eloquent\Model; class Traceability extends Model { - protected $table = 'tracability'; } diff --git a/app/Models/XmlBreeder.php b/app/Models/XmlBreeder.php index 849c48a1..2bb80a4b 100644 --- a/app/Models/XmlBreeder.php +++ b/app/Models/XmlBreeder.php @@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model; class XmlBreeder extends Model { - protected $fillable = [ "unique_key", "inuav_code", diff --git a/app/Models/XmlInco.php b/app/Models/XmlInco.php index 5472272d..f434fc06 100644 --- a/app/Models/XmlInco.php +++ b/app/Models/XmlInco.php @@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model; class XmlInco extends Model { - protected $fillable = [ 'id', 'no_art', diff --git a/app/Models/XmlTraceability.php b/app/Models/XmlTraceability.php index e18e8e93..7e9c4f12 100644 --- a/app/Models/XmlTraceability.php +++ b/app/Models/XmlTraceability.php @@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model; class XmlTraceability extends Model { - protected $table = 'xml_tracability'; protected $fillable = [ diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 93061aa0..1cfac46b 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -24,7 +24,6 @@ class AppServiceProvider extends ServiceProvider */ public function register() { - // } /** @@ -87,13 +86,13 @@ class AppServiceProvider extends ServiceProvider Log::critical($e->getMessage()); View::share('GeneralConfigGlobal', []); } - } + }//end if Blade::directive('svg', function ($arguments) { // Funky madness to accept multiple arguments into the directive list($path, $class) = array_pad(explode(',', trim($arguments, "() ")), 2, ''); - $path = trim($path, "' "); - $class = trim($class, "' "); + $path = trim($path, "' "); + $class = trim($class, "' "); // Create the dom document as per the other answers $svg = new \DOMDocument(); $svg->load(public_path($path)); diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 85d2153e..9c174f56 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -10,7 +10,6 @@ use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvid class AuthServiceProvider extends ServiceProvider { - /** * The policy mappings for the application. * @@ -29,7 +28,5 @@ class AuthServiceProvider extends ServiceProvider public function boot() { $this->registerPolicies(); - - // } } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 26fa71fb..ffa36710 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -10,7 +10,6 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvi class EventServiceProvider extends ServiceProvider { - /** * The event listener mappings for the application. * diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 7efc06b9..ed9f8ce8 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -37,7 +37,6 @@ use Kwaadpepper\Enum\Exceptions\EnumNotRoutableException; class RouteServiceProvider extends ServiceProvider { - /** * This namespace is applied to your controller routes. * @@ -178,8 +177,6 @@ class RouteServiceProvider extends ServiceProvider $this->mapApiRoutes(); $this->mapWebRoutes(); - - // } /** diff --git a/app/Providers/TranslationServiceProvider.php b/app/Providers/TranslationServiceProvider.php index a91772ef..7d7270ba 100644 --- a/app/Providers/TranslationServiceProvider.php +++ b/app/Providers/TranslationServiceProvider.php @@ -17,7 +17,8 @@ class TranslationServiceProvider extends ServiceProvider { $translations = collect(); - foreach ($this->collectLocalesStrings() as $locale) { // suported locales + foreach ($this->collectLocalesStrings() as $locale) { +// suported locales Cache::rememberForever(sprintf('translations.%s', $locale), function () use ($locale) { $translations = [ 'php' => $this->phpTranslations($locale), diff --git a/app/Traits/GoogleMapSerialize.php b/app/Traits/GoogleMapSerialize.php index 80f50896..9820c235 100644 --- a/app/Traits/GoogleMapSerialize.php +++ b/app/Traits/GoogleMapSerialize.php @@ -12,7 +12,7 @@ trait GoogleMapSerialize { public function googleMapSerialize() { - $type = $this->title ? GMapDataType::portrait() : GMapDataType::ocbbreeder(); + $type = $this->title ? GMapDataType::portrait() : GMapDataType::ocbbreeder(); $departaimant = false; // try to get the departement try { diff --git a/app/Traits/MiniAcfModel.php b/app/Traits/MiniAcfModel.php index ebf34049..a4616682 100644 --- a/app/Traits/MiniAcfModel.php +++ b/app/Traits/MiniAcfModel.php @@ -17,7 +17,7 @@ trait MiniAcfModel /** * Fill the model with an array of attributes. * - * @param array $attributes + * @param array $attributes * @return $this * * @throws \Illuminate\Database\Eloquent\MassAssignmentException @@ -175,9 +175,9 @@ trait MiniAcfModel 'Unknown input Type %s', $input['inputType']->label ?? $input['inputType']['label'] )); - } - } - } + }//end switch + }//end foreach + }//end foreach return json_encode($content); } diff --git a/app/Traits/MiniCrudModel.php b/app/Traits/MiniCrudModel.php index a1734a92..fcfd0c32 100644 --- a/app/Traits/MiniCrudModel.php +++ b/app/Traits/MiniCrudModel.php @@ -15,7 +15,7 @@ trait MiniCrudModel /** * Fill the model with an array of attributes. * - * @param array $attributes + * @param array $attributes * @return $this * * @throws \Illuminate\Database\Eloquent\MassAssignmentException diff --git a/config/app.php b/config/app.php index 88f3f058..88c2a9d9 100644 --- a/config/app.php +++ b/config/app.php @@ -3,53 +3,53 @@ return [ /* - |-------------------------------------------------------------------------- - | Application Name - |-------------------------------------------------------------------------- - | - | This value is the name of your application. This value is used when the - | framework needs to place the application's name in a notification or - | any other location as required by the application or its packages. - | + |-------------------------------------------------------------------------- + | Application Name + |-------------------------------------------------------------------------- + | + | This value is the name of your application. This value is used when the + | framework needs to place the application's name in a notification or + | any other location as required by the application or its packages. + | */ 'name' => env('APP_NAME', 'Laravel'), /* - |-------------------------------------------------------------------------- - | Application Environment - |-------------------------------------------------------------------------- - | - | This value determines the "environment" your application is currently - | running in. This may determine how you prefer to configure various - | services the application utilizes. Set this in your ".env" file. - | + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services the application utilizes. Set this in your ".env" file. + | */ 'env' => env('APP_ENV', 'production'), /* - |-------------------------------------------------------------------------- - | Application Debug Mode - |-------------------------------------------------------------------------- - | - | When your application is in debug mode, detailed error messages with - | stack traces will be shown on every error that occurs within your - | application. If disabled, a simple generic error page is shown. - | + |-------------------------------------------------------------------------- + | Application Debug Mode + |-------------------------------------------------------------------------- + | + | When your application is in debug mode, detailed error messages with + | stack traces will be shown on every error that occurs within your + | application. If disabled, a simple generic error page is shown. + | */ 'debug' => (bool)env('APP_DEBUG', false), /* - |-------------------------------------------------------------------------- - | Application URL - |-------------------------------------------------------------------------- - | - | This URL is used by the console to properly generate URLs when using - | the Artisan command line tool. You should set this to the root of - | your application so that it is used when running Artisan tasks. - | + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | your application so that it is used when running Artisan tasks. + | */ 'url' => env('APP_URL', 'http://localhost'), @@ -57,61 +57,61 @@ return [ 'asset_url' => env('ASSET_URL', null), /* - |-------------------------------------------------------------------------- - | Application Timezone - |-------------------------------------------------------------------------- - | - | Here you may specify the default timezone for your application, which - | will be used by the PHP date and date-time functions. We have gone - | ahead and set this to a sensible default for you out of the box. - | + |-------------------------------------------------------------------------- + | Application Timezone + |-------------------------------------------------------------------------- + | + | Here you may specify the default timezone for your application, which + | will be used by the PHP date and date-time functions. We have gone + | ahead and set this to a sensible default for you out of the box. + | */ 'timezone' => 'Europe/Paris', /* - |-------------------------------------------------------------------------- - | Application Locale Configuration - |-------------------------------------------------------------------------- - | - | The application locale determines the default locale that will be used - | by the translation service provider. You are free to set this value - | to any of the locales which will be supported by the application. - | + |-------------------------------------------------------------------------- + | Application Locale Configuration + |-------------------------------------------------------------------------- + | + | The application locale determines the default locale that will be used + | by the translation service provider. You are free to set this value + | to any of the locales which will be supported by the application. + | */ 'locale' => 'fr', /* - |-------------------------------------------------------------------------- - | Application Fallback Locale - |-------------------------------------------------------------------------- - | - | The fallback locale determines the locale to use when the current one - | is not available. You may change the value to correspond to any of - | the language folders that are provided through your application. - | + |-------------------------------------------------------------------------- + | Application Fallback Locale + |-------------------------------------------------------------------------- + | + | The fallback locale determines the locale to use when the current one + | is not available. You may change the value to correspond to any of + | the language folders that are provided through your application. + | */ 'fallback_locale' => 'en', /* - |-------------------------------------------------------------------------- - | Faker Locale - |-------------------------------------------------------------------------- - | - | This locale will be used by the Faker PHP library when generating fake - | data for your database seeds. For example, this will be used to get - | localized telephone numbers, street address information and more. - | + |-------------------------------------------------------------------------- + | Faker Locale + |-------------------------------------------------------------------------- + | + | This locale will be used by the Faker PHP library when generating fake + | data for your database seeds. For example, this will be used to get + | localized telephone numbers, street address information and more. + | */ 'faker_locale' => 'fr_FR', /* - |-------------------------------------------------------------------------- - | Variables spécifiques à l'application - |-------------------------------------------------------------------------- + |-------------------------------------------------------------------------- + | Variables spécifiques à l'application + |-------------------------------------------------------------------------- */ 'MESBR_REF_SITE' => env('MESBR_REF_SITE'), @@ -119,14 +119,14 @@ return [ 'MESBR_ENDPOINT' => env('MESBR_ENDPOINT'), /* - |-------------------------------------------------------------------------- - | Encryption Key - |-------------------------------------------------------------------------- - | - | This key is used by the Illuminate encrypter service and should be set - | to a random, 32 character string, otherwise these encrypted strings - | will not be safe. Please do this before deploying an application! - | + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is used by the Illuminate encrypter service and should be set + | to a random, 32 character string, otherwise these encrypted strings + | will not be safe. Please do this before deploying an application! + | */ 'key' => env('APP_KEY'), @@ -134,14 +134,14 @@ return [ 'cipher' => 'AES-256-CBC', /* - |-------------------------------------------------------------------------- - | Autoloaded Service Providers - |-------------------------------------------------------------------------- - | - | The service providers listed here will be automatically loaded on the - | request to your application. Feel free to add your own services to - | this array to grant expanded functionality to your applications. - | + |-------------------------------------------------------------------------- + | Autoloaded Service Providers + |-------------------------------------------------------------------------- + | + | The service providers listed here will be automatically loaded on the + | request to your application. Feel free to add your own services to + | this array to grant expanded functionality to your applications. + | */ 'providers' => [ @@ -190,14 +190,14 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Class Aliases - |-------------------------------------------------------------------------- - | - | This array of class aliases will be registered when this application - | is started. However, feel free to register as many as you wish as - | the aliases are "lazy" loaded so they don't hinder performance. - | + |-------------------------------------------------------------------------- + | Class Aliases + |-------------------------------------------------------------------------- + | + | This array of class aliases will be registered when this application + | is started. However, feel free to register as many as you wish as + | the aliases are "lazy" loaded so they don't hinder performance. + | */ 'aliases' => [ diff --git a/config/auth.php b/config/auth.php index 397c92e1..f220f181 100644 --- a/config/auth.php +++ b/config/auth.php @@ -3,14 +3,14 @@ return [ /* - |-------------------------------------------------------------------------- - | Authentication Defaults - |-------------------------------------------------------------------------- - | - | This option controls the default authentication "guard" and password - | reset options for your application. You may change these defaults - | as required, but they're a perfect start for most applications. - | + |-------------------------------------------------------------------------- + | Authentication Defaults + |-------------------------------------------------------------------------- + | + | This option controls the default authentication "guard" and password + | reset options for your application. You may change these defaults + | as required, but they're a perfect start for most applications. + | */ 'defaults' => [ @@ -19,20 +19,20 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Authentication Guards - |-------------------------------------------------------------------------- - | - | Next, you may define every authentication guard for your application. - | Of course, a great default configuration has been defined for you - | here which uses session storage and the Eloquent user provider. - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | Supported: "session", "token" - | + |-------------------------------------------------------------------------- + | Authentication Guards + |-------------------------------------------------------------------------- + | + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | here which uses session storage and the Eloquent user provider. + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | Supported: "session", "token" + | */ 'guards' => [ @@ -54,20 +54,20 @@ return [ ], /* - |-------------------------------------------------------------------------- - | User Providers - |-------------------------------------------------------------------------- - | - | All authentication drivers have a user provider. This defines how the - | users are actually retrieved out of your database or other storage - | mechanisms used by this application to persist your user's data. - | - | If you have multiple user tables or models you may configure multiple - | sources which represent each model / table. These sources may then - | be assigned to any extra authentication guards you have defined. - | - | Supported: "database", "eloquent" - | + |-------------------------------------------------------------------------- + | User Providers + |-------------------------------------------------------------------------- + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | If you have multiple user tables or models you may configure multiple + | sources which represent each model / table. These sources may then + | be assigned to any extra authentication guards you have defined. + | + | Supported: "database", "eloquent" + | */ 'providers' => [ @@ -83,18 +83,18 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Resetting Passwords - |-------------------------------------------------------------------------- - | - | You may specify multiple password reset configurations if you have more - | than one user table or model in the application and you want to have - | separate password reset settings based on the specific user types. - | - | The expire time is the number of minutes that the reset token should be - | considered valid. This security feature keeps tokens short-lived so - | they have less time to be guessed. You may change this as needed. - | + |-------------------------------------------------------------------------- + | Resetting Passwords + |-------------------------------------------------------------------------- + | + | You may specify multiple password reset configurations if you have more + | than one user table or model in the application and you want to have + | separate password reset settings based on the specific user types. + | + | The expire time is the number of minutes that the reset token should be + | considered valid. This security feature keeps tokens short-lived so + | they have less time to be guessed. You may change this as needed. + | */ 'passwords' => [ @@ -107,14 +107,14 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Password Confirmation Timeout - |-------------------------------------------------------------------------- - | - | Here you may define the amount of seconds before a password confirmation - | times out and the user is prompted to re-enter their password via the - | confirmation screen. By default, the timeout lasts for three hours. - | + |-------------------------------------------------------------------------- + | Password Confirmation Timeout + |-------------------------------------------------------------------------- + | + | Here you may define the amount of seconds before a password confirmation + | times out and the user is prompted to re-enter their password via the + | confirmation screen. By default, the timeout lasts for three hours. + | */ 'password_timeout' => 10800, diff --git a/config/breadcrumbs.php b/config/breadcrumbs.php index 6a7802d6..54e7efd3 100644 --- a/config/breadcrumbs.php +++ b/config/breadcrumbs.php @@ -3,51 +3,51 @@ return [ /* - |-------------------------------------------------------------------------- - | View Name - |-------------------------------------------------------------------------- - | - | Choose a view to display when Breadcrumbs::render() is called. - | Built in templates are: - | - | - 'breadcrumbs::bootstrap5' - Bootstrap 5 - | - 'breadcrumbs::bootstrap4' - Bootstrap 4 - | - 'breadcrumbs::bootstrap3' - Bootstrap 3 - | - 'breadcrumbs::bootstrap2' - Bootstrap 2 - | - 'breadcrumbs::bulma' - Bulma - | - 'breadcrumbs::foundation6' - Foundation 6 - | - 'breadcrumbs::json-ld' - JSON-LD Structured Data - | - 'breadcrumbs::materialize' - Materialize - | - 'breadcrumbs::tailwind' - Tailwind CSS - | - 'breadcrumbs::uikit' - UIkit - | - | Or a custom view, e.g. '_partials/breadcrumbs'. - | + |-------------------------------------------------------------------------- + | View Name + |-------------------------------------------------------------------------- + | + | Choose a view to display when Breadcrumbs::render() is called. + | Built in templates are: + | + | - 'breadcrumbs::bootstrap5' - Bootstrap 5 + | - 'breadcrumbs::bootstrap4' - Bootstrap 4 + | - 'breadcrumbs::bootstrap3' - Bootstrap 3 + | - 'breadcrumbs::bootstrap2' - Bootstrap 2 + | - 'breadcrumbs::bulma' - Bulma + | - 'breadcrumbs::foundation6' - Foundation 6 + | - 'breadcrumbs::json-ld' - JSON-LD Structured Data + | - 'breadcrumbs::materialize' - Materialize + | - 'breadcrumbs::tailwind' - Tailwind CSS + | - 'breadcrumbs::uikit' - UIkit + | + | Or a custom view, e.g. '_partials/breadcrumbs'. + | */ 'view' => 'front.breadcrumb.layout', /* - |-------------------------------------------------------------------------- - | Breadcrumbs File(s) - |-------------------------------------------------------------------------- - | - | The file(s) where breadcrumbs are defined. e.g. - | - | - base_path('routes/breadcrumbs.php') - | - glob(base_path('breadcrumbs/*.php')) - | + |-------------------------------------------------------------------------- + | Breadcrumbs File(s) + |-------------------------------------------------------------------------- + | + | The file(s) where breadcrumbs are defined. e.g. + | + | - base_path('routes/breadcrumbs.php') + | - glob(base_path('breadcrumbs/*.php')) + | */ 'files' => base_path('routes/breadcrumbs.php'), /* - |-------------------------------------------------------------------------- - | Exceptions - |-------------------------------------------------------------------------- - | - | Determine when to throw an exception. - | + |-------------------------------------------------------------------------- + | Exceptions + |-------------------------------------------------------------------------- + | + | Determine when to throw an exception. + | */ // When route-bound breadcrumbs are used but the current route doesn't have a name (UnnamedRouteException) @@ -60,12 +60,12 @@ return [ 'invalid-named-breadcrumb-exception' => true, /* - |-------------------------------------------------------------------------- - | Classes - |-------------------------------------------------------------------------- - | - | Subclass the default classes for more advanced customisations. - | + |-------------------------------------------------------------------------- + | Classes + |-------------------------------------------------------------------------- + | + | Subclass the default classes for more advanced customisations. + | */ // Manager diff --git a/config/broadcasting.php b/config/broadcasting.php index 3bba1103..758e3917 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -3,29 +3,29 @@ return [ /* - |-------------------------------------------------------------------------- - | Default Broadcaster - |-------------------------------------------------------------------------- - | - | This option controls the default broadcaster that will be used by the - | framework when an event needs to be broadcast. You may set this to - | any of the connections defined in the "connections" array below. - | - | Supported: "pusher", "redis", "log", "null" - | + |-------------------------------------------------------------------------- + | Default Broadcaster + |-------------------------------------------------------------------------- + | + | This option controls the default broadcaster that will be used by the + | framework when an event needs to be broadcast. You may set this to + | any of the connections defined in the "connections" array below. + | + | Supported: "pusher", "redis", "log", "null" + | */ 'default' => env('BROADCAST_DRIVER', 'null'), /* - |-------------------------------------------------------------------------- - | Broadcast Connections - |-------------------------------------------------------------------------- - | - | Here you may define all of the broadcast connections that will be used - | to broadcast events to other systems or over websockets. Samples of - | each available type of connection are provided inside this array. - | + |-------------------------------------------------------------------------- + | Broadcast Connections + |-------------------------------------------------------------------------- + | + | Here you may define all of the broadcast connections that will be used + | to broadcast events to other systems or over websockets. Samples of + | each available type of connection are provided inside this array. + | */ 'connections' => [ diff --git a/config/cache.php b/config/cache.php index 9b4d7ab7..57407307 100644 --- a/config/cache.php +++ b/config/cache.php @@ -5,30 +5,30 @@ use Illuminate\Support\Str; return [ /* - |-------------------------------------------------------------------------- - | Default Cache Store - |-------------------------------------------------------------------------- - | - | This option controls the default cache connection that gets used while - | using this caching library. This connection is used when another is - | not explicitly specified when executing a given caching function. - | - | Supported: "apc", "array", "database", "file", - | "memcached", "redis", "dynamodb" - | + |-------------------------------------------------------------------------- + | Default Cache Store + |-------------------------------------------------------------------------- + | + | This option controls the default cache connection that gets used while + | using this caching library. This connection is used when another is + | not explicitly specified when executing a given caching function. + | + | Supported: "apc", "array", "database", "file", + | "memcached", "redis", "dynamodb" + | */ 'default' => env('CACHE_DRIVER', 'file'), /* - |-------------------------------------------------------------------------- - | Cache Stores - |-------------------------------------------------------------------------- - | - | Here you may define all of the cache "stores" for your application as - | well as their drivers. You may even define multiple stores for the - | same cache driver to group types of items stored in your caches. - | + |-------------------------------------------------------------------------- + | Cache Stores + |-------------------------------------------------------------------------- + | + | Here you may define all of the cache "stores" for your application as + | well as their drivers. You may even define multiple stores for the + | same cache driver to group types of items stored in your caches. + | */ 'stores' => [ @@ -87,14 +87,14 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Cache Key Prefix - |-------------------------------------------------------------------------- - | - | When utilizing a RAM based store such as APC or Memcached, there might - | be other applications utilizing the same cache. So, we'll specify a - | value to get prefixed to all our keys so we can avoid collisions. - | + |-------------------------------------------------------------------------- + | Cache Key Prefix + |-------------------------------------------------------------------------- + | + | When utilizing a RAM based store such as APC or Memcached, there might + | be other applications utilizing the same cache. So, we'll specify a + | value to get prefixed to all our keys so we can avoid collisions. + | */ 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'), diff --git a/config/cors.php b/config/cors.php index 7424f34d..3ef17c65 100644 --- a/config/cors.php +++ b/config/cors.php @@ -3,18 +3,18 @@ return [ /* - |-------------------------------------------------------------------------- - | Laravel CORS Options - |-------------------------------------------------------------------------- - | - | The allowed_methods and allowed_headers options are case-insensitive. - | - | You don't need to provide both allowed_origins and allowed_origins_patterns. - | If one of the strings passed matches, it is considered a valid origin. - | - | If ['*'] is provided to allowed_methods, allowed_origins or allowed_headers - | all methods / origins / headers are allowed. - | + |-------------------------------------------------------------------------- + | Laravel CORS Options + |-------------------------------------------------------------------------- + | + | The allowed_methods and allowed_headers options are case-insensitive. + | + | You don't need to provide both allowed_origins and allowed_origins_patterns. + | If one of the strings passed matches, it is considered a valid origin. + | + | If ['*'] is provided to allowed_methods, allowed_origins or allowed_headers + | all methods / origins / headers are allowed. + | */ /* @@ -24,8 +24,8 @@ return [ 'paths' => ['*'], /* - * Matches the request method. `['*']` allows all methods. - */ + * Matches the request method. `['*']` allows all methods. + */ 'allowed_methods' => ['*'], /* @@ -40,7 +40,8 @@ return [ 'http:\/\/legaulois2020\.test', 'https:\/\/dev\.legaulois\.fr', 'https:\/\//www\.legaulois\.fr', - 'https:\/\/[a-z0-9\-\.]*\.sips-atos\.com' // Mercanet + 'https:\/\/[a-z0-9\-\.]*\.sips-atos\.com' +// Mercanet ], /* diff --git a/config/database.php b/config/database.php index 5ee88e3f..7a344afe 100644 --- a/config/database.php +++ b/config/database.php @@ -5,32 +5,32 @@ use Illuminate\Support\Str; return [ /* - |-------------------------------------------------------------------------- - | Default Database Connection Name - |-------------------------------------------------------------------------- - | - | Here you may specify which of the database connections below you wish - | to use as your default connection for all database work. Of course - | you may use many connections at once using the Database library. - | + |-------------------------------------------------------------------------- + | Default Database Connection Name + |-------------------------------------------------------------------------- + | + | Here you may specify which of the database connections below you wish + | to use as your default connection for all database work. Of course + | you may use many connections at once using the Database library. + | */ 'default' => env('DB_CONNECTION', 'mysql'), /* - |-------------------------------------------------------------------------- - | Database Connections - |-------------------------------------------------------------------------- - | - | Here are each of the database connections setup for your application. - | Of course, examples of configuring each database platform that is - | supported by Laravel is shown below to make development simple. - | - | - | All database work in Laravel is done through the PHP PDO facilities - | so make sure you have the driver for your particular database of - | choice installed on your machine before you begin development. - | + |-------------------------------------------------------------------------- + | Database Connections + |-------------------------------------------------------------------------- + | + | Here are each of the database connections setup for your application. + | Of course, examples of configuring each database platform that is + | supported by Laravel is shown below to make development simple. + | + | + | All database work in Laravel is done through the PHP PDO facilities + | so make sure you have the driver for your particular database of + | choice installed on your machine before you begin development. + | */ 'connections' => [ @@ -116,27 +116,27 @@ return [ 'newDB' => 'mysql', /* - |-------------------------------------------------------------------------- - | Migration Repository Table - |-------------------------------------------------------------------------- - | - | This table keeps track of all the migrations that have already run for - | your application. Using this information, we can determine which of - | the migrations on disk haven't actually been run in the database. - | + |-------------------------------------------------------------------------- + | Migration Repository Table + |-------------------------------------------------------------------------- + | + | This table keeps track of all the migrations that have already run for + | your application. Using this information, we can determine which of + | the migrations on disk haven't actually been run in the database. + | */ 'migrations' => 'migrations', /* - |-------------------------------------------------------------------------- - | Redis Databases - |-------------------------------------------------------------------------- - | - | Redis is an open source, fast, and advanced key-value store that also - | provides a richer body of commands than a typical key-value system - | such as APC or Memcached. Laravel makes it easy to dig right in. - | + |-------------------------------------------------------------------------- + | Redis Databases + |-------------------------------------------------------------------------- + | + | Redis is an open source, fast, and advanced key-value store that also + | provides a richer body of commands than a typical key-value system + | such as APC or Memcached. Laravel makes it easy to dig right in. + | */ 'redis' => [ diff --git a/config/filesystems.php b/config/filesystems.php index c7a539b0..94935ad5 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -3,42 +3,42 @@ return [ /* - |-------------------------------------------------------------------------- - | Default Filesystem Disk - |-------------------------------------------------------------------------- - | - | Here you may specify the default filesystem disk that should be used - | by the framework. The "local" disk, as well as a variety of cloud - | based disks are available to your application. Just store away! - | + |-------------------------------------------------------------------------- + | Default Filesystem Disk + |-------------------------------------------------------------------------- + | + | Here you may specify the default filesystem disk that should be used + | by the framework. The "local" disk, as well as a variety of cloud + | based disks are available to your application. Just store away! + | */ 'default' => env('FILESYSTEM_DRIVER', 'local'), /* - |-------------------------------------------------------------------------- - | Default Cloud Filesystem Disk - |-------------------------------------------------------------------------- - | - | Many applications store files both locally and in the cloud. For this - | reason, you may specify a default "cloud" driver here. This driver - | will be bound as the Cloud disk implementation in the container. - | + |-------------------------------------------------------------------------- + | Default Cloud Filesystem Disk + |-------------------------------------------------------------------------- + | + | Many applications store files both locally and in the cloud. For this + | reason, you may specify a default "cloud" driver here. This driver + | will be bound as the Cloud disk implementation in the container. + | */ 'cloud' => env('FILESYSTEM_CLOUD', 's3'), /* - |-------------------------------------------------------------------------- - | Filesystem Disks - |-------------------------------------------------------------------------- - | - | Here you may configure as many filesystem "disks" as you wish, and you - | may even configure multiple disks of the same driver. Defaults have - | been setup for each driver as an example of the required options. - | - | Supported Drivers: "local", "ftp", "sftp", "s3" - | + |-------------------------------------------------------------------------- + | Filesystem Disks + |-------------------------------------------------------------------------- + | + | Here you may configure as many filesystem "disks" as you wish, and you + | may even configure multiple disks of the same driver. Defaults have + | been setup for each driver as an example of the required options. + | + | Supported Drivers: "local", "ftp", "sftp", "s3" + | */ 'disks' => [ @@ -88,14 +88,14 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Symbolic Links - |-------------------------------------------------------------------------- - | - | Here you may configure the symbolic links that will be created when the - | `storage:link` Artisan command is executed. The array keys should be - | the locations of the links and the values should be their targets. - | + |-------------------------------------------------------------------------- + | Symbolic Links + |-------------------------------------------------------------------------- + | + | Here you may configure the symbolic links that will be created when the + | `storage:link` Artisan command is executed. The array keys should be + | the locations of the links and the values should be their targets. + | */ 'links' => [ diff --git a/config/hashing.php b/config/hashing.php index 84257708..6641c8cc 100644 --- a/config/hashing.php +++ b/config/hashing.php @@ -3,29 +3,29 @@ return [ /* - |-------------------------------------------------------------------------- - | Default Hash Driver - |-------------------------------------------------------------------------- - | - | This option controls the default hash driver that will be used to hash - | passwords for your application. By default, the bcrypt algorithm is - | used; however, you remain free to modify this option if you wish. - | - | Supported: "bcrypt", "argon", "argon2id" - | + |-------------------------------------------------------------------------- + | Default Hash Driver + |-------------------------------------------------------------------------- + | + | This option controls the default hash driver that will be used to hash + | passwords for your application. By default, the bcrypt algorithm is + | used; however, you remain free to modify this option if you wish. + | + | Supported: "bcrypt", "argon", "argon2id" + | */ 'driver' => 'bcrypt', /* - |-------------------------------------------------------------------------- - | Bcrypt Options - |-------------------------------------------------------------------------- - | - | Here you may specify the configuration options that should be used when - | passwords are hashed using the Bcrypt algorithm. This will allow you - | to control the amount of time it takes to hash the given password. - | + |-------------------------------------------------------------------------- + | Bcrypt Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Bcrypt algorithm. This will allow you + | to control the amount of time it takes to hash the given password. + | */ 'bcrypt' => [ @@ -33,14 +33,14 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Argon Options - |-------------------------------------------------------------------------- - | - | Here you may specify the configuration options that should be used when - | passwords are hashed using the Argon algorithm. These will allow you - | to control the amount of time it takes to hash the given password. - | + |-------------------------------------------------------------------------- + | Argon Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Argon algorithm. These will allow you + | to control the amount of time it takes to hash the given password. + | */ 'argon' => [ diff --git a/config/htmlmin.php b/config/htmlmin.php index 7d780300..e6eed476 100644 --- a/config/htmlmin.php +++ b/config/htmlmin.php @@ -13,47 +13,47 @@ return [ /* - |-------------------------------------------------------------------------- - | Automatic Blade Optimizations - |-------------------------------------------------------------------------- - | - | This option enables minification of the blade views as they are - | compiled. These optimizations have little impact on php processing time - | as the optimizations are only applied once and are cached. This package - | will do nothing by default to allow it to be used without minifying - | pages automatically. - | - | Default: false - | + |-------------------------------------------------------------------------- + | Automatic Blade Optimizations + |-------------------------------------------------------------------------- + | + | This option enables minification of the blade views as they are + | compiled. These optimizations have little impact on php processing time + | as the optimizations are only applied once and are cached. This package + | will do nothing by default to allow it to be used without minifying + | pages automatically. + | + | Default: false + | */ 'blade' => env('APP_DEBUG') ? false : 'html', /* - |-------------------------------------------------------------------------- - | Force Blade Optimizations - |-------------------------------------------------------------------------- - | - | This option forces blade minification on views where there such - | minification may be dangerous. This should only be used if you are fully - | aware of the potential issues this may cause. Obviously, this setting is - | dependent on blade minification actually being enabled. - | - | PLEASE USE WITH CAUTION - | - | Default: false - | + |-------------------------------------------------------------------------- + | Force Blade Optimizations + |-------------------------------------------------------------------------- + | + | This option forces blade minification on views where there such + | minification may be dangerous. This should only be used if you are fully + | aware of the potential issues this may cause. Obviously, this setting is + | dependent on blade minification actually being enabled. + | + | PLEASE USE WITH CAUTION + | + | Default: false + | */ 'force' => false, /* - |-------------------------------------------------------------------------- - | Ignore Blade Files - |-------------------------------------------------------------------------- - | - | Here you can specify paths, which you don't want to minify. - | + |-------------------------------------------------------------------------- + | Ignore Blade Files + |-------------------------------------------------------------------------- + | + | Here you can specify paths, which you don't want to minify. + | */ 'ignore' => [ diff --git a/config/image-resizer.php b/config/image-resizer.php index ab8bba35..c590d7ab 100644 --- a/config/image-resizer.php +++ b/config/image-resizer.php @@ -5,7 +5,8 @@ return [ * The php image driver to use * this can be 'imagick' or 'gd' */ - 'driver' => 'gd', // à mettre en imagick quand webp sera dispo sur le server avec imagick + 'driver' => 'gd', +// à mettre en imagick quand webp sera dispo sur le server avec imagick /** * The cache driver to use as defined @@ -24,7 +25,8 @@ return [ * Here the cache for images is * one hour */ - 'lifeTime' => 535680, // 1 ans + 'lifeTime' => 535680, +// 1 ans /** * Format can specifiy to which format save the image diff --git a/config/logging.php b/config/logging.php index 51bd825b..f4863eb4 100644 --- a/config/logging.php +++ b/config/logging.php @@ -7,31 +7,31 @@ use Monolog\Handler\SyslogUdpHandler; return [ /* - |-------------------------------------------------------------------------- - | Default Log Channel - |-------------------------------------------------------------------------- - | - | This option defines the default log channel that gets used when writing - | messages to the logs. The name specified in this option should match - | one of the channels defined in the "channels" configuration array. - | + |-------------------------------------------------------------------------- + | Default Log Channel + |-------------------------------------------------------------------------- + | + | This option defines the default log channel that gets used when writing + | messages to the logs. The name specified in this option should match + | one of the channels defined in the "channels" configuration array. + | */ 'default' => env('LOG_CHANNEL', 'stack'), /* - |-------------------------------------------------------------------------- - | Log Channels - |-------------------------------------------------------------------------- - | - | Here you may configure the log channels for your application. Out of - | the box, Laravel uses the Monolog PHP logging library. This gives - | you a variety of powerful log handlers / formatters to utilize. - | - | Available Drivers: "single", "daily", "slack", "syslog", - | "errorlog", "monolog", - | "custom", "stack" - | + |-------------------------------------------------------------------------- + | Log Channels + |-------------------------------------------------------------------------- + | + | Here you may configure the log channels for your application. Out of + | the box, Laravel uses the Monolog PHP logging library. This gives + | you a variety of powerful log handlers / formatters to utilize. + | + | Available Drivers: "single", "daily", "slack", "syslog", + | "errorlog", "monolog", + | "custom", "stack" + | */ 'channels' => [ diff --git a/config/mail.php b/config/mail.php index 0be497c9..56548a56 100644 --- a/config/mail.php +++ b/config/mail.php @@ -3,34 +3,34 @@ return [ /* - |-------------------------------------------------------------------------- - | Default Mailer - |-------------------------------------------------------------------------- - | - | This option controls the default mailer that is used to send any email - | messages sent by your application. Alternative mailers may be setup - | and used as needed; however, this mailer will be used by default. - | + |-------------------------------------------------------------------------- + | Default Mailer + |-------------------------------------------------------------------------- + | + | This option controls the default mailer that is used to send any email + | messages sent by your application. Alternative mailers may be setup + | and used as needed; however, this mailer will be used by default. + | */ 'default' => env('MAIL_MAILER', 'smtp'), /* - |-------------------------------------------------------------------------- - | Mailer Configurations - |-------------------------------------------------------------------------- - | - | Here you may configure all of the mailers used by your application plus - | their respective settings. Several examples have been configured for - | you and you are free to add your own as your application requires. - | - | Laravel supports a variety of mail "transport" drivers to be used while - | sending an e-mail. You will specify which one you are using for your - | mailers below. You are free to add additional mailers as required. - | - | Supported: "smtp", "sendmail", "mailgun", "ses", - | "postmark", "log", "array" - | + |-------------------------------------------------------------------------- + | Mailer Configurations + |-------------------------------------------------------------------------- + | + | Here you may configure all of the mailers used by your application plus + | their respective settings. Several examples have been configured for + | you and you are free to add your own as your application requires. + | + | Laravel supports a variety of mail "transport" drivers to be used while + | sending an e-mail. You will specify which one you are using for your + | mailers below. You are free to add additional mailers as required. + | + | Supported: "smtp", "sendmail", "mailgun", "ses", + | "postmark", "log", "array" + | */ 'mailers' => [ @@ -73,14 +73,14 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Global "From" Address - |-------------------------------------------------------------------------- - | - | You may wish for all e-mails sent by your application to be sent from - | the same address. Here, you may specify a name and address that is - | used globally for all e-mails that are sent by your application. - | + |-------------------------------------------------------------------------- + | Global "From" Address + |-------------------------------------------------------------------------- + | + | You may wish for all e-mails sent by your application to be sent from + | the same address. Here, you may specify a name and address that is + | used globally for all e-mails that are sent by your application. + | */ 'from' => [ @@ -115,14 +115,14 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Markdown Mail Settings - |-------------------------------------------------------------------------- - | - | If you are using Markdown based email rendering, you may configure your - | theme and component paths here, allowing you to customize the design - | of the emails. Or, you may simply stick with the Laravel defaults! - | + |-------------------------------------------------------------------------- + | Markdown Mail Settings + |-------------------------------------------------------------------------- + | + | If you are using Markdown based email rendering, you may configure your + | theme and component paths here, allowing you to customize the design + | of the emails. Or, you may simply stick with the Laravel defaults! + | */ 'markdown' => [ diff --git a/config/purifier.php b/config/purifier.php index 5b44644c..bb4e8495 100644 --- a/config/purifier.php +++ b/config/purifier.php @@ -25,7 +25,8 @@ return [ 'cacheFileMode' => 0755, 'settings' => [ 'default' => [ - 'HTML.SafeIframe' => true, // For iframes + 'HTML.SafeIframe' => true, +// For iframes 'URI.SafeIframeRegexp' => "%^(http://|https://|//)(vimeo.com)%", 'HTML.Doctype' => 'HTML 4.01 Transitional', 'HTML.Allowed' => 'h1[style],h2[style],h3[style],h4[style],h5[style],h6[style],figure[class|style],oembed[url],div[style],b,strong,i,em,u,a[href|title],ul[style],ol[style],dl[style],li,p[style],br,span[style|class],img[width|height|alt|src|style|class],iframe[src|width|height|class|frameborder|style],table[style],thead,tbody,th,tr,td,hr', diff --git a/config/queue.php b/config/queue.php index 00b76d65..0ab09027 100644 --- a/config/queue.php +++ b/config/queue.php @@ -3,29 +3,29 @@ return [ /* - |-------------------------------------------------------------------------- - | Default Queue Connection Name - |-------------------------------------------------------------------------- - | - | Laravel's queue API supports an assortment of back-ends via a single - | API, giving you convenient access to each back-end using the same - | syntax for every one. Here you may define a default connection. - | + |-------------------------------------------------------------------------- + | Default Queue Connection Name + |-------------------------------------------------------------------------- + | + | Laravel's queue API supports an assortment of back-ends via a single + | API, giving you convenient access to each back-end using the same + | syntax for every one. Here you may define a default connection. + | */ 'default' => env('QUEUE_CONNECTION', 'sync'), /* - |-------------------------------------------------------------------------- - | Queue Connections - |-------------------------------------------------------------------------- - | - | Here you may configure the connection information for each server that - | is used by your application. A default configuration has been added - | for each back-end shipped with Laravel. You are free to add more. - | - | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" - | + |-------------------------------------------------------------------------- + | Queue Connections + |-------------------------------------------------------------------------- + | + | Here you may configure the connection information for each server that + | is used by your application. A default configuration has been added + | for each back-end shipped with Laravel. You are free to add more. + | + | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" + | */ 'connections' => [ @@ -70,14 +70,14 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Failed Queue Jobs - |-------------------------------------------------------------------------- - | - | These options configure the behavior of failed queue job logging so you - | can control which database and table are used to store the jobs that - | have failed. You may change them to any database / table you wish. - | + |-------------------------------------------------------------------------- + | Failed Queue Jobs + |-------------------------------------------------------------------------- + | + | These options configure the behavior of failed queue job logging so you + | can control which database and table are used to store the jobs that + | have failed. You may change them to any database / table you wish. + | */ 'failed' => [ diff --git a/config/refresh-sitemap.php b/config/refresh-sitemap.php index ee5486be..b3aa898f 100644 --- a/config/refresh-sitemap.php +++ b/config/refresh-sitemap.php @@ -25,7 +25,8 @@ return [ '/la-marque/tracabilite/search', '/frame', '/map', - '/_debugbar', // Hack ignore laravel debug bar + '/_debugbar', +// Hack ignore laravel debug bar '/la-marque/actualites/renderActu', '/le-club-des-gaulois/les-promos/get', '/{unsubscribe}', diff --git a/config/services.php b/config/services.php index 2a1d616c..915dfe7a 100644 --- a/config/services.php +++ b/config/services.php @@ -3,15 +3,15 @@ return [ /* - |-------------------------------------------------------------------------- - | Third Party Services - |-------------------------------------------------------------------------- - | - | This file is for storing the credentials for third party services such - | as Mailgun, Postmark, AWS and more. This file provides the de facto - | location for this type of information, allowing packages to have - | a conventional file to locate the various service credentials. - | + |-------------------------------------------------------------------------- + | Third Party Services + |-------------------------------------------------------------------------- + | + | This file is for storing the credentials for third party services such + | as Mailgun, Postmark, AWS and more. This file provides the de facto + | location for this type of information, allowing packages to have + | a conventional file to locate the various service credentials. + | */ 'mailgun' => [ diff --git a/config/session.php b/config/session.php index c0e798bf..13ef89b6 100644 --- a/config/session.php +++ b/config/session.php @@ -5,30 +5,30 @@ use Illuminate\Support\Str; return [ /* - |-------------------------------------------------------------------------- - | Default Session Driver - |-------------------------------------------------------------------------- - | - | This option controls the default session "driver" that will be used on - | requests. By default, we will use the lightweight native driver but - | you may specify any of the other wonderful drivers provided here. - | - | Supported: "file", "cookie", "database", "apc", - | "memcached", "redis", "dynamodb", "array" - | + |-------------------------------------------------------------------------- + | Default Session Driver + |-------------------------------------------------------------------------- + | + | This option controls the default session "driver" that will be used on + | requests. By default, we will use the lightweight native driver but + | you may specify any of the other wonderful drivers provided here. + | + | Supported: "file", "cookie", "database", "apc", + | "memcached", "redis", "dynamodb", "array" + | */ 'driver' => env('SESSION_DRIVER', 'file'), /* - |-------------------------------------------------------------------------- - | Session Lifetime - |-------------------------------------------------------------------------- - | - | Here you may specify the number of minutes that you wish the session - | to be allowed to remain idle before it expires. If you want them - | to immediately expire on the browser closing, set that option. - | + |-------------------------------------------------------------------------- + | Session Lifetime + |-------------------------------------------------------------------------- + | + | Here you may specify the number of minutes that you wish the session + | to be allowed to remain idle before it expires. If you want them + | to immediately expire on the browser closing, set that option. + | */ 'lifetime' => env('SESSION_LIFETIME', 120), @@ -36,94 +36,94 @@ return [ 'expire_on_close' => false, /* - |-------------------------------------------------------------------------- - | Session Encryption - |-------------------------------------------------------------------------- - | - | This option allows you to easily specify that all of your session data - | should be encrypted before it is stored. All encryption will be run - | automatically by Laravel and you can use the Session like normal. - | + |-------------------------------------------------------------------------- + | Session Encryption + |-------------------------------------------------------------------------- + | + | This option allows you to easily specify that all of your session data + | should be encrypted before it is stored. All encryption will be run + | automatically by Laravel and you can use the Session like normal. + | */ 'encrypt' => false, /* - |-------------------------------------------------------------------------- - | Session File Location - |-------------------------------------------------------------------------- - | - | When using the native session driver, we need a location where session - | files may be stored. A default has been set for you but a different - | location may be specified. This is only needed for file sessions. - | + |-------------------------------------------------------------------------- + | Session File Location + |-------------------------------------------------------------------------- + | + | When using the native session driver, we need a location where session + | files may be stored. A default has been set for you but a different + | location may be specified. This is only needed for file sessions. + | */ 'files' => storage_path('framework/sessions'), /* - |-------------------------------------------------------------------------- - | Session Database Connection - |-------------------------------------------------------------------------- - | - | When using the "database" or "redis" session drivers, you may specify a - | connection that should be used to manage these sessions. This should - | correspond to a connection in your database configuration options. - | + |-------------------------------------------------------------------------- + | Session Database Connection + |-------------------------------------------------------------------------- + | + | When using the "database" or "redis" session drivers, you may specify a + | connection that should be used to manage these sessions. This should + | correspond to a connection in your database configuration options. + | */ 'connection' => env('SESSION_CONNECTION', null), /* - |-------------------------------------------------------------------------- - | Session Database Table - |-------------------------------------------------------------------------- - | - | When using the "database" session driver, you may specify the table we - | should use to manage the sessions. Of course, a sensible default is - | provided for you; however, you are free to change this as needed. - | + |-------------------------------------------------------------------------- + | Session Database Table + |-------------------------------------------------------------------------- + | + | When using the "database" session driver, you may specify the table we + | should use to manage the sessions. Of course, a sensible default is + | provided for you; however, you are free to change this as needed. + | */ 'table' => 'sessions', /* - |-------------------------------------------------------------------------- - | Session Cache Store - |-------------------------------------------------------------------------- - | - | While using one of the framework's cache driven session backends you may - | list a cache store that should be used for these sessions. This value - | must match with one of the application's configured cache "stores". - | - | Affects: "apc", "dynamodb", "memcached", "redis" - | + |-------------------------------------------------------------------------- + | Session Cache Store + |-------------------------------------------------------------------------- + | + | While using one of the framework's cache driven session backends you may + | list a cache store that should be used for these sessions. This value + | must match with one of the application's configured cache "stores". + | + | Affects: "apc", "dynamodb", "memcached", "redis" + | */ 'store' => env('SESSION_STORE', null), /* - |-------------------------------------------------------------------------- - | Session Sweeping Lottery - |-------------------------------------------------------------------------- - | - | Some session drivers must manually sweep their storage location to get - | rid of old sessions from storage. Here are the chances that it will - | happen on a given request. By default, the odds are 2 out of 100. - | + |-------------------------------------------------------------------------- + | Session Sweeping Lottery + |-------------------------------------------------------------------------- + | + | Some session drivers must manually sweep their storage location to get + | rid of old sessions from storage. Here are the chances that it will + | happen on a given request. By default, the odds are 2 out of 100. + | */ 'lottery' => [2, 100], /* - |-------------------------------------------------------------------------- - | Session Cookie Name - |-------------------------------------------------------------------------- - | - | Here you may change the name of the cookie used to identify a session - | instance by ID. The name specified here will get used every time a - | new session cookie is created by the framework for every driver. - | + |-------------------------------------------------------------------------- + | Session Cookie Name + |-------------------------------------------------------------------------- + | + | Here you may change the name of the cookie used to identify a session + | instance by ID. The name specified here will get used every time a + | new session cookie is created by the framework for every driver. + | */ 'cookie' => env( @@ -132,68 +132,68 @@ return [ ), /* - |-------------------------------------------------------------------------- - | Session Cookie Path - |-------------------------------------------------------------------------- - | - | The session cookie path determines the path for which the cookie will - | be regarded as available. Typically, this will be the root path of - | your application but you are free to change this when necessary. - | + |-------------------------------------------------------------------------- + | Session Cookie Path + |-------------------------------------------------------------------------- + | + | The session cookie path determines the path for which the cookie will + | be regarded as available. Typically, this will be the root path of + | your application but you are free to change this when necessary. + | */ 'path' => '/', /* - |-------------------------------------------------------------------------- - | Session Cookie Domain - |-------------------------------------------------------------------------- - | - | Here you may change the domain of the cookie used to identify a session - | in your application. This will determine which domains the cookie is - | available to in your application. A sensible default has been set. - | + |-------------------------------------------------------------------------- + | Session Cookie Domain + |-------------------------------------------------------------------------- + | + | Here you may change the domain of the cookie used to identify a session + | in your application. This will determine which domains the cookie is + | available to in your application. A sensible default has been set. + | */ 'domain' => env('SESSION_DOMAIN', null), /* - |-------------------------------------------------------------------------- - | HTTPS Only Cookies - |-------------------------------------------------------------------------- - | - | By setting this option to true, session cookies will only be sent back - | to the server if the browser has a HTTPS connection. This will keep - | the cookie from being sent to you if it can not be done securely. - | + |-------------------------------------------------------------------------- + | HTTPS Only Cookies + |-------------------------------------------------------------------------- + | + | By setting this option to true, session cookies will only be sent back + | to the server if the browser has a HTTPS connection. This will keep + | the cookie from being sent to you if it can not be done securely. + | */ 'secure' => env('SESSION_SECURE_COOKIE'), /* - |-------------------------------------------------------------------------- - | HTTP Access Only - |-------------------------------------------------------------------------- - | - | Setting this value to true will prevent JavaScript from accessing the - | value of the cookie and the cookie will only be accessible through - | the HTTP protocol. You are free to modify this option if needed. - | + |-------------------------------------------------------------------------- + | HTTP Access Only + |-------------------------------------------------------------------------- + | + | Setting this value to true will prevent JavaScript from accessing the + | value of the cookie and the cookie will only be accessible through + | the HTTP protocol. You are free to modify this option if needed. + | */ 'http_only' => true, /* - |-------------------------------------------------------------------------- - | Same-Site Cookies - |-------------------------------------------------------------------------- - | - | This option determines how your cookies behave when cross-site requests - | take place, and can be used to mitigate CSRF attacks. By default, we - | will set this value to "lax" since this is a secure default value. - | - | Supported: "lax", "strict", "none", null - | + |-------------------------------------------------------------------------- + | Same-Site Cookies + |-------------------------------------------------------------------------- + | + | This option determines how your cookies behave when cross-site requests + | take place, and can be used to mitigate CSRF attacks. By default, we + | will set this value to "lax" since this is a secure default value. + | + | Supported: "lax", "strict", "none", null + | */ 'same_site' => 'lax', diff --git a/config/view.php b/config/view.php index 22b8a18d..53008fd3 100644 --- a/config/view.php +++ b/config/view.php @@ -3,14 +3,14 @@ return [ /* - |-------------------------------------------------------------------------- - | View Storage Paths - |-------------------------------------------------------------------------- - | - | Most templating systems load templates from disk. Here you may specify - | an array of paths that should be checked for your views. Of course - | the usual Laravel view path has already been registered for you. - | + |-------------------------------------------------------------------------- + | View Storage Paths + |-------------------------------------------------------------------------- + | + | Most templating systems load templates from disk. Here you may specify + | an array of paths that should be checked for your views. Of course + | the usual Laravel view path has already been registered for you. + | */ 'paths' => [ @@ -18,14 +18,14 @@ return [ ], /* - |-------------------------------------------------------------------------- - | Compiled View Path - |-------------------------------------------------------------------------- - | - | This option determines where all the compiled Blade templates will be - | stored for your application. Typically, this is within the storage - | directory. However, as usual, you are free to change this value. - | + |-------------------------------------------------------------------------- + | Compiled View Path + |-------------------------------------------------------------------------- + | + | This option determines where all the compiled Blade templates will be + | stored for your application. Typically, this is within the storage + | directory. However, as usual, you are free to change this value. + | */ 'compiled' => env( diff --git a/database/factories/ActuFactory.php b/database/factories/ActuFactory.php index c2ed912e..0c759849 100644 --- a/database/factories/ActuFactory.php +++ b/database/factories/ActuFactory.php @@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Factories\Factory; class ActuFactory extends Factory { - protected static $i = 1; /** diff --git a/database/factories/BreedingPageFactory.php b/database/factories/BreedingPageFactory.php index 219e0283..f7c864ea 100644 --- a/database/factories/BreedingPageFactory.php +++ b/database/factories/BreedingPageFactory.php @@ -9,7 +9,6 @@ use Illuminate\Database\Eloquent\Factories\Factory; class BreedingPageFactory extends Factory { - protected static $i = 1; /** diff --git a/database/factories/DepartaimantsCollectionFactory.php b/database/factories/DepartaimantsCollectionFactory.php index 65f4b194..6ac79522 100644 --- a/database/factories/DepartaimantsCollectionFactory.php +++ b/database/factories/DepartaimantsCollectionFactory.php @@ -8,7 +8,6 @@ use Illuminate\Database\Eloquent\Factories\Factory; class DepartaimantsCollectionFactory extends Factory { - /** * The name of the factory's corresponding model. * diff --git a/database/factories/SubRangeFactory.php b/database/factories/SubRangeFactory.php index 37e0e7b6..34788f3c 100644 --- a/database/factories/SubRangeFactory.php +++ b/database/factories/SubRangeFactory.php @@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Factories\Factory; class SubRangeFactory extends Factory { - /** * The name of the factory's corresponding model. * diff --git a/database/factories/TagFactory.php b/database/factories/TagFactory.php index d026f87b..a931bc07 100644 --- a/database/factories/TagFactory.php +++ b/database/factories/TagFactory.php @@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Factories\Factory; class TagFactory extends Factory { - /** * The name of the factory's corresponding model. * diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index ac3670a5..63d0ba15 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -8,7 +8,6 @@ use Illuminate\Database\Eloquent\Factories\Factory; class UserFactory extends Factory { - /** * The name of the factory's corresponding model. * @@ -27,7 +26,8 @@ class UserFactory extends Factory 'name' => $this->faker->name, 'email' => $this->faker->unique()->safeEmail, 'email_verified_at' => now(), - 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password + 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', +// password 'remember_token' => Str::random(10), ]; } diff --git a/database/seeders/SubRangeSeeder.php b/database/seeders/SubRangeSeeder.php index b5f0c582..2d8959d6 100644 --- a/database/seeders/SubRangeSeeder.php +++ b/database/seeders/SubRangeSeeder.php @@ -22,29 +22,29 @@ class SubRangeSeeder extends Seeder SubRange::truncate(); Schema::enableForeignKeyConstraints(); SubRange::factory(9)->create(); - $subrange = new SubRange(); - $subrange->name = 'Oui c\'est bon'; - $subrange->picture = '/assets/images/subranges/logo-oui.png'; - $subrange->picture_alt = 'logo-oui.png'; + $subrange = new SubRange(); + $subrange->name = 'Oui c\'est bon'; + $subrange->picture = '/assets/images/subranges/logo-oui.png'; + $subrange->picture_alt = 'logo-oui.png'; $subrange->back_link_display = true; - $subrange->back_link_text = 'En savoir +'; + $subrange->back_link_text = 'En savoir +'; // phpcs:ignore Generic.Files.LineLength.TooLong $subrange->back_link_url = '/on-s-engage/le-gaulois-marque-engagee-et-responsable/bien-nourrir-tous-les-francais'; - $subrange->title = 'Savourez nos PRODUITS OUI C’EST BON LE GAULOIS'; - $subrange->subtitle = 'Une démarche éthique et qualité'; + $subrange->title = 'Savourez nos PRODUITS OUI C’EST BON LE GAULOIS'; + $subrange->subtitle = 'Une démarche éthique et qualité'; // phpcs:ignore Generic.Files.LineLength.TooLong $subrange->content = 'Notre démarche c’est la garantie de produits de qualité à des prix accessibles tout en préservant le bien-être animal, la santé des volailles et l’environnement. Cette démarche a été développée avec des éleveurs partenaires mobilisés chaque jour, pour élever des volailles de qualité.'; $subrange->save(); - $subrange = new SubRange(); - $subrange->name = 'Partenaire solidaire de nos régions'; - $subrange->picture = '/assets/images/subranges/le-gaulois-partenaire-de-vos-regions.png'; - $subrange->picture_alt = 'le-gaulois-partenaire-de-vos-regions.png'; + $subrange = new SubRange(); + $subrange->name = 'Partenaire solidaire de nos régions'; + $subrange->picture = '/assets/images/subranges/le-gaulois-partenaire-de-vos-regions.png'; + $subrange->picture_alt = 'le-gaulois-partenaire-de-vos-regions.png'; $subrange->back_link_display = true; - $subrange->back_link_text = 'En savoir +'; + $subrange->back_link_text = 'En savoir +'; // phpcs:ignore Generic.Files.LineLength.TooLong $subrange->back_link_url = '/on-s-engage/le-gaulois-marque-engagee-et-responsable/bien-nourrir-tous-les-francais'; - $subrange->title = 'Partenaire solidaire de nos régions : une nouvelle gamme engagée'; - $subrange->subtitle = 'Une démarche au cœur de l’économie circulaire'; + $subrange->title = 'Partenaire solidaire de nos régions : une nouvelle gamme engagée'; + $subrange->subtitle = 'Une démarche au cœur de l’économie circulaire'; // phpcs:ignore Generic.Files.LineLength.TooLong $subrange->content = "Le Gaulois Partenaire Solidaire de nos Régions, ce sont avant tout des poulets nés, élevés et préparés près de chez vous au cœur de nos régions. C’est aussi la garantie d’un revenu protégé pour tous les éleveurs partenaires engagés à nos côtés.\nAvec cette démarche, Le Gaulois contribue au développement de l’économie locale et s’engage pour la défense de l’emploi dans nos territoires. Pour 1 emploi crée par l’entreprise, ce sont 5,5 emplois soutenus dans nos régions ! Ce sont plus de 16 000 emplois soutenus en région.\nC’est une démarche solidaire déclinée localement dans nos régions de France : Nord, Est, Sud-Ouest, Centre-Ouest, Bretagne, Normandie.\nVous êtes à la recherche de produits locaux issus de votre région ? Vous souhaitez soutenir l’économie et l’emploi local ? Ne cherchez plus et laissez-vous tenter par la gamme Le Gaulois Partenaire Solidaire de nos Régions !"; $subrange->save(); diff --git a/database/seeders/TagSeeder.php b/database/seeders/TagSeeder.php index 97fbdc7a..df8fc6cc 100644 --- a/database/seeders/TagSeeder.php +++ b/database/seeders/TagSeeder.php @@ -17,7 +17,7 @@ class TagSeeder extends Seeder { Tag::truncate(); (new Tag(['name' => 'On s\'engage']))->save(); - $tag = new Tag(['name' => 'Actu']); + $tag = new Tag(['name' => 'Actu']); $tag->default = true; $tag->save(); Tag::factory(10)->create(); diff --git a/phpcs.xml b/phpcs.xml index e99463c3..f211b846 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,77 +1,90 @@ - + + Created with the PHP Coding Standard Generator. http://edorian.github.com/php-coding-standard-generator/ app/ config/ - database/factories/ - database/seeders/ + database/factories + database/seeders routes/ tests/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - Created with the PHP Coding Standard Generator. http://edorian.github.com/php-coding-standard-generator/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - + + + + + + + + + + + + - + @@ -79,13 +92,39 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */database/migrations/* + diff --git a/routes/api.php b/routes/api.php index 51535fb5..cd16c4d6 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,12 +1,12 @@ name('reductionsGet') ->middleware('auth:customer'); Route::prefix('/la-boutique') - ->middleware('auth:customer') // Il faut être connecté pour acceder à la boutique + ->middleware('auth:customer') +// Il faut être connecté pour acceder à la boutique ->name('boutique.') ->group(function () { Route::get('/', [BoutiqueController::class, 'index'])->name('index');