merge([ 'status' => $this->status ? true : false ]); return auth()->check(); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'picture' => 'required|image|mimes:jpeg,png,jpg|max:2048|dimensions:width=1366,height=553', 'content' => 'required|string|min:10', 'type' => [ 'required', // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed function ($attribute, $value, $fail) { $types = OCBType::toValues(); if (!\in_array(\intval($value), $types)) { $fail("Le type n'est pas valide '$value'"); } } ], 'status' => 'required|boolean' ]; } }