diff --git a/app/Console/Commands/LdcWebStatusChecker.php b/app/Console/Commands/LdcWebStatusChecker.php index df24f31..1ad3ea4 100644 --- a/app/Console/Commands/LdcWebStatusChecker.php +++ b/app/Console/Commands/LdcWebStatusChecker.php @@ -4,14 +4,13 @@ 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 */ - class LdcWebStatusChecker extends Command { /** @@ -52,7 +51,7 @@ class LdcWebStatusChecker extends Command $data['robots'] = 'false'; } - // Check logs + // * Check logs $data['logs'] = 0; $patherror = storage_path('/logs'); $files = glob($patherror . '/*.log'); @@ -64,7 +63,7 @@ class LdcWebStatusChecker extends Command $data['code']['version'] = app()->version(); - // Send by cURL + // * Send by cURL $url = 'https://ldc-web.ldc.fr/api/status-checker'; $ch = curl_init($url); $payload = ['token' => 'CE8S52Qq7stf5k8frF4T', 'datas' => json_encode($data)]; diff --git a/app/Enums/FileCategory.php b/app/Enums/FileCategory.php index a04cbff..3306ea2 100644 --- a/app/Enums/FileCategory.php +++ b/app/Enums/FileCategory.php @@ -12,9 +12,13 @@ use Kwaadpepper\Enum\BaseEnumRoutable; * @method static self informations() * @method static self feedback() */ - class FileCategory extends BaseEnumRoutable { + /** + * Enum values + * + * @return array + */ protected static function values(): array { return [ @@ -27,6 +31,11 @@ class FileCategory extends BaseEnumRoutable ]; } + /** + * Enum labels + * + * @return array + */ protected static function labels(): array { return [ diff --git a/app/Enums/FileType.php b/app/Enums/FileType.php index 1c75822..d5d16e2 100644 --- a/app/Enums/FileType.php +++ b/app/Enums/FileType.php @@ -8,9 +8,13 @@ use Kwaadpepper\Enum\BaseEnumRoutable; * @method static self stringlink() * @method static self binfile() */ - class FileType extends BaseEnumRoutable { + /** + * Enum values + * + * @return array + */ protected static function values(): array { return [ @@ -19,6 +23,11 @@ class FileType extends BaseEnumRoutable ]; } + /** + * Enum labels + * + * @return array + */ protected static function labels(): array { return [ diff --git a/app/Enums/LoadLevel.php b/app/Enums/LoadLevel.php index 666065d..823eb47 100644 --- a/app/Enums/LoadLevel.php +++ b/app/Enums/LoadLevel.php @@ -10,9 +10,13 @@ use Kwaadpepper\Enum\BaseEnumRoutable; * @method static self high() * @method static self overload() */ - class LoadLevel extends BaseEnumRoutable { + /** + * Enum values + * + * @return array + */ protected static function values(): array { return [ @@ -23,6 +27,11 @@ class LoadLevel extends BaseEnumRoutable ]; } + /** + * Enum labels + * + * @return array + */ protected static function labels(): array { return [ diff --git a/app/Enums/Planning/ActivityType.php b/app/Enums/Planning/ActivityType.php index 88244f0..e237e20 100644 --- a/app/Enums/Planning/ActivityType.php +++ b/app/Enums/Planning/ActivityType.php @@ -18,6 +18,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable; */ class ActivityType extends BaseEnumRoutable { + /** + * Enum labels + * + * @return array + */ public static function labels() { return [ @@ -30,6 +35,11 @@ class ActivityType extends BaseEnumRoutable ]; } + /** + * Enum colors + * + * @return array + */ public static function colors(): array { return [ diff --git a/app/Enums/Planning/CellModel.php b/app/Enums/Planning/CellModel.php index 0d800ee..036dacc 100644 --- a/app/Enums/Planning/CellModel.php +++ b/app/Enums/Planning/CellModel.php @@ -20,6 +20,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable; */ class CellModel extends BaseEnumRoutable { + /** + * Enum values + * + * @return array + */ protected static function values(): array { return [ @@ -29,6 +34,11 @@ class CellModel extends BaseEnumRoutable ]; } + /** + * Enum labels + * + * @return array + */ protected static function labels(): array { return [ diff --git a/app/Enums/Planning/CellType.php b/app/Enums/Planning/CellType.php index 1be8c4b..896b14c 100644 --- a/app/Enums/Planning/CellType.php +++ b/app/Enums/Planning/CellType.php @@ -17,6 +17,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable; */ class CellType extends BaseEnumRoutable { + /** + * Enum values + * + * @return array + */ protected static function values(): array { return [ @@ -29,6 +34,11 @@ class CellType extends BaseEnumRoutable ]; } + /** + * Enum labels + * + * @return array + */ protected static function labels(): array { return [ diff --git a/app/Enums/Planning/TableRow.php b/app/Enums/Planning/TableRow.php index 7faa9f2..aecb574 100644 --- a/app/Enums/Planning/TableRow.php +++ b/app/Enums/Planning/TableRow.php @@ -18,6 +18,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable; */ class TableRow extends BaseEnumRoutable { + /** + * Enum values + * + * @return array + */ protected static function values(): array { return [ @@ -32,6 +37,11 @@ class TableRow extends BaseEnumRoutable ]; } + /** + * Enum labels + * + * @return array + */ protected static function labels(): array { return [ diff --git a/app/Events/FileCreated.php b/app/Events/FileCreated.php index 788541d..8e4ff2c 100644 --- a/app/Events/FileCreated.php +++ b/app/Events/FileCreated.php @@ -7,12 +7,14 @@ use App\Models\User; class FileCreated extends Loggable { - /** @var File */ + /** @var \App\Models\File */ public $file; /** * Create a new event instance. * + * @param \App\Models\File $file + * @param \App\Models\User $user * @return void */ public function __construct(File $file, User $user) diff --git a/app/Events/Loggable.php b/app/Events/Loggable.php index 495e470..76d5ae2 100644 --- a/app/Events/Loggable.php +++ b/app/Events/Loggable.php @@ -11,14 +11,16 @@ abstract class Loggable use Dispatchable; use SerializesModels; - /** @var User */ + /** @var \App\Models\User */ public $user; + /** @var string */ public $message = ''; /** * Create a new event instance. * + * @param \App\Models\User $user * @return void */ public function __construct(User $user) diff --git a/app/Events/NotifyAdmin.php b/app/Events/NotifyAdmin.php index 3254bf1..0431af2 100644 --- a/app/Events/NotifyAdmin.php +++ b/app/Events/NotifyAdmin.php @@ -13,7 +13,7 @@ class NotifyAdmin use InteractsWithSockets; use SerializesModels; - /** @var Ticket */ + /** @var \App\Models\Ticket */ public $ticket; /** @var string */ @@ -22,6 +22,8 @@ class NotifyAdmin /** * Create a new event instance. * + * @param \App\Models\Ticket $ticket + * @param string $corpsMaj * @return void */ public function __construct(Ticket $ticket, string $corpsMaj) diff --git a/app/Events/NotifySubscriptions.php b/app/Events/NotifySubscriptions.php index eecec0d..ffaf05a 100644 --- a/app/Events/NotifySubscriptions.php +++ b/app/Events/NotifySubscriptions.php @@ -14,7 +14,7 @@ class NotifySubscriptions use InteractsWithSockets; use SerializesModels; - /** @var Ticket */ + /** @var \App\Models\Ticket */ public $ticket; /** @var string */ @@ -26,6 +26,9 @@ class NotifySubscriptions /** * Create a new event instance. * + * @param \App\Models\Ticket $ticket + * @param string $corpsMaj + * @param \Illuminate\Support\Collection|null $ignoreUsers * @return void */ public function __construct(Ticket $ticket, string $corpsMaj, Collection $ignoreUsers = null) diff --git a/app/Events/NotifyTicketCreator.php b/app/Events/NotifyTicketCreator.php index 9515f4d..d5682a4 100644 --- a/app/Events/NotifyTicketCreator.php +++ b/app/Events/NotifyTicketCreator.php @@ -13,7 +13,7 @@ class NotifyTicketCreator use InteractsWithSockets; use SerializesModels; - /** @var Ticket */ + /** @var \App\Models\Ticket */ public $ticket; /** @var string */ @@ -22,6 +22,8 @@ class NotifyTicketCreator /** * Create a new event instance. * + * @param \App\Models\Ticket $ticket + * @param string $corpsMaj * @return void */ public function __construct(Ticket $ticket, string $corpsMaj) diff --git a/app/Events/ProjectUpdated.php b/app/Events/ProjectUpdated.php index 2237d7c..50ed4ef 100644 --- a/app/Events/ProjectUpdated.php +++ b/app/Events/ProjectUpdated.php @@ -7,12 +7,14 @@ use App\Models\User; class ProjectUpdated extends Loggable { - /** @var Project */ + /** @var \App\Models\Project */ public $project; /** * Create a new event instance. * + * @param \App\Models\Project $project + * @param \App\Models\User $user * @return void */ public function __construct(Project $project, User $user) diff --git a/app/Events/SiteUpdated.php b/app/Events/SiteUpdated.php index 582540d..8f48962 100644 --- a/app/Events/SiteUpdated.php +++ b/app/Events/SiteUpdated.php @@ -7,12 +7,14 @@ use App\Models\User; class SiteUpdated extends Loggable { - /** @var Site */ + /** @var \App\Models\Site */ public $site; /** * Create a new event instance. * + * @param \App\Models\Site $site + * @param \App\Models\User $user * @return void */ public function __construct(Site $site, User $user) diff --git a/app/Events/TicketStatusChanged.php b/app/Events/TicketStatusChanged.php index 4652421..6e02add 100644 --- a/app/Events/TicketStatusChanged.php +++ b/app/Events/TicketStatusChanged.php @@ -2,6 +2,7 @@ namespace App\Events; +use App\Enums\TicketStatus; use App\Models\Ticket; use App\Models\User; use Illuminate\Broadcasting\InteractsWithSockets; @@ -14,12 +15,13 @@ class TicketStatusChanged use InteractsWithSockets; use SerializesModels; - /** @var Ticket */ + /** @var \App\Models\Site */ public $ticket; - /** @var User */ + /** @var \App\Models\User */ public $user; + /** @var \App\Enums\TicketStatus */ public $status; /** @var string */ @@ -28,9 +30,13 @@ class TicketStatusChanged /** * Create a new event instance. * + * @param \App\Models\Ticket $ticket + * @param \App\Enums\TicketStatus $status + * @param \App\Models\User|null $user + * @param string|null $message * @return void */ - public function __construct(Ticket $ticket, $status, User $user = null, string $message = null) + public function __construct(Ticket $ticket, TicketStatus $status, User $user = null, string $message = null) { $this->ticket = $ticket; $this->status = $status; diff --git a/app/Http/Controllers/Auth/ConfirmPasswordController.php b/app/Http/Controllers/Auth/ConfirmPasswordController.php index f6112b2..7243403 100644 --- a/app/Http/Controllers/Auth/ConfirmPasswordController.php +++ b/app/Http/Controllers/Auth/ConfirmPasswordController.php @@ -8,16 +8,6 @@ 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. - | - */ use ConfirmsPasswords; /** diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 5e0f0d2..b6626b0 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -7,18 +7,13 @@ 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. - | - */ use SendsPasswordResetEmails; + /** + * ForgotPasswordController + * + * @return void + */ public function __construct() { $this->middleware('guest:web'); diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 606216c..ce0156c 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -8,16 +8,6 @@ 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. - | - */ use AuthenticatesUsers; /** diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index 1b62616..96338d4 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -9,16 +9,6 @@ use Illuminate\Validation\Rules\Password; 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. - | - */ use ResetsPasswords; /** diff --git a/app/Http/Controllers/LogController.php b/app/Http/Controllers/LogController.php index 70445bc..2c1b167 100644 --- a/app/Http/Controllers/LogController.php +++ b/app/Http/Controllers/LogController.php @@ -16,8 +16,19 @@ class LogController extends Controller /** @var Log */ public static $modelClass = Log::class; + /** + * Crud Layout + * + * @var string + */ public static $layout = 'layout.app'; + /** + * Index query middleware + * + * @param Builder $query + * @return Builder + */ public function indexQuery(Builder $query): Builder { $parent = request()->site ?? request()->project; @@ -29,9 +40,15 @@ class LogController extends Controller return $query; } + /** + * Crud index view + * + * @param \Kwaadpepper\CrudPolicies\Http\Requests\CrudIndexRequest $request + * @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory + */ public function index(CrudIndexRequest $request) { - // Autosort + // * Autosort if (!$request->sort_col and !$request->sort_way) { $request->merge([ 'sort_col' => 'created_at', @@ -47,6 +64,12 @@ class LogController extends Controller return view('logs.index', $view->getData()); } + /** + * Before store model middleware + * + * @param \App\Models\Log $log + * @return void + */ public function storeModel(Log &$log) { $log->parent()->associate(request()->site ?? request()->project); diff --git a/app/Http/Controllers/ScheduleController.php b/app/Http/Controllers/ScheduleController.php index 8802cb9..98e597e 100644 --- a/app/Http/Controllers/ScheduleController.php +++ b/app/Http/Controllers/ScheduleController.php @@ -13,6 +13,8 @@ use Illuminate\Database\Eloquent\Builder; /** * Alternate planner for Dev Team * + * TODO: Refactor this controller. + * * @author Olivier Legat * */ diff --git a/app/Http/Controllers/TicketController.php b/app/Http/Controllers/TicketController.php index c0a87ae..5d61059 100644 --- a/app/Http/Controllers/TicketController.php +++ b/app/Http/Controllers/TicketController.php @@ -402,10 +402,11 @@ class TicketController extends Controller */ public function reopen(Ticket $ticket) { - $message = trans(':ticketName à réouvert le ticket n°:ticketNumber', [ + $message = trans(':ticketName à réouvert le ticket n°:ticketNumber', [ 'ticketName' => $ticket->user->name, 'ticketNumber' => $ticket->id, ]); + /** @var \App\Enums\TicketStatus */ $oldStatus = $ticket->status; $ticket->status = TicketStatus::inprogress(); $ticket->saveQuietly(); diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index ec4b1d3..054b714 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -6,7 +6,6 @@ use App\Http\Controllers\Auth\ForgotPasswordController; use App\Models\User; use Illuminate\Database\Eloquent\Model; use Illuminate\Http\Request; -use Illuminate\Support\Facades\Auth; use Kwaadpepper\CrudPolicies\Traits\CrudController; class UserController extends Controller @@ -15,6 +14,9 @@ class UserController extends Controller __construct as __CrudConstructor; } + /** + * UserController + */ public function __construct() { parent::__construct(); @@ -25,8 +27,19 @@ class UserController extends Controller /** @var User */ public static $modelClass = User::class; + /** + * Crud Layout + * + * @var string + */ public static $layout = 'layout.app'; + /** + * After store model middleware + * + * @param Model $model + * @return void + */ public function storedModel(Model &$model) { /** @var \App\Models\User */ @@ -34,11 +47,21 @@ class UserController extends Controller $model->sendMailConfirm(); } + /** + * Password reset form + * + * @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory + */ public function passwordReset() { return view('users.passwordReset'); } + /** + * Password reset submit + * + * @return \Illuminate\Http\RedirectResponse + */ public function passwordResetSubmit() { /** @var \App\Models\User */ @@ -47,12 +70,21 @@ class UserController extends Controller return app(ForgotPasswordController::class)->sendResetLinkEmail($request); } + /** + * Show stats + * + * TODO: refator this using carbon. + * + * @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory + */ public function stats() { - $user = Auth::user(); - $stats = []; + /** @var \App\Models\User */ + $user = auth()->user(); + $stats = []; + $curYear = date('Y'); - for ($i = 2021; $i <= date('Y'); $i++) { + for ($i = 2021; $i <= $curYear; $i++) { $start = $i . '-03-01'; $end = $i + 1 . '-02-' . $this->getLastDayFebruary($i + 1); @@ -68,7 +100,13 @@ class UserController extends Controller return view('users.stats', ['stats' => array_reverse($stats)]); } - private function getLastDayFebruary($year) + /** + * Get february last day date of the year + * + * @param integer $year + * @return integer 28 or 29 + */ + private function getLastDayFebruary(int $year): int { if ((is_int($year / 4) && !is_int($year / 100)) || is_int($year / 400)) { return 29; diff --git a/app/Http/Requests/SetCellContentRequest.php b/app/Http/Requests/SetCellContentRequest.php index 4ec5fc4..5c06ffc 100644 --- a/app/Http/Requests/SetCellContentRequest.php +++ b/app/Http/Requests/SetCellContentRequest.php @@ -15,7 +15,7 @@ class SetCellContentRequest extends FormRequest * * @return boolean */ - public function authorize() + public function authorize(): bool { $this->merge([ 'model' => $this->model ?? null, @@ -30,7 +30,7 @@ class SetCellContentRequest extends FormRequest * * @return array */ - public function rules() + public function rules(): array { return [ 'id' => 'required|exists:week_plannings,id', @@ -52,7 +52,12 @@ class SetCellContentRequest extends FormRequest ]; } - public function attributes() + /** + * Get custom attributes for validator errors. + * + * @return array + */ + public function attributes(): array { return [ 'cellModel' => 'Type d\'élément lié', diff --git a/app/Http/Requests/UpdateMessage.php b/app/Http/Requests/UpdateMessage.php index 0cc1450..6ea5894 100644 --- a/app/Http/Requests/UpdateMessage.php +++ b/app/Http/Requests/UpdateMessage.php @@ -9,22 +9,22 @@ class UpdateMessage extends FormRequest /** * Determine if the user is authorized to make this request. * - * @return bool + * @return boolean */ - public function authorize() + public function authorize(): bool { /** @var \App\Models\User|null $user */ $user = auth()->user(); - + return auth()->check() && $user->isAdmin(); } - + /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() + public function rules(): array { /** @var \App\Models\User */ $user = auth()->user(); diff --git a/app/Http/Resources/UserLabeledResource.php b/app/Http/Resources/UserLabeledResource.php index 09bfed0..e3cf2bd 100644 --- a/app/Http/Resources/UserLabeledResource.php +++ b/app/Http/Resources/UserLabeledResource.php @@ -10,12 +10,13 @@ class UserLabeledResource extends ResourceCollection /** * Transform the resource collection into an array. * - * @param \Illuminate\Http\Request $request + * @param mixed $request * @return array + * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass */ - // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass public function toArray($request) { + // phpcs:enable return $this->collection->mapWithKeys(function (User $user, $key) { return [ $key => [ diff --git a/app/Jobs/AutoCloseOldTickets.php b/app/Jobs/AutoCloseOldTickets.php index c23f84b..b94bdde 100644 --- a/app/Jobs/AutoCloseOldTickets.php +++ b/app/Jobs/AutoCloseOldTickets.php @@ -28,6 +28,7 @@ class AutoCloseOldTickets })->get(); /** @var \App\Models\Ticket $ticket */ foreach ($tickets as $ticket) { + /** @var \App\Enums\TicketStatus */ $oldStatus = $ticket->status; $ticket->status = TicketStatus::archived(); $ticket->saveQuietly(); diff --git a/app/Jobs/SendTicketMentionMail.php b/app/Jobs/SendTicketMentionMail.php index 3bbc35c..eb429fe 100644 --- a/app/Jobs/SendTicketMentionMail.php +++ b/app/Jobs/SendTicketMentionMail.php @@ -24,6 +24,8 @@ class SendTicketMentionMail implements ShouldQueue /** * Create a new job instance. * + * @param \App\Models\User $user + * @param \App\Mail\TicketMention $mail * @return void */ public function __construct(User $user, TicketMention $mail) diff --git a/app/Jobs/SendUserCreatedEmail.php b/app/Jobs/SendUserCreatedEmail.php index d17c49c..56fe1bc 100644 --- a/app/Jobs/SendUserCreatedEmail.php +++ b/app/Jobs/SendUserCreatedEmail.php @@ -23,6 +23,7 @@ class SendUserCreatedEmail implements ShouldQueue /** * Create a new job instance. * + * @param \App\Models\User $user * @return void */ public function __construct(User $user) diff --git a/app/Listeners/AddStatusMessages.php b/app/Listeners/AddStatusMessages.php index 879d58c..491fcf8 100644 --- a/app/Listeners/AddStatusMessages.php +++ b/app/Listeners/AddStatusMessages.php @@ -10,7 +10,7 @@ class AddStatusMessages /** * Handle the event. * - * @param TicketStatusChanged $event + * @param \App\Events\TicketStatusChanged $event * @return void */ public function handle(TicketStatusChanged $event) diff --git a/app/Listeners/HandleLoggable.php b/app/Listeners/HandleLoggable.php index 47c0b49..40ea213 100644 --- a/app/Listeners/HandleLoggable.php +++ b/app/Listeners/HandleLoggable.php @@ -13,7 +13,7 @@ class HandleLoggable /** * Handle the event. * - * @param Loggable $loggable + * @param \App\Events\Loggable $loggable * @return void */ public function handle(Loggable $loggable) diff --git a/app/Listeners/SendNotificationMailToAdmin.php b/app/Listeners/SendNotificationMailToAdmin.php index e6c05cd..8498763 100644 --- a/app/Listeners/SendNotificationMailToAdmin.php +++ b/app/Listeners/SendNotificationMailToAdmin.php @@ -11,7 +11,7 @@ class SendNotificationMailToAdmin /** * Handle the event. * - * @param NotifyTicketCreator $event + * @param \App\Events\NotifyAdmin $event * @return void */ public function handle(NotifyAdmin $event) diff --git a/app/Listeners/SendNotificationMailToTicketCreator.php b/app/Listeners/SendNotificationMailToTicketCreator.php index 1c8a319..edd52b6 100644 --- a/app/Listeners/SendNotificationMailToTicketCreator.php +++ b/app/Listeners/SendNotificationMailToTicketCreator.php @@ -11,7 +11,7 @@ class SendNotificationMailToTicketCreator /** * Handle the event. * - * @param NotifyTicketCreator $event + * @param \App\Events\NotifyTicketCreator $event * @return void */ public function handle(NotifyTicketCreator $event) diff --git a/app/Listeners/SendSubscriptionsNotificationsMail.php b/app/Listeners/SendSubscriptionsNotificationsMail.php index 87ab230..1db3858 100644 --- a/app/Listeners/SendSubscriptionsNotificationsMail.php +++ b/app/Listeners/SendSubscriptionsNotificationsMail.php @@ -13,7 +13,7 @@ class SendSubscriptionsNotificationsMail /** * Handle the event. * - * @param NotifySubscriptions $event + * @param \App\Events\NotifySubscriptions $event * @return void */ public function handle(NotifySubscriptions $event) diff --git a/app/Mail/NewTicket.php b/app/Mail/NewTicket.php index 4ed5640..c79a7c8 100644 --- a/app/Mail/NewTicket.php +++ b/app/Mail/NewTicket.php @@ -2,6 +2,7 @@ namespace App\Mail; +use App\Models\Ticket; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; @@ -11,14 +12,16 @@ class NewTicket extends Mailable use Queueable; use SerializesModels; + /** @var \App\Models\Ticket */ private $ticket; /** * Create a new message instance. * + * @param \App\Models\Ticket $ticket * @return void */ - public function __construct($ticket) + public function __construct(Ticket $ticket) { $this->ticket = $ticket; } diff --git a/app/Mail/TicketMention.php b/app/Mail/TicketMention.php index e45f258..797c56e 100644 --- a/app/Mail/TicketMention.php +++ b/app/Mail/TicketMention.php @@ -13,7 +13,7 @@ class TicketMention extends Mailable use Queueable; use SerializesModels; - /** @var Ticket */ + /** @var \App\Models\Ticket */ private $ticket; /** @var string */ @@ -22,6 +22,8 @@ class TicketMention extends Mailable /** * Create a new message instance. * + * @param \App\Models\Ticket $ticket + * @param string $corpsMaj * @return void */ public function __construct(Ticket $ticket, string $corpsMaj) diff --git a/app/Mail/TicketUpdate.php b/app/Mail/TicketUpdate.php index 3fb5d83..4137ab1 100644 --- a/app/Mail/TicketUpdate.php +++ b/app/Mail/TicketUpdate.php @@ -13,7 +13,7 @@ class TicketUpdate extends Mailable use Queueable; use SerializesModels; - /** @var Ticket */ + /** @var \App\Models\Ticket */ private $ticket; /** @var string */ @@ -22,6 +22,8 @@ class TicketUpdate extends Mailable /** * Create a new message instance. * + * @param \App\Models\Ticket $ticket + * @param string $corpsMaj * @return void */ public function __construct(Ticket $ticket, string $corpsMaj) diff --git a/app/Mail/UserCreatedMail.php b/app/Mail/UserCreatedMail.php index 00291c0..0019e4e 100644 --- a/app/Mail/UserCreatedMail.php +++ b/app/Mail/UserCreatedMail.php @@ -7,11 +7,13 @@ use Illuminate\Mail\Mailable; class UserCreatedMail extends Mailable { + /** @var \App\Models\User */ protected $user; /** * Create a new message instance. * + * @param \App\Models\User $user * @return void */ public function __construct(User $user) diff --git a/app/Models/File.php b/app/Models/File.php index af1a345..0909b21 100644 --- a/app/Models/File.php +++ b/app/Models/File.php @@ -18,18 +18,43 @@ class File extends Model use HasFactory; use IsCrudModel; + /** + * The attributes that should be cast to Enums. + * + * @var array + */ protected $enumCasts = [ 'category' => FileCategory::class, 'type' => FileType::class ]; + /** + * Crud label column + * + * @var string + */ protected $crudLabelColumn = 'name'; + /** + * Crud value column + * + * @var string + */ protected $crudValueColumn = 'id'; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = ['type', 'uri', 'file', 'name', 'category']; - public function __construct($attributes = []) + /** + * File + * + * @param array $attributes + */ + public function __construct(array $attributes = []) { self::$editableProperties = [ 'name' => [ @@ -119,6 +144,11 @@ class File extends Model parent::__construct($attributes); } + /** + * Perform any actions required after the model boots. + * + * @return void + */ protected static function booted() { static::created(function (File $file) { @@ -126,16 +156,33 @@ class File extends Model }); } + // * RELATIONSHIPS + + /** + * MorphTo parent object relation + * + * @return \Illuminate\Database\Eloquent\Relations\MorphTo + */ public function parent() { return $this->morphTo(); } + /** + * MorphTo parent object site relation + * + * @return \Illuminate\Database\Eloquent\Relations\MorphTo + */ public function parentSite() { return $this->morphTo('parent', 'site'); } + /** + * MorphTo parent object project relation + * + * @return \Illuminate\Database\Eloquent\Relations\MorphTo + */ public function parentProject() { return $this->morphTo('parent', 'project'); diff --git a/app/Models/Log.php b/app/Models/Log.php index 0f910c1..38e32e0 100644 --- a/app/Models/Log.php +++ b/app/Models/Log.php @@ -13,13 +13,33 @@ class Log extends Model use HasFactory; use IsCrudModel; + /** + * Crud label column + * + * @var string + */ protected $crudLabelColumn = 'id'; + /** + * Crud value column + * + * @var string + */ protected $crudValueColumn = 'id'; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = ['entry']; - public function __construct($attributes = []) + /** + * Log + * + * @param array $attributes + */ + public function __construct(array $attributes = []) { self::$editableProperties = [ 'id' => [ @@ -54,6 +74,11 @@ class Log extends Model parent::__construct($attributes); } + /** + * Perform any actions required after the model boots. + * + * @return void + */ protected static function booted() { static::creating(function (Log $log) { @@ -61,21 +86,43 @@ class Log extends Model }); } + // * RELATIONSHIPS + + /** + * BelongsTo User relation + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ public function user() { return $this->belongsTo(User::class); } + /** + * MorphTo parent object relation + * + * @return \Illuminate\Database\Eloquent\Relations\MorphTo + */ public function parent() { return $this->morphTo(); } + /** + * MorphTo parent object site relation + * + * @return \Illuminate\Database\Eloquent\Relations\MorphTo + */ public function parentSite() { return $this->morphTo('parent', 'site'); } + /** + * MorphTo parent object project relation + * + * @return \Illuminate\Database\Eloquent\Relations\MorphTo + */ public function parentProject() { return $this->morphTo('parent', 'project'); diff --git a/app/Models/Schedule.php b/app/Models/Schedule.php index 95b50bf..a1a097c 100644 --- a/app/Models/Schedule.php +++ b/app/Models/Schedule.php @@ -14,6 +14,11 @@ class Schedule extends Model use HasFactory; use CastsEnums; + /** + * The attributes that should be cast to Enums. + * + * @var array + */ protected $enumCasts = [ 'activity' => ActivityType::class, 'model_lie' => CellModel::class @@ -28,6 +33,11 @@ class Schedule extends Model 'date' => 'date', ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'user_id', 'date', @@ -38,28 +48,34 @@ class Schedule extends Model 'model_lie' ]; + // * RELATIONSHIPS + + /** + * BelongsTo User relation + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ public function user() { return $this->belongsTo(User::class); } - // relationship to linked objet + /** + * relationship to linked objet + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ public function relatedModel() { switch ($this->model_lie) { case 'sites': return $this->belongsTo(Site::class, 'id_lie'); - break; case 'projects': return $this->belongsTo(Project::class, 'id_lie'); - break; case 'tickets': return $this->belongsTo(Ticket::class, 'id_lie'); - break; default: - // no model return new BelongsTo($this->newQuery(), $this, '', '', ''); - break; } } } diff --git a/app/Models/SiteUser.php b/app/Models/SiteUser.php index 5c05968..aad20c1 100644 --- a/app/Models/SiteUser.php +++ b/app/Models/SiteUser.php @@ -6,5 +6,10 @@ use Illuminate\Database\Eloquent\Relations\Pivot; class SiteUser extends Pivot { + /** + * Indicates if the model should be timestamped. + * + * @var boolean + */ public $timestamps = false; } diff --git a/app/Policies/AccountPolicy.php b/app/Policies/AccountPolicy.php index bc91f90..25700b5 100644 --- a/app/Policies/AccountPolicy.php +++ b/app/Policies/AccountPolicy.php @@ -15,13 +15,14 @@ class AccountPolicy extends RootPolicy /** * Init policies on call * - * @param User $user - * @param Model $model + * @param \App\Models\User $user + * @param \Illuminate\Database\Eloquent\Model $model * @return void * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed */ public function setPolicies(User $user, Model $model = null) { + // phpcs:enable /** * This first rule to return true in a policy action authorises the action */ diff --git a/app/Policies/BrandPolicy.php b/app/Policies/BrandPolicy.php index 0c6d0e9..88798ca 100644 --- a/app/Policies/BrandPolicy.php +++ b/app/Policies/BrandPolicy.php @@ -15,13 +15,14 @@ class BrandPolicy extends RootPolicy /** * Init policies on call * - * @param User $user - * @param Model $model + * @param \App\Models\User $user + * @param \Illuminate\Database\Eloquent\Model $model * @return void * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed */ public function setPolicies(User $user, Model $model = null) { + // phpcs:enable /** * This first rule to return true in a policy action authorises the action */ diff --git a/app/Policies/CreditLogPolicy.php b/app/Policies/CreditLogPolicy.php index b4cb3bc..1438b36 100644 --- a/app/Policies/CreditLogPolicy.php +++ b/app/Policies/CreditLogPolicy.php @@ -15,10 +15,9 @@ class CreditLogPolicy extends RootPolicy /** * Init policies on call * - * @param User $user - * @param Model $model + * @param \App\Models\User $user + * @param \Illuminate\Database\Eloquent\Model $model * @return void - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed */ public function setPolicies(User $user, Model $model = null) { diff --git a/app/Policies/EstimationPolicy.php b/app/Policies/EstimationPolicy.php index 05ca7c1..9a0c8bd 100644 --- a/app/Policies/EstimationPolicy.php +++ b/app/Policies/EstimationPolicy.php @@ -15,13 +15,14 @@ class EstimationPolicy extends RootPolicy /** * Init policies on call * - * @param User $user - * @param Model $model + * @param \App\Models\User $user + * @param \Illuminate\Database\Eloquent\Model $model * @return void * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed */ public function setPolicies(User $user, Model $model = null) { + // phpcs:enable /** * This first rule to return true in a policy action authorises the action */ diff --git a/app/Policies/FilePolicy.php b/app/Policies/FilePolicy.php index 0a1dc3c..546769a 100644 --- a/app/Policies/FilePolicy.php +++ b/app/Policies/FilePolicy.php @@ -15,13 +15,14 @@ class FilePolicy extends RootPolicy /** * Init policies on call * - * @param User $user - * @param Model $model + * @param \App\Models\User $user + * @param \Illuminate\Database\Eloquent\Model $model * @return void + * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed */ - // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed public function setPolicies(User $user, Model $model = null) { + // phpcs:enable /** * This first rule to return true in a policy action authorises the action */ diff --git a/app/Policies/LabelPolicy.php b/app/Policies/LabelPolicy.php index 7e57ccf..ea7cb7d 100644 --- a/app/Policies/LabelPolicy.php +++ b/app/Policies/LabelPolicy.php @@ -15,13 +15,14 @@ class LabelPolicy extends RootPolicy /** * Init policies on call * - * @param User $user - * @param Model $model + * @param \App\Models\User $user + * @param \Illuminate\Database\Eloquent\Model $model * @return void * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed */ public function setPolicies(User $user, Model $model = null) { + // phpcs:enable /** * This first rule to return true in a policy action authorises the action */ diff --git a/app/Policies/LogPolicy.php b/app/Policies/LogPolicy.php index b2a7c67..37e8519 100644 --- a/app/Policies/LogPolicy.php +++ b/app/Policies/LogPolicy.php @@ -17,10 +17,9 @@ class LogPolicy extends RootPolicy /** * Init policies on call * - * @param User $user - * @param Model $model + * @param \App\Models\User $user + * @param \Illuminate\Database\Eloquent\Model $model * @return void - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed */ public function setPolicies(User $user, Model $model = null) { diff --git a/app/Policies/MarkerPolicy.php b/app/Policies/MarkerPolicy.php index 224a203..e37ca5a 100644 --- a/app/Policies/MarkerPolicy.php +++ b/app/Policies/MarkerPolicy.php @@ -15,13 +15,14 @@ class MarkerPolicy extends RootPolicy /** * Init policies on call * - * @param User $user - * @param Model $model + * @param \App\Models\User $user + * @param \Illuminate\Database\Eloquent\Model $model * @return void - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed, Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed + * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed */ public function setPolicies(User $user, Model $model = null) { + // phpcs:enable /** * This first rule to return true in a policy action authorises the action */ diff --git a/app/Policies/ProjectPolicy.php b/app/Policies/ProjectPolicy.php index d73d91c..6429e52 100644 --- a/app/Policies/ProjectPolicy.php +++ b/app/Policies/ProjectPolicy.php @@ -15,13 +15,14 @@ class ProjectPolicy extends RootPolicy /** * Init policies on call * - * @param User $user - * @param Model $model + * @param \App\Models\User $user + * @param \Illuminate\Database\Eloquent\Model $model * @return void - * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed, Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed + * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed */ public function setPolicies(User $user, Model $model = null) { + // phpcs:enable /** * This first rule to return true in a policy action authorises the action */ diff --git a/app/Policies/Rules/EstimationStaticRules.php b/app/Policies/Rules/EstimationStaticRules.php index 75069fc..38ba440 100644 --- a/app/Policies/Rules/EstimationStaticRules.php +++ b/app/Policies/Rules/EstimationStaticRules.php @@ -15,7 +15,7 @@ abstract class EstimationStaticRules extends StaticRules /** * Estimation is pending * - * @param Estimation $model + * @param \App\Models\Credit\Estimation $model * @return boolean */ protected static function estimateIsPending(Estimation $model): bool diff --git a/app/Policies/Rules/LogStaticRules.php b/app/Policies/Rules/LogStaticRules.php index 042dbbd..f2a335f 100644 --- a/app/Policies/Rules/LogStaticRules.php +++ b/app/Policies/Rules/LogStaticRules.php @@ -15,8 +15,8 @@ abstract class LogStaticRules extends StaticRules /** * Log Is owned by user. * - * @param User $user - * @param Log $log + * @param \App\Models\User $user + * @param \App\Models\Log $log * @return boolean */ protected static function logIsOwnedByUser(User $user, Log $log): bool diff --git a/app/Policies/Rules/SiteStaticRules.php b/app/Policies/Rules/SiteStaticRules.php index 2920397..ef5402b 100644 --- a/app/Policies/Rules/SiteStaticRules.php +++ b/app/Policies/Rules/SiteStaticRules.php @@ -12,6 +12,13 @@ use Kwaadpepper\CrudPolicies\Policies\Rules\StaticRules; */ abstract class SiteStaticRules extends StaticRules { + /** + * Check if a user can access a ticket + * + * @param \App\Models\User $user + * @param \App\Models\Ticket $ticket + * @return boolean + */ protected static function userSitesHasTicket(User $user, Ticket $ticket) { return $user->sites->contains($ticket->site_id); diff --git a/app/Policies/Rules/TicketStaticRules.php b/app/Policies/Rules/TicketStaticRules.php index d7269b6..be26801 100644 --- a/app/Policies/Rules/TicketStaticRules.php +++ b/app/Policies/Rules/TicketStaticRules.php @@ -15,7 +15,7 @@ abstract class TicketStaticRules extends StaticRules /** * Ticket is not in production * - * @param Ticket $ticket + * @param \App\Models\Ticket $ticket * @return boolean */ protected static function ticketIsNotInProduction(Ticket $ticket): bool @@ -26,7 +26,7 @@ abstract class TicketStaticRules extends StaticRules /** * Ticket is not archived * - * @param Ticket $ticket + * @param \App\Models\Ticket $ticket * @return boolean */ protected static function ticketIsNotArchived(Ticket $ticket): bool @@ -37,7 +37,7 @@ abstract class TicketStaticRules extends StaticRules /** * Ticket has brand which has at least one account * - * @param Ticket $ticket + * @param \App\Models\Ticket $ticket * @return boolean */ protected static function ticketsBrandHasAnAccount(Ticket $ticket): bool @@ -52,7 +52,7 @@ abstract class TicketStaticRules extends StaticRules /** * Ticket does already have an estimation * - * @param Ticket $ticket + * @param \App\Models\Ticket $ticket * @return boolean */ protected static function ticketDoesHaveEstimation(Ticket $ticket): bool @@ -63,7 +63,7 @@ abstract class TicketStaticRules extends StaticRules /** * Ticket does not already have an estimation * - * @param Ticket $ticket + * @param \App\Models\Ticket $ticket * @return boolean */ protected static function ticketDoesntHaveEstimation(Ticket $ticket): bool @@ -74,7 +74,7 @@ abstract class TicketStaticRules extends StaticRules /** * Ticket is not internal * - * @param Ticket $ticket + * @param \App\Models\Ticket $ticket * @return boolean */ protected static function ticketIsNotInternal(Ticket $ticket): bool diff --git a/app/Policies/SitePolicy.php b/app/Policies/SitePolicy.php index ee6a055..0db04f7 100644 --- a/app/Policies/SitePolicy.php +++ b/app/Policies/SitePolicy.php @@ -15,13 +15,14 @@ class SitePolicy extends RootPolicy /** * Init policies on call * - * @param User $user - * @param Model $model + * @param \App\Models\User $user + * @param \Illuminate\Database\Eloquent\Model $model * @return void * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed */ public function setPolicies(User $user, Model $model = null) { + // phpcs:enable /** * This first rule to return true in a policy action authorises the action */ diff --git a/app/Policies/TicketPolicy.php b/app/Policies/TicketPolicy.php index 04659d1..b31d2db 100644 --- a/app/Policies/TicketPolicy.php +++ b/app/Policies/TicketPolicy.php @@ -18,8 +18,8 @@ class TicketPolicy extends RootPolicy /** * Init policies on call * - * @param User $user - * @param Model $model + * @param \App\Models\User $user + * @param \Illuminate\Database\Eloquent\Model $model * @return void */ public function setPolicies(User $user, Model $model = null) diff --git a/app/Policies/UserPolicy.php b/app/Policies/UserPolicy.php index 81b32b8..531a6dc 100644 --- a/app/Policies/UserPolicy.php +++ b/app/Policies/UserPolicy.php @@ -15,13 +15,14 @@ class UserPolicy extends RootPolicy /** * Init policies on call * - * @param User $user - * @param Model $model + * @param \App\Models\User $user + * @param \Illuminate\Database\Eloquent\Model $model * @return void + * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed */ - // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed public function setPolicies(User $user, Model $model = null) { + // phpcs:enable /** * This first rule to return true in a policy action authorises the action */ diff --git a/app/Providers/TranslationServiceProvider.php b/app/Providers/TranslationServiceProvider.php index 7d7270b..757546c 100644 --- a/app/Providers/TranslationServiceProvider.php +++ b/app/Providers/TranslationServiceProvider.php @@ -2,6 +2,7 @@ namespace App\Providers; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Cache; use Illuminate\Support\ServiceProvider; @@ -15,10 +16,8 @@ class TranslationServiceProvider extends ServiceProvider */ public function boot() { - $translations = collect(); - foreach ($this->collectLocalesStrings() as $locale) { -// suported locales + // * Suported locales Cache::rememberForever(sprintf('translations.%s', $locale), function () use ($locale) { $translations = [ 'php' => $this->phpTranslations($locale), @@ -29,7 +28,12 @@ class TranslationServiceProvider extends ServiceProvider } } - private function collectLocalesStrings() + /** + * Gather provided langs checking from files + * + * @return \Illuminate\Support\Collection + */ + private function collectLocalesStrings(): Collection { return collect(File::allFiles(resource_path('lang/')))->flatMap(function ($file) { if ($file->getRelativePath()) { @@ -38,23 +42,34 @@ class TranslationServiceProvider extends ServiceProvider })->keys(); } - private function phpTranslations($locale) + /** + * Gather all php translations + * + * @param string $locale + * @return array + */ + private function phpTranslations(string $locale): array { $path = resource_path("lang/$locale"); return collect(File::allFiles($path))->flatMap(function ($file) use ($locale) { - $key = ($translation = $file->getBasename('.php')); - - return [$key => trans($translation, [], $locale)]; - }); + $translation = $file->getBasename('.php'); + return [$translation => trans($translation, [], $locale)]; + })->all(); } - private function jsonTranslations($locale) + /** + * Gather json translations + * + * @param string $locale + * @return array + */ + private function jsonTranslations(string $locale): array { $path = resource_path("lang/$locale.json"); if (is_string($path) && is_readable($path)) { - return json_decode(file_get_contents($path), true); + return json_decode(file_get_contents($path), true) ?? []; } return []; diff --git a/config/mail.php b/config/mail.php index 3d21f8c..3b89e95 100644 --- a/config/mail.php +++ b/config/mail.php @@ -15,7 +15,7 @@ return [ 'default' => env('MAIL_MAILER', 'smtp'), - // Mail admin + // * Mail admin 'MAIL_ADMIN' => env('MAIL_ADMIN'), /* diff --git a/config/trustedproxy.php b/config/trustedproxy.php index fbc4604..ee9fc90 100644 --- a/config/trustedproxy.php +++ b/config/trustedproxy.php @@ -15,6 +15,7 @@ return [ * of your proxy (e.g. if using ELB or similar). * */ + 'proxies' => '*', /* @@ -42,6 +43,10 @@ return [ * * @link https://symfony.com/doc/current/deployment/proxies.html */ - 'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL, + + 'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_FOR | + Illuminate\Http\Request::HEADER_X_FORWARDED_HOST | + Illuminate\Http\Request::HEADER_X_FORWARDED_PORT | + Illuminate\Http\Request::HEADER_X_FORWARDED_PROTO, ]; diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index a7d2e31..7b01f11 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -26,8 +26,8 @@ class UserFactory extends Factory 'name' => $this->faker->name, 'email' => $this->faker->unique()->safeEmail, 'email_verified_at' => now(), + // * password 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', -// password 'remember_token' => Str::random(10), ]; } diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 57b73b5..cac798a 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -13,6 +13,5 @@ class DatabaseSeeder extends Seeder */ public function run() { - // \App\Models\User::factory(10)->create(); } } diff --git a/phpcs.xml b/phpcs.xml index d81492f..f11c054 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,14 +1,13 @@ - + Created with the PHP Coding Standard Generator. http://edorian.github.com/php-coding-standard-generator/ app/ config/ database/factories + database/seeders routes/ - tests/