update phpcs.xml + phpcbf pass
This commit is contained in:
parent
22dfc02ff7
commit
98ae4cd003
221 changed files with 1767 additions and 1768 deletions
22
.vscode/settings.json
vendored
22
.vscode/settings.json
vendored
|
|
@ -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"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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.');
|
||||
|
|
|
|||
|
|
@ -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.');
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ use Throwable;
|
|||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
|
||||
/**
|
||||
* A list of the exception types that are not reported.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ use Exception;
|
|||
*/
|
||||
class RedirectTo extends Exception
|
||||
{
|
||||
|
||||
public $url;
|
||||
|
||||
public function __construct(string $url)
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 !"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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é !');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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é !');
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ class LabelController extends Controller
|
|||
return view('bo.labels.create');
|
||||
}
|
||||
|
||||
//
|
||||
public function store(StoreLabel $request)
|
||||
{
|
||||
(new Label($request->validated()))->saveOrFail();
|
||||
|
|
|
|||
|
|
@ -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 = [];
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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'));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
|||
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 = [
|
||||
//
|
||||
];
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 = [
|
||||
//
|
||||
];
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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/
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ use Illuminate\Contracts\Foundation\Application;
|
|||
|
||||
class VerifyCsrfToken extends Middleware
|
||||
{
|
||||
|
||||
/**
|
||||
* The URIs that should be excluded from CSRF verification.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue