phpcs
This commit is contained in:
parent
4113e2254a
commit
949b7ca13e
34 changed files with 306 additions and 59 deletions
|
|
@ -27,9 +27,11 @@ class ExportCodesUniques extends Command
|
|||
* Execute the console command.
|
||||
*
|
||||
* @return integer
|
||||
* @phpcs:disable Generic.Metrics.CyclomaticComplexity.TooHigh
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
// phpcs:enable
|
||||
// Nombre total de code à exporter.
|
||||
$nbCodeTot = $this->ask("Combien de code doivent être exporté ?");
|
||||
while (empty(intval($nbCodeTot)) || !is_int(intval($nbCodeTot))) {
|
||||
|
|
@ -113,8 +115,30 @@ class ExportCodesUniques extends Command
|
|||
return 0;
|
||||
}
|
||||
|
||||
private function process($nbCodeFic, $nbCodeTot, $nbCodeLigne, $totalExportedCodes, $currentFilename, $currentExportedCodes, $currentLineCodes, $lastExportedCodeId = null)
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @param integer $nbCodeFic
|
||||
* @param integer $nbCodeTot
|
||||
* @param integer $nbCodeLigne
|
||||
* @param integer $totalExportedCodes
|
||||
* @param string $currentFilename
|
||||
* @param integer $currentExportedCodes
|
||||
* @param integer $currentLineCodes
|
||||
* @param integer $lastExportedCodeId
|
||||
* @return mixed
|
||||
* @phpcs:disable Generic.Metrics.CyclomaticComplexity.TooHigh
|
||||
*/
|
||||
private function process(
|
||||
int $nbCodeFic,
|
||||
int $nbCodeTot,
|
||||
int $nbCodeLigne,
|
||||
int $totalExportedCodes,
|
||||
string $currentFilename,
|
||||
int $currentExportedCodes,
|
||||
int $currentLineCodes,
|
||||
int $lastExportedCodeId = null
|
||||
) {
|
||||
// phpcs:enable
|
||||
$paginate = config('codes.paginate');
|
||||
|
||||
if ($nbCodeTot < $paginate) {
|
||||
|
|
|
|||
|
|
@ -21,8 +21,9 @@ class DashboardController extends Controller
|
|||
$settings = app(Settings::class);
|
||||
$participations = Participation::selectRaw("COUNT(*) AS count, DATE(created_at) AS date")
|
||||
->groupByRaw("DATE(created_at)")->get();
|
||||
$participationsUniquePerDay = Participation::selectRaw("DISTINCT customer_id AS user, COUNT(*) AS count, DATE(created_at) AS date")
|
||||
->groupByRaw("DATE(created_at), user")->get();
|
||||
$participationsUniquePerDay = Participation::selectRaw(
|
||||
"DISTINCT customer_id AS user, COUNT(*) AS count, DATE(created_at) AS date"
|
||||
)->groupByRaw("DATE(created_at), user")->get();
|
||||
$statsUnique = [];
|
||||
foreach ($participationsUniquePerDay as $participationPerDay) {
|
||||
$dateUnique = Carbon::parse($participationPerDay->date)->format('d/m/Y');
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ class EndPageController extends Controller
|
|||
{
|
||||
/**
|
||||
* index
|
||||
*
|
||||
* @return \Illuminate\View\View|Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function index()
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ class EnterCodeController extends Controller
|
|||
* @param Participation $participation
|
||||
* @return \App\Models\Reduction|null
|
||||
*/
|
||||
private function updateCoupon(Settings $settings, $coupon, Participation $participation)
|
||||
private function updateCoupon(Settings $settings, mixed $coupon, Participation $participation)
|
||||
{
|
||||
$reduction = null;
|
||||
$mesBR = new MesBR(config('mesbr.endpoint'), $settings->reductions_site, $settings->reductions_campaign);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ class FAQController extends Controller
|
|||
{
|
||||
/**
|
||||
* index
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function index()
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ class GainsController extends Controller
|
|||
{
|
||||
/**
|
||||
* index
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function index()
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ class HomeController extends Controller
|
|||
{
|
||||
/**
|
||||
* home
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function home()
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ class HowToPlayController extends Controller
|
|||
{
|
||||
/**
|
||||
* index
|
||||
*
|
||||
* @return \Illuminate\View\View|Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function index()
|
||||
|
|
|
|||
|
|
@ -185,6 +185,12 @@ class LoginController extends Controller
|
|||
return view('front.basic.confirm-email', compact('result'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the view to request a password reset link
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
|
||||
*/
|
||||
public function forgotPassword(Request $request)
|
||||
{
|
||||
if ($request->tokenValid && $request->token) {
|
||||
|
|
@ -195,7 +201,14 @@ class LoginController extends Controller
|
|||
return view('front.basic.forgot-password');
|
||||
}
|
||||
|
||||
public function forgotPasswordReset(Request $request, $token)
|
||||
/**
|
||||
* Display the view to reset a password
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param string $token
|
||||
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
|
||||
*/
|
||||
public function forgotPasswordReset(Request $request, string $token)
|
||||
{
|
||||
if (!$request->hasValidSignature(false)) {
|
||||
return redirect()->route('login')
|
||||
|
|
@ -211,6 +224,12 @@ class LoginController extends Controller
|
|||
return redirect()->route('forgot-password', compact('tokenValid', 'token'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the reset password mail
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function mailPassword(Request $request)
|
||||
{
|
||||
$email = filter_var($request->email, FILTER_SANITIZE_STRING);
|
||||
|
|
@ -265,6 +284,12 @@ class LoginController extends Controller
|
|||
->with('success', 'Un mail de réinitialisation de votre mot de passe vous a été envoyé(e).');
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the password
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function changePassword(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ class ProduitsController extends Controller
|
|||
{
|
||||
/**
|
||||
* index
|
||||
*
|
||||
* @return \Illuminate\View\View|Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function index()
|
||||
|
|
|
|||
|
|
@ -5,10 +5,11 @@ namespace App\Http\Controllers;
|
|||
use App\Models\Settings;
|
||||
use App\Models\Reduction;
|
||||
|
||||
class re7Controller extends Controller
|
||||
class Re7Controller extends Controller
|
||||
{
|
||||
/**
|
||||
* index
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function index()
|
||||
|
|
@ -18,6 +19,7 @@ class re7Controller extends Controller
|
|||
|
||||
/**
|
||||
* teaser
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function teaser()
|
||||
|
|
@ -29,6 +31,7 @@ class re7Controller extends Controller
|
|||
|
||||
/**
|
||||
* prizeMail
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function prizeMail()
|
||||
|
|
@ -38,6 +41,7 @@ class re7Controller extends Controller
|
|||
|
||||
/**
|
||||
* reductionMail
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function reductionMail()
|
||||
|
|
@ -47,6 +51,7 @@ class re7Controller extends Controller
|
|||
|
||||
/**
|
||||
* br
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function br()
|
||||
|
|
@ -59,6 +64,7 @@ class re7Controller extends Controller
|
|||
|
||||
/**
|
||||
* gain 1
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function gain1()
|
||||
|
|
@ -68,6 +74,7 @@ class re7Controller extends Controller
|
|||
|
||||
/**
|
||||
* gain 2
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function gain2()
|
||||
|
|
@ -76,6 +83,7 @@ class re7Controller extends Controller
|
|||
}
|
||||
/**
|
||||
* getRandomCoupon
|
||||
*
|
||||
* @param App\Models\Settings $settings
|
||||
* @return string
|
||||
*/
|
||||
|
|
@ -4,7 +4,6 @@ namespace App\Http\Controllers;
|
|||
|
||||
use App\Mail\VerifyEmail;
|
||||
use App\Models\Customer;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Http\Request;
|
||||
|
|
@ -16,22 +15,36 @@ class RegisterController extends Controller
|
|||
{
|
||||
use RegistersUsers;
|
||||
|
||||
// TODO : Utilité ??
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/** @var \LDCCRM\ApiV1 */
|
||||
private $apiCrm;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
$this->apiCrm = new \LDCCRM\ApiV1(config('crm.endpoint'), config('crm.token'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Index
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('front.basic.register-crm');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a user from a form
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function register(Request $request)
|
||||
{
|
||||
|
||||
|
|
@ -64,7 +77,7 @@ class RegisterController extends Controller
|
|||
|
||||
$MJ = Carbon::now()->subYears(18);
|
||||
|
||||
if ($this->isSQLDate($birthdate)) {
|
||||
if ($this->isSqlDate($birthdate)) {
|
||||
$d = Carbon::createFromFormat('Y-m-d', $birthdate);
|
||||
if (!$d->lessThanOrEqualTo($MJ)) {
|
||||
return back()
|
||||
|
|
@ -84,9 +97,22 @@ class RegisterController extends Controller
|
|||
return back()
|
||||
->withInput($request->except('password'))
|
||||
->withErrors("Erreur sur le champs : date de naissance.");
|
||||
}//end if
|
||||
} //end if
|
||||
|
||||
$crmUser = $this->apiCrm->createCustomer($email, $password, $firstname, $lastname, $optin, $birthdate, null, $address, $address2, $town, $postcode, ucfirst($country));
|
||||
$crmUser = $this->apiCrm->createCustomer(
|
||||
$email,
|
||||
$password,
|
||||
$firstname,
|
||||
$lastname,
|
||||
$optin,
|
||||
$birthdate,
|
||||
null,
|
||||
$address,
|
||||
$address2,
|
||||
$town,
|
||||
$postcode,
|
||||
ucfirst($country)
|
||||
);
|
||||
|
||||
if ($crmUser->status === 'OK') {
|
||||
$user = Customer::create([
|
||||
|
|
@ -96,7 +122,6 @@ class RegisterController extends Controller
|
|||
'birth_date' => $birthdate,
|
||||
'email' => $email,
|
||||
'password' => Hash::make("MOTDEPASSE"),
|
||||
// TODO : ???
|
||||
'address' => $address,
|
||||
'address2' => $address2,
|
||||
'town' => $town,
|
||||
|
|
@ -108,11 +133,15 @@ class RegisterController extends Controller
|
|||
Mail::to($email)->send(new VerifyEmail($user));
|
||||
|
||||
return redirect()->route('login')
|
||||
->with('success', "Pour finaliser votre inscription, merci de cliquer sur le lien qui vient de vous être envoyé par email<br>" .
|
||||
"Informations complémentaires :<br>" .
|
||||
"- Vérifiez vos spams : l'email de confirmation s'y trouve peut-être<br>" .
|
||||
"- Attention : le mail peut parfois mettre quelques minutes à vous parvenir<br>" .
|
||||
"- L'activation de votre compte doit se faire dans les 24 heures qui suivent la demande de création.");
|
||||
->with(
|
||||
'success',
|
||||
"Pour finaliser votre inscription,
|
||||
merci de cliquer sur le lien qui vient de vous être envoyé par email<br>
|
||||
Informations complémentaires :<br>
|
||||
- Vérifiez vos spams : l'email de confirmation s'y trouve peut-être<br>
|
||||
- Attention : le mail peut parfois mettre quelques minutes à vous parvenir<br>
|
||||
- L'activation de votre compte doit se faire dans les 24 heures qui suivent la demande de création."
|
||||
);
|
||||
} else {
|
||||
if ($crmUser->code === 103) {
|
||||
return back()
|
||||
|
|
@ -126,7 +155,13 @@ class RegisterController extends Controller
|
|||
}//end if
|
||||
}
|
||||
|
||||
private function isSQLDate($date)
|
||||
/**
|
||||
* Check if $date is a sql date
|
||||
*
|
||||
* @param string $date
|
||||
* @return boolean
|
||||
*/
|
||||
private function isSqlDate(string $date)
|
||||
{
|
||||
if (preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/", $date)) {
|
||||
return true;
|
||||
|
|
@ -134,7 +169,13 @@ class RegisterController extends Controller
|
|||
return false;
|
||||
}
|
||||
|
||||
private function isFormDate($date)
|
||||
/**
|
||||
* Check if $date is a form date
|
||||
*
|
||||
* @param string $date
|
||||
* @return boolean
|
||||
*/
|
||||
private function isFormDate(string $date)
|
||||
{
|
||||
if (preg_match("/^(0[1-9]|[1-2][0-9]|3[0-1])\/(0[1-9]|1[0-2])\/[0-9]{4}$/", $date)) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@ use App\Models\Settings;
|
|||
|
||||
class TeaserController extends Controller
|
||||
{
|
||||
/**
|
||||
* Show the teaser page if it is activated
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$settings = app(Settings::class)
|
||||
|
|
|
|||
|
|
@ -6,18 +6,33 @@ use App\Models\Content;
|
|||
|
||||
class ViewContentController extends Controller
|
||||
{
|
||||
/**
|
||||
* Show the rules view
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
|
||||
*/
|
||||
public function reglement()
|
||||
{
|
||||
$content = Content::find(3);
|
||||
return view('front.basic.reglement', compact('content'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the privacy view
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
|
||||
*/
|
||||
public function charte()
|
||||
{
|
||||
$content = Content::find(2);
|
||||
return view('front.basic.charte', compact('content'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the legals view
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
|
||||
*/
|
||||
public function legals()
|
||||
{
|
||||
$content = Content::find(1);
|
||||
|
|
|
|||
|
|
@ -14,16 +14,28 @@ use Illuminate\Support\Facades\Mail;
|
|||
|
||||
class WinningProofController extends Controller
|
||||
{
|
||||
/** @var \LDCCRM\ApiV1 */
|
||||
private $apiCrm;
|
||||
|
||||
/**
|
||||
* Create a controller instance
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->apiCrm = new \LDCCRM\ApiV1(config('crm.endpoint'), config('crm.token'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Send winning proof to the mail specified in settings
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function sendWinningProof(Request $request)
|
||||
{
|
||||
// On récupère la participation gagnante en attente des infos
|
||||
// On récupère la participation gagnante en attente des infos.
|
||||
$participation = Participation::where([
|
||||
['user_id', Auth::user()->id],
|
||||
['sticker', null],
|
||||
|
|
|
|||
|
|
@ -62,9 +62,9 @@ class Kernel extends HttpKernel
|
|||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||
'game-date' => \App\Http\Middleware\GameCheckDate::class,
|
||||
'is-admin' => \App\Http\Middleware\isAdmin::class,
|
||||
'is-super-admin' => \App\Http\Middleware\isSuperAdmin::class,
|
||||
're7' => \App\Http\Middleware\re7Middleware::class,
|
||||
'is-admin' => \App\Http\Middleware\IsAdmin::class,
|
||||
'is-super-admin' => \App\Http\Middleware\IsSuperAdmin::class,
|
||||
're7' => \App\Http\Middleware\Re7Middleware::class,
|
||||
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
||||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use Closure;
|
|||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class isAdmin
|
||||
class IsAdmin
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
|
|
@ -3,9 +3,10 @@
|
|||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class isSuperAdmin
|
||||
class IsSuperAdmin
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
|
|
@ -14,7 +15,7 @@ class isSuperAdmin
|
|||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
$role = Auth::user()->role;
|
||||
if ($role === 1) {
|
||||
|
|
@ -3,8 +3,9 @@
|
|||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class re7Middleware
|
||||
class Re7Middleware
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
|
|
@ -13,7 +14,7 @@ class re7Middleware
|
|||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
if (config('app.env') === 'production') {
|
||||
return redirect()->route('home');
|
||||
|
|
@ -20,9 +20,11 @@ class UpdateSettingsRequest extends FormRequest
|
|||
* Prepare the data for validation.
|
||||
*
|
||||
* @return void
|
||||
* @phpcs:disable Generic.Metrics.CyclomaticComplexity.TooHigh
|
||||
*/
|
||||
protected function prepareForValidation()
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->merge([
|
||||
// Checkboxes.
|
||||
'use_ean_codes' => $this->use_ean_codes ? true : false,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Code;
|
||||
use App\Models\CodeEan;
|
||||
use App\Models\Participation;
|
||||
use App\Models\Product;
|
||||
use App\Models\Settings;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ class ProcessExportCodesUniques implements ShouldQueue
|
|||
|
||||
/**
|
||||
* Nombre de codes par fichiers.
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $nbCodeFic;
|
||||
|
|
@ -127,9 +128,11 @@ class ProcessExportCodesUniques implements ShouldQueue
|
|||
*
|
||||
* @param integer|null $lastExportedCodeId
|
||||
* @return array Array of temp files
|
||||
* @phpcs:disable Generic.Metrics.CyclomaticComplexity.TooHigh
|
||||
*/
|
||||
private function generateCsvFiles($lastExportedCodeId = null): array
|
||||
{
|
||||
// phpcs:enable
|
||||
$outPaths = [];
|
||||
$totalExportedCodes = 0;
|
||||
$currentFilename = 1;
|
||||
|
|
|
|||
|
|
@ -80,12 +80,14 @@ class ProcessUniqueCode implements ShouldQueue
|
|||
|
||||
/**
|
||||
* Nombre d'insertions max sur un seule requète
|
||||
*
|
||||
* @var integer $perPage
|
||||
*/
|
||||
$perPage = $maxSQLPlaceholders / $insertColumns;
|
||||
|
||||
/**
|
||||
* Nombre de page totale à insérer.
|
||||
*
|
||||
* @var integer $totalPages
|
||||
*/
|
||||
$totalPages = \ceil($this->quantity / $perPage);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ class ExportCodesUniques extends Mailable implements ShouldQueue
|
|||
|
||||
/**
|
||||
* Nombre de codes par fichiers.
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $nbCodeFic;
|
||||
|
|
|
|||
|
|
@ -11,16 +11,20 @@ class JobFailed extends Mailable
|
|||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
/** @var string */
|
||||
public $job;
|
||||
|
||||
/** @var array */
|
||||
public $exception;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @param string $job
|
||||
* @param array $exception
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($job, $exception)
|
||||
public function __construct(string $job, array $exception)
|
||||
{
|
||||
$this->job = $job;
|
||||
$this->exception = $exception;
|
||||
|
|
|
|||
|
|
@ -12,14 +12,16 @@ class NotifAdmin extends Mailable implements ShouldQueue
|
|||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
/** @var string */
|
||||
private $msg;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @param string $msg
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($msg)
|
||||
public function __construct(string $msg)
|
||||
{
|
||||
$this->msg = $msg;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\Participation;
|
||||
use App\Models\Settings;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
|
|
@ -12,14 +14,20 @@ class NotifWinAdmin extends Mailable implements ShouldQueue
|
|||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
private $settings, $participation;
|
||||
/** @var \App\Models\Settings */
|
||||
private $settings;
|
||||
|
||||
/** @var \App\Models\Participation */
|
||||
private $participation;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @param \App\Models\Settings $settings
|
||||
* @param \App\Models\Participation $participation
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($settings, $participation)
|
||||
public function __construct(Settings $settings, Participation $participation)
|
||||
{
|
||||
$this->settings = $settings;
|
||||
$this->participation = $participation;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\Settings;
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
|
|
@ -12,14 +14,21 @@ class PasswordReset extends Mailable implements ShouldQueue
|
|||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
protected $user, $settings;
|
||||
/** @var \App\Models\User */
|
||||
protected $user;
|
||||
|
||||
/** @var \App\Models\Settings */
|
||||
protected $settings;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\Settings $settings
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($user, $settings)
|
||||
public function __construct(User $user, Settings $settings)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->settings = $settings;
|
||||
|
|
@ -32,6 +41,8 @@ class PasswordReset extends Mailable implements ShouldQueue
|
|||
*/
|
||||
public function build()
|
||||
{
|
||||
return $this->subject('Changement de votre mot de passe')->view('front.basic.password-email')->with(['user' => $this->user, 'settings' => $this->settings]);
|
||||
return $this->subject('Changement de votre mot de passe')
|
||||
->view('front.basic.password-email')
|
||||
->with(['user' => $this->user, 'settings' => $this->settings]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\Prize;
|
||||
use App\Models\Settings;
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
|
|
@ -12,14 +15,24 @@ class PrizeWon extends Mailable implements ShouldQueue
|
|||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
private $user, $prize, $settings;
|
||||
/** @var \App\Models\User */
|
||||
private $user;
|
||||
|
||||
/** @var \App\Models\Prize */
|
||||
private $prize;
|
||||
|
||||
/** @var \App\Models\Settings */
|
||||
private $settings;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\Prize $prize
|
||||
* @param \App\Models\Settings $settings
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($user, $prize, $settings)
|
||||
public function __construct(User $user, Prize $prize, Settings $settings)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->prize = $prize;
|
||||
|
|
@ -33,7 +46,12 @@ class PrizeWon extends Mailable implements ShouldQueue
|
|||
*/
|
||||
public function build()
|
||||
{
|
||||
return $this->subject("Félicitations " . $this->user->firstname . ", vous avez remporté 1 " . $this->prize->label_one . " !")->view('front.basic.prize-mail')
|
||||
return $this->subject(sprintf(
|
||||
'Félicitations %s, vous avez remporté 1 %s !',
|
||||
$this->user->firstname,
|
||||
$this->prize->label_one
|
||||
))
|
||||
->view('front.basic.prize-mail')
|
||||
->with(['user' => $this->user, 'prize' => $this->prize, 'settings' => $this->settings]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\Reduction;
|
||||
use App\Models\Settings;
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
|
|
@ -12,14 +15,28 @@ class ReductionWon extends Mailable implements ShouldQueue
|
|||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
private $user, $coupon, $settings, $crmCoupon;
|
||||
/** @var \App\Models\Customer */
|
||||
private $user;
|
||||
|
||||
/** @var mixed */
|
||||
private $coupon;
|
||||
|
||||
/** @var \App\Models\Settings */
|
||||
private $settings;
|
||||
|
||||
/** @var \App\Models\Reduction */
|
||||
private $crmCoupon;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @param \App\Models\User $user
|
||||
* @param mixed $coupon
|
||||
* @param \App\Models\Settings $settings
|
||||
* @param \App\Models\Reduction $crmCoupon
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($user, $coupon, $settings, $crmCoupon)
|
||||
public function __construct(User $user, mixed $coupon, Settings $settings, Reduction $crmCoupon)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->coupon = $coupon;
|
||||
|
|
@ -34,7 +51,17 @@ class ReductionWon extends Mailable implements ShouldQueue
|
|||
*/
|
||||
public function build()
|
||||
{
|
||||
return $this->subject($this->user->firstname . ", n'attendez plus pour imprimer votre bon d'achat " . $this->settings->name . " !")->view('front.basic.reduction-mail')
|
||||
->with(['user' => $this->user, 'coupon' => $this->coupon, 'settings' => $this->settings, 'crmCoupon' => $this->crmCoupon]);
|
||||
return $this->subject(sprintf(
|
||||
'%s, n\'attendez plus pour imprimer votre bon d\'achat %s !',
|
||||
$this->user->firstname,
|
||||
$this->settings->name
|
||||
))
|
||||
->view('front.basic.reduction-mail')
|
||||
->with([
|
||||
'user' => $this->user,
|
||||
'coupon' => $this->coupon,
|
||||
'settings' => $this->settings,
|
||||
'crmCoupon' => $this->crmCoupon
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\Participation;
|
||||
use App\Models\Settings;
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
|
|
@ -12,15 +15,43 @@ class WinningProof extends Mailable implements ShouldQueue
|
|||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
private $sticker, $ticket, $barcode, $participation, $user, $settings;
|
||||
/** @var string */
|
||||
private $sticker;
|
||||
|
||||
/** @var string */
|
||||
private $ticket;
|
||||
|
||||
/** @var string */
|
||||
private $barcode;
|
||||
|
||||
/** @var \App\Models\Participation */
|
||||
private $participation;
|
||||
|
||||
/** @var \App\Models\User */
|
||||
private $user;
|
||||
|
||||
/** @var \App\Models\Settings */
|
||||
private $settings;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @param string $sticker
|
||||
* @param string $ticket
|
||||
* @param string $barcode
|
||||
* @param \App\Models\Participation $participation
|
||||
* @param \App\Models\User $user
|
||||
* @param \Models\Settings $settings
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($sticker, $ticket, $barcode, $participation, $user, $settings)
|
||||
{
|
||||
public function __construct(
|
||||
string $sticker,
|
||||
string $ticket,
|
||||
string $barcode,
|
||||
Participation $participation,
|
||||
User $user,
|
||||
Settings $settings
|
||||
) {
|
||||
$this->sticker = $sticker;
|
||||
$this->ticket = $ticket;
|
||||
$this->barcode = $barcode;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ use Illuminate\Support\Facades\Hash;
|
|||
* @property string $postal_code Postal code
|
||||
* @property string $country Country
|
||||
* @property string $phone Phone number
|
||||
* @property-read string $email_verify_token Token for email verification
|
||||
* @property string $email_verify_token Token for email verification
|
||||
* @property-read boolean $email_verified Is the email verified ?
|
||||
* @property-read string $password_token Password token
|
||||
* @property-read \Illuminate\Support\Carbon $created_at Creation Date.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* InstantWin.
|
||||
*
|
||||
* @property-read \Illuminate\Support\Carbon $appear_date Appear date
|
||||
* @property-read boolean $won Is the prize won ?
|
||||
* @property boolean $won Is the prize won ?
|
||||
*
|
||||
* @property-read \App\Models\Prizes $prize Associated prize.
|
||||
* @property-read \App\Models\Participation $participation Associated participation.
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
<?php
|
||||
|
||||
use App\Http\Controllers\re7Controller;
|
||||
use App\Http\Controllers\Re7Controller;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::prefix('re7')
|
||||
->middleware(['re7'])
|
||||
->group(function () {
|
||||
Route::get('/', [re7Controller::class, 'index']);
|
||||
Route::get('/teaser', [re7Controller::class, 'teaser']);
|
||||
Route::get('/mail-gain', [re7Controller::class, 'prizeMail']);
|
||||
Route::get('/mail-reduction', [re7Controller::class, 'reductionMail']);
|
||||
Route::get('/br', [re7Controller::class, 'br']);
|
||||
Route::get('/', [Re7Controller::class, 'index']);
|
||||
Route::get('/teaser', [Re7Controller::class, 'teaser']);
|
||||
Route::get('/mail-gain', [Re7Controller::class, 'prizeMail']);
|
||||
Route::get('/mail-reduction', [Re7Controller::class, 'reductionMail']);
|
||||
Route::get('/br', [Re7Controller::class, 'br']);
|
||||
// phpcs:ignore
|
||||
// TODO : Rendre dynamique la partie gain par rapport au BO.
|
||||
Route::get('/gain1', [re7Controller::class, 'gain1']);
|
||||
Route::get('/gain2', [re7Controller::class, 'gain2']);
|
||||
Route::get('/gain1', [Re7Controller::class, 'gain1']);
|
||||
Route::get('/gain2', [Re7Controller::class, 'gain2']);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue