diff --git a/app/Actions/Fortify/CreateNewUser.php b/app/Actions/Fortify/CreateNewUser.php index 4af42740..bd25d4d1 100755 --- a/app/Actions/Fortify/CreateNewUser.php +++ b/app/Actions/Fortify/CreateNewUser.php @@ -22,37 +22,37 @@ class CreateNewUser implements CreatesNewUsers public function create(array $input) { Validator::make($input, [ - 'name' => ['required', 'string', 'max:511'], - 'email' => ['required', 'string', 'email:rfc,dns', 'max:511', 'unique:users'], - 'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'], + 'name' => ['required', 'string', 'max:511'], + 'email' => ['required', 'string', 'email:rfc,dns', 'max:511', 'unique:users'], + 'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'], 'password' => $this->passwordRules(), // 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['required', 'accepted'] : '', - 'school_id' => ['required', 'exists:schools,id'], - 'birthday' => ['required', 'date', 'before:today'], - 'address' => ['required', 'string', 'max:500'], + 'school_id' => ['required', 'exists:schools,id'], + 'birthday' => ['required', 'date', 'before:today'], + 'address' => ['required', 'string', 'max:500'], 'blood_group' => ['required', 'string', 'max:255'], - 'religion' => ['nullable', 'string', 'max:255'], + 'religion' => ['nullable', 'string', 'max:255'], 'nationality' => ['required', 'string', 'max:255'], - 'state' => ['required', 'string', 'max:255'], - 'city' => ['required', 'string', 'max:255'], - 'gender' => ['required', 'string', 'max:255'], - 'phone' => ['nullable', 'string', 'max:255'], + 'state' => ['required', 'string', 'max:255'], + 'city' => ['required', 'string', 'max:255'], + 'gender' => ['required', 'string', 'max:255'], + 'phone' => ['nullable', 'string', 'max:255'], ])->validate(); $user = User::create([ - 'name' => $input['name'], - 'email' => $input['email'], - 'birthday' => $input['birthday'], - 'password' => Hash::make($input['password']), - 'address' => $input['address'], - 'school_id' => $input['school_id'], + 'name' => $input['name'], + 'email' => $input['email'], + 'birthday' => $input['birthday'], + 'password' => Hash::make($input['password']), + 'address' => $input['address'], + 'school_id' => $input['school_id'], 'blood_group' => $input['blood_group'], - 'religion' => $input['religion'], + 'religion' => $input['religion'], 'nationality' => $input['nationality'], - 'state' => $input['state'], - 'city' => $input['city'], - 'gender' => $input['gender'], - 'phone' => $input['phone'], + 'state' => $input['state'], + 'city' => $input['city'], + 'gender' => $input['gender'], + 'phone' => $input['phone'], ]); if (isset($input['photo'])) { diff --git a/app/Actions/Fortify/ResetUserPassword.php b/app/Actions/Fortify/ResetUserPassword.php index 86e38cc4..3e57f8aa 100755 --- a/app/Actions/Fortify/ResetUserPassword.php +++ b/app/Actions/Fortify/ResetUserPassword.php @@ -13,7 +13,8 @@ class ResetUserPassword implements ResetsUserPasswords /** * Validate and reset the user's forgotten password. * - * @param mixed $user + * @param mixed $user + * * @return void */ public function reset($user, array $input) diff --git a/app/Actions/Fortify/UpdateUserPassword.php b/app/Actions/Fortify/UpdateUserPassword.php index d61f767d..e938ccd5 100755 --- a/app/Actions/Fortify/UpdateUserPassword.php +++ b/app/Actions/Fortify/UpdateUserPassword.php @@ -13,16 +13,17 @@ class UpdateUserPassword implements UpdatesUserPasswords /** * Validate and update the user's password. * - * @param mixed $user + * @param mixed $user + * * @return void */ public function update($user, array $input) { Validator::make($input, [ 'current_password' => ['required', 'string'], - 'password' => $this->passwordRules(), + 'password' => $this->passwordRules(), ])->after(function ($validator) use ($user, $input) { - if (! isset($input['current_password']) || ! Hash::check($input['current_password'], $user->password)) { + if (!isset($input['current_password']) || !Hash::check($input['current_password'], $user->password)) { $validator->errors()->add('current_password', __('The provided password does not match your current password.')); } })->validateWithBag('updatePassword'); diff --git a/app/Actions/Fortify/UpdateUserProfileInformation.php b/app/Actions/Fortify/UpdateUserProfileInformation.php index c3d0669f..3db44b24 100755 --- a/app/Actions/Fortify/UpdateUserProfileInformation.php +++ b/app/Actions/Fortify/UpdateUserProfileInformation.php @@ -12,24 +12,25 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation /** * Validate and update the given user's profile information. * - * @param mixed $user + * @param mixed $user + * * @return void */ public function update($user, array $input) { Validator::make($input, [ - 'name' => ['required', 'string', 'max:255'], - 'email' => ['required', 'email:rfc,dns', 'max:255', Rule::unique('users')->ignore($user->id)], - 'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'], - 'birthday' => ['required', 'date', 'before:today'], - 'address' => ['required', 'string', 'max:500'], + 'name' => ['required', 'string', 'max:255'], + 'email' => ['required', 'email:rfc,dns', 'max:255', Rule::unique('users')->ignore($user->id)], + 'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'], + 'birthday' => ['required', 'date', 'before:today'], + 'address' => ['required', 'string', 'max:500'], 'blood_group' => ['required', 'string', 'max:255'], - 'religion' => ['nullable', 'string', 'max:255'], + 'religion' => ['nullable', 'string', 'max:255'], 'nationality' => ['required', 'string', 'max:255'], - 'state' => ['required', 'string', 'max:255'], - 'city' => ['required', 'string', 'max:255'], - 'gender' => ['required', 'string', 'max:255'], - 'phone' => ['nullable', 'string', 'max:255'], + 'state' => ['required', 'string', 'max:255'], + 'city' => ['required', 'string', 'max:255'], + 'gender' => ['required', 'string', 'max:255'], + 'phone' => ['nullable', 'string', 'max:255'], ])->validate(); if (isset($input['photo'])) { @@ -41,17 +42,17 @@ public function update($user, array $input) $this->updateVerifiedUser($user, $input); } else { $user->forceFill([ - 'name' => $input['name'], - 'email' => $input['email'], - 'birthday' => $input['birthday'], - 'address' => $input['address'], + 'name' => $input['name'], + 'email' => $input['email'], + 'birthday' => $input['birthday'], + 'address' => $input['address'], 'blood_group' => $input['blood_group'], - 'religion' => $input['religion'] ?? '', + 'religion' => $input['religion'] ?? '', 'nationality' => $input['nationality'], - 'state' => $input['state'], - 'city' => $input['city'], - 'gender' => $input['gender'], - 'phone' => $input['phone'] ?? '', + 'state' => $input['state'], + 'city' => $input['city'], + 'gender' => $input['gender'], + 'phone' => $input['phone'] ?? '', ])->save(); } @@ -61,24 +62,25 @@ public function update($user, array $input) /** * Update the given verified user's profile information. * - * @param mixed $user + * @param mixed $user + * * @return void */ protected function updateVerifiedUser($user, array $input) { $user->forceFill([ - 'name' => $input['name'], - 'email' => $input['email'], + 'name' => $input['name'], + 'email' => $input['email'], 'email_verified_at' => null, - 'birthday' => $input['birthday'], - 'address' => $input['address'], - 'blood_group' => $input['blood_group'], - 'religion' => $input['religion'] ?? '', - 'nationality' => $input['nationality'], - 'state' => $input['state'], - 'city' => $input['city'], - 'gender' => $input['gender'], - 'phone' => $input['phone'] ?? '', + 'birthday' => $input['birthday'], + 'address' => $input['address'], + 'blood_group' => $input['blood_group'], + 'religion' => $input['religion'] ?? '', + 'nationality' => $input['nationality'], + 'state' => $input['state'], + 'city' => $input['city'], + 'gender' => $input['gender'], + 'phone' => $input['phone'] ?? '', ])->save(); $user->sendEmailVerificationNotification(); diff --git a/app/Actions/Jetstream/DeleteUser.php b/app/Actions/Jetstream/DeleteUser.php index 4846a069..7961f5d6 100755 --- a/app/Actions/Jetstream/DeleteUser.php +++ b/app/Actions/Jetstream/DeleteUser.php @@ -9,7 +9,8 @@ class DeleteUser implements DeletesUsers /** * Delete the given user. * - * @param mixed $user + * @param mixed $user + * * @return void */ public function delete($user) diff --git a/app/Console/Commands/CreateSuperAdmin.php b/app/Console/Commands/CreateSuperAdmin.php index 001a83d9..b914b13c 100755 --- a/app/Console/Commands/CreateSuperAdmin.php +++ b/app/Console/Commands/CreateSuperAdmin.php @@ -61,16 +61,16 @@ public function handle() //validate the input $validator = Validator::make([ - 'first_name' => $firstName, - 'last_name' => $lastName, - 'email' => $email, - 'password' => $password, + 'first_name' => $firstName, + 'last_name' => $lastName, + 'email' => $email, + 'password' => $password, 'password_confirmation' => $passwordConfirmation, ], [ 'first_name' => ['required', 'string', 'max:511'], - 'last_name' => ['required', 'string', 'max:511'], - 'email' => ['required', 'string', 'email', 'max:511', 'unique:users'], - 'password' => $this->passwordRules(), + 'last_name' => ['required', 'string', 'max:511'], + 'email' => ['required', 'string', 'email', 'max:511', 'unique:users'], + 'password' => $this->passwordRules(), ]); //display validation error @@ -81,16 +81,16 @@ public function handle() //create super admin $superAdmin = User::firstOrCreate([ - 'name' => "$firstName $lastName", - 'email' => $email, - 'password' => Hash::make($password), - 'address' => 'super admin street', - 'birthday' => '22/04/04', + 'name' => "$firstName $lastName", + 'email' => $email, + 'password' => Hash::make($password), + 'address' => 'super admin street', + 'birthday' => '22/04/04', 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', + 'state' => 'lagos', + 'city' => 'lagos', 'blood_group' => 'A+', - 'gender' => 'male', + 'gender' => 'male', ]); //assign role diff --git a/app/Console/Commands/InitCommand.php b/app/Console/Commands/InitCommand.php index 05d76e32..462abd5f 100755 --- a/app/Console/Commands/InitCommand.php +++ b/app/Console/Commands/InitCommand.php @@ -89,7 +89,7 @@ public function generateEnv() { $this->newLine(); $this->line('Generating .env file.....'); - if (! file_exists(base_path('.env'))) { + if (!file_exists(base_path('.env'))) { $this->components->task('Copying .env file', static function (): void { copy(base_path('.env.example'), base_path('.env')); }); @@ -104,7 +104,7 @@ public function generateAppKey() $this->line('Generating app encryption key'); $key = $this->laravel['config']['app.key']; - if (! $key) { + if (!$key) { $this->call('key:generate'); } else { $this->info('Encryption key exists already -- skipping'); @@ -229,15 +229,15 @@ public function setMailCredentials() $mailReplyName = $this->ask('Mail Reply Name', getenv('MAIL_REPLY_NAME')); $mailCredentials = [ - 'MAIL_MAILER' => $mailMailer, - 'MAIL_HOST' => $mailHost, - 'MAIL_PORT' => $mailPort, - 'MAIL_USERNAME' => $mailUsername, - 'MAIL_PASSWORD' => $mailPassword, - 'MAIL_FROM_ADDRESS' => $mailFromAddress, - 'MAIL_FROM_NAME' => $mailFromName, + 'MAIL_MAILER' => $mailMailer, + 'MAIL_HOST' => $mailHost, + 'MAIL_PORT' => $mailPort, + 'MAIL_USERNAME' => $mailUsername, + 'MAIL_PASSWORD' => $mailPassword, + 'MAIL_FROM_ADDRESS' => $mailFromAddress, + 'MAIL_FROM_NAME' => $mailFromName, 'MAIL_REPLY_ADDRESS' => $mailReplyAddress, - 'MAIL_REPLY_NAME' => $mailReplyName, + 'MAIL_REPLY_NAME' => $mailReplyName, ]; $this->setEnvironmentValue($mailCredentials); diff --git a/app/Console/Commands/UpdateApplicationCommand.php b/app/Console/Commands/UpdateApplicationCommand.php index a2e1137b..d4b9b97f 100644 --- a/app/Console/Commands/UpdateApplicationCommand.php +++ b/app/Console/Commands/UpdateApplicationCommand.php @@ -49,7 +49,7 @@ private function intro() sleep(2); - if (! $this->confirm('Do you wish to continue?')) { + if (!$this->confirm('Do you wish to continue?')) { $this->error('Operation cancelled, thank you for using Skuul'); exit(); } @@ -111,7 +111,7 @@ public function splitVersionNumber($versionNumber) public function optimize() { - if (! $this->confirm('Do you want to optimize this application?')) { + if (!$this->confirm('Do you want to optimize this application?')) { return; } diff --git a/app/Events/AccountStatusChanged.php b/app/Events/AccountStatusChanged.php index 1c964782..8f8151e2 100644 --- a/app/Events/AccountStatusChanged.php +++ b/app/Events/AccountStatusChanged.php @@ -35,7 +35,7 @@ class AccountStatusChanged /** * Create a new event instance. * - * @param string $reason + * @param string $reason */ public function __construct(User $applicant, string $status, ?string $reason = '') { diff --git a/app/Exceptions/ApplicationException.php b/app/Exceptions/ApplicationException.php index cdfd95d2..1643faff 100644 --- a/app/Exceptions/ApplicationException.php +++ b/app/Exceptions/ApplicationException.php @@ -10,7 +10,8 @@ class ApplicationException extends Exception /** * Render the exception into an HTTP response. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request + * * @return \Illuminate\Http\Response */ public function render($request) diff --git a/app/Http/Controllers/AccountApplicationController.php b/app/Http/Controllers/AccountApplicationController.php index 3aa919fc..9c037eba 100755 --- a/app/Http/Controllers/AccountApplicationController.php +++ b/app/Http/Controllers/AccountApplicationController.php @@ -115,7 +115,8 @@ public function changeStatusView(User $applicant) /** * Change Application Status. * - * @param Request $request + * @param Request $request + * * @return void */ public function changeStatus(User $applicant, AccountApplicationStatusChangeRequest $request) diff --git a/app/Http/Controllers/ExamController.php b/app/Http/Controllers/ExamController.php index a8b4bdf3..e2d422ad 100755 --- a/app/Http/Controllers/ExamController.php +++ b/app/Http/Controllers/ExamController.php @@ -141,7 +141,7 @@ public function setExamActiveStatus(Exam $exam, UpdateExamStatusRequest $request /** * Set publish result status. * - * @param UpdatePublishResultStatusRequest $request + * @param UpdatePublishResultStatusRequest $request */ public function setPublishResultStatus(Exam $exam, UpdateExamStatusRequest $request): RedirectResponse { diff --git a/app/Http/Controllers/GraduationController.php b/app/Http/Controllers/GraduationController.php index 39081146..c5ee91b2 100755 --- a/app/Http/Controllers/GraduationController.php +++ b/app/Http/Controllers/GraduationController.php @@ -26,7 +26,7 @@ public function __construct(StudentService $studentService, UserService $userSer */ public function index() { - if (! auth()->user()->can('view graduations')) { + if (!auth()->user()->can('view graduations')) { return abort(403, 'Unauthorized action.'); } @@ -36,13 +36,13 @@ public function index() /** * Graduate view. * - * @return \Illuminate\Http\Response - * * @throws \Illuminate\Auth\Access\AuthorizationException + * + * @return \Illuminate\Http\Response */ public function graduateView() { - if (! auth()->user()->can('graduate student')) { + if (!auth()->user()->can('graduate student')) { return abort(403, 'Unauthorized action.'); } @@ -57,7 +57,7 @@ public function graduateView() */ public function graduate(StudentGraduateRequest $request) { - if (! auth()->user()->can('graduate student')) { + if (!auth()->user()->can('graduate student')) { return abort(403, 'Unauthorized action.'); } $data = collect($request->except('_token')); @@ -74,7 +74,7 @@ public function graduate(StudentGraduateRequest $request) */ public function resetGraduation(User $student) { - if (! auth()->user()->can('reset graduation')) { + if (!auth()->user()->can('reset graduation')) { return abort(403, 'Unauthorized action.'); } $this->userService->verifyUserIsOfRoleElseNotFound($student, 'student'); diff --git a/app/Http/Controllers/MyClassController.php b/app/Http/Controllers/MyClassController.php index 375b277f..c8206679 100755 --- a/app/Http/Controllers/MyClassController.php +++ b/app/Http/Controllers/MyClassController.php @@ -73,7 +73,7 @@ public function edit(MyClass $class): View /** * Update the specified resource in storage. * - * @param MyClassStoreRequest $request + * @param MyClassStoreRequest $request */ public function update(MyClassUpdateRequest $request, MyClass $class): RedirectResponse { diff --git a/app/Http/Controllers/TimetableTimeSlotController.php b/app/Http/Controllers/TimetableTimeSlotController.php index 51c358bb..91f0e023 100755 --- a/app/Http/Controllers/TimetableTimeSlotController.php +++ b/app/Http/Controllers/TimetableTimeSlotController.php @@ -78,7 +78,8 @@ public function update(UpdateTimetableTimeSlotRequest $request, $timetable, Time /** * Remove the specified resource from storage. * - * @param Timetable $timetable + * @param Timetable $timetable + * * @return \Illuminate\Http\Response */ public function destroy(TimetableTimeSlot $timeSlot): RedirectResponse diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 6dd6ecff..c64d33b5 100755 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -54,17 +54,17 @@ class Kernel extends HttpKernel * @var array */ protected $routeMiddleware = [ - 'auth' => \App\Http\Middleware\Authenticate::class, - 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, - 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, - 'can' => \Illuminate\Auth\Middleware\Authorize::class, - 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, - 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, - 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, - 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, - 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, - 'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class, - 'permission' => \Spatie\Permission\Middlewares\PermissionMiddleware::class, + 'auth' => \App\Http\Middleware\Authenticate::class, + 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, + 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, + 'can' => \Illuminate\Auth\Middleware\Authorize::class, + 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, + 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, + 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, + 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, + 'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class, + 'permission' => \Spatie\Permission\Middlewares\PermissionMiddleware::class, 'role_or_permission' => \Spatie\Permission\Middlewares\RoleOrPermissionMiddleware::class, ]; } diff --git a/app/Http/Livewire/AcademicYearResultTabulation.php b/app/Http/Livewire/AcademicYearResultTabulation.php index 823bfd6b..b16d0ab6 100644 --- a/app/Http/Livewire/AcademicYearResultTabulation.php +++ b/app/Http/Livewire/AcademicYearResultTabulation.php @@ -38,7 +38,7 @@ public function mount(MyClassService $myClassService) $this->classes = $myClassService->getAllClasses(); //sets subjects etc if class isn't empty - if (! $this->classes->isEmpty()) { + if (!$this->classes->isEmpty()) { $this->class = $this->classes[0]->id; $this->sections = $this->classes[0]->sections; $this->section = $this->sections[0]->id; diff --git a/app/Http/Livewire/Datatable.php b/app/Http/Livewire/Datatable.php index 89959ba7..979e1a63 100644 --- a/app/Http/Livewire/Datatable.php +++ b/app/Http/Livewire/Datatable.php @@ -27,7 +27,8 @@ class Datatable extends Component public int $perPage = 10; /** - * @param string|Builder $model Pass model or query builder + * @param string|Builder $model Pass model or query builder + * * @return void */ public function mount(string|Builder $model, array $columns, array $filters = [], $uniqueId = null) @@ -42,14 +43,15 @@ public function mount(string|Builder $model, array $columns, array $filters = [] /** * Verify if a class is an eloquent model. * - * @param object $model - * @return bool + * @param object $model * * @throws Exception + * + * @return bool */ public function verifyIsModel($model) { - if (! is_subclass_of($model, 'Illuminate\Database\Eloquent\Model')) { + if (!is_subclass_of($model, 'Illuminate\Database\Eloquent\Model')) { throw new \Exception(sprintf('Class %s is not a model', $model), 1); } @@ -79,8 +81,8 @@ public function addSearchFilter($model) //create closure with filters to be applied to model $searchFilter = function ($query) use ($model) { foreach ($this->columns as $column) { - if (! array_key_exists('columnName', $column)) { - if (! array_key_exists('property', $column) || empty($column['property'])) { + if (!array_key_exists('columnName', $column)) { + if (!array_key_exists('property', $column) || empty($column['property'])) { break; } } @@ -88,7 +90,7 @@ public function addSearchFilter($model) //get table name from either DatabaseBuilder or EloQuent model $table = $model->getModel()->getTable() ?? $model?->getQuery()->getModel()->getTable(); - if (array_key_exists('relation', $column) && ! empty($column['relation'])) { + if (array_key_exists('relation', $column) && !empty($column['relation'])) { //filter relation $query = call_user_func_array([$query, 'orWhereRelation'], [$column['relation'], $column['columnName'] ?? $column['property'], 'LIKE', "%$this->search%"]); } else { diff --git a/app/Http/Livewire/ExamTabulation.php b/app/Http/Livewire/ExamTabulation.php index 08bb047e..d806e17b 100644 --- a/app/Http/Livewire/ExamTabulation.php +++ b/app/Http/Livewire/ExamTabulation.php @@ -53,7 +53,7 @@ public function mount(ExamService $examService, SectionService $sectionService, $this->classes = $myClassService->getAllClasses(); //sets subjects etc if class isn't empty - if (! $this->classes->isEmpty()) { + if (!$this->classes->isEmpty()) { $this->class = $this->classes[0]->id; $this->sections = $this->classes[0]->sections; $this->section = $this->sections[0]->id; diff --git a/app/Http/Livewire/GraduateStudents.php b/app/Http/Livewire/GraduateStudents.php index 093eb7af..0debb769 100644 --- a/app/Http/Livewire/GraduateStudents.php +++ b/app/Http/Livewire/GraduateStudents.php @@ -20,7 +20,7 @@ class GraduateStudents extends Component public $students; protected $rules = [ - 'class' => 'required|exists:my_classes,id', + 'class' => 'required|exists:my_classes,id', 'section' => 'required|exists:sections,id', ]; diff --git a/app/Http/Livewire/Layouts/Menu.php b/app/Http/Livewire/Layouts/Menu.php index bd5669ba..aa137b03 100644 --- a/app/Http/Livewire/Layouts/Menu.php +++ b/app/Http/Livewire/Layouts/Menu.php @@ -12,16 +12,16 @@ public function mount() { $this->menu = [ [ - 'type' => 'menu-item', - 'icon' => 'fas fa-tachometer-alt', - 'text' => 'Dashboard', + 'type' => 'menu-item', + 'icon' => 'fas fa-tachometer-alt', + 'text' => 'Dashboard', 'route' => 'dashboard', ], ['header' => 'Manage Profile'], [ - 'type' => 'menu-item', - 'icon' => 'fas fa-user', - 'text' => 'User Profile', + 'type' => 'menu-item', + 'icon' => 'fas fa-user', + 'text' => 'User Profile', 'route' => 'profile.show', ], ['header' => 'Multi Schools Management', 'can' => 'header-schools'], @@ -29,421 +29,421 @@ public function mount() 'type' => 'menu-item', 'text' => 'Schools', 'icon' => 'fas fa-school', - 'can' => 'menu-school', + 'can' => 'menu-school', 'submenu' => [[ - 'type' => 'menu-item', - 'text' => 'View Schools', + 'type' => 'menu-item', + 'text' => 'View Schools', 'route' => 'schools.index', - 'can' => 'read school', + 'can' => 'read school', ], [ - 'type' => 'menu-item', - 'text' => 'Create School', + 'type' => 'menu-item', + 'text' => 'Create School', 'route' => 'schools.create', - 'can' => 'create school', + 'can' => 'create school', ], ], ], ['header' => 'Administration', 'can' => 'header-administrate'], [ - 'type' => 'menu-item', - 'icon' => 'fas fa-cog', - 'text' => 'School Settings', + 'type' => 'menu-item', + 'icon' => 'fas fa-cog', + 'text' => 'School Settings', 'route' => 'schools.settings', - 'can' => 'manage school settings', + 'can' => 'manage school settings', ], [ - 'type' => 'menu-item', - 'text' => 'Classes', - 'icon' => 'fas fa-chalkboard', - 'can' => 'menu-class', + 'type' => 'menu-item', + 'text' => 'Classes', + 'icon' => 'fas fa-chalkboard', + 'can' => 'menu-class', 'submenu' => [ [ - 'type' => 'menu-item', - 'text' => 'View Class Groups', + 'type' => 'menu-item', + 'text' => 'View Class Groups', 'route' => 'class-groups.index', - 'can' => 'read class group', + 'can' => 'read class group', ], [ - 'type' => 'menu-item', - 'text' => 'Create Class Group', + 'type' => 'menu-item', + 'text' => 'Create Class Group', 'route' => 'class-groups.create', - 'can' => 'create class group', + 'can' => 'create class group', ], [ - 'type' => 'menu-item', - 'text' => 'View Classes', + 'type' => 'menu-item', + 'text' => 'View Classes', 'route' => 'classes.index', - 'can' => 'read class', + 'can' => 'read class', ], [ - 'type' => 'menu-item', - 'text' => 'Create Class', + 'type' => 'menu-item', + 'text' => 'Create Class', 'route' => 'classes.create', - 'can' => 'create class', + 'can' => 'create class', ], ], ], [ - 'type' => 'menu-item', - 'text' => 'Sections', - 'icon' => 'fas fa-landmark', - 'can' => 'menu-section', + 'type' => 'menu-item', + 'text' => 'Sections', + 'icon' => 'fas fa-landmark', + 'can' => 'menu-section', 'submenu' => [ [ - 'type' => 'menu-item', - 'text' => 'View sections', + 'type' => 'menu-item', + 'text' => 'View sections', 'route' => 'sections.index', - 'can' => 'read section', + 'can' => 'read section', ], [ - 'type' => 'menu-item', - 'text' => 'Create section', + 'type' => 'menu-item', + 'text' => 'Create section', 'route' => 'sections.create', - 'can' => 'create section', + 'can' => 'create section', ], ], ], [ - 'type' => 'menu-item', - 'text' => 'Students', - 'icon' => 'fas fa-user', - 'can' => 'menu-student', + 'type' => 'menu-item', + 'text' => 'Students', + 'icon' => 'fas fa-user', + 'can' => 'menu-student', 'submenu' => [ [ - 'type' => 'menu-item', - 'text' => 'View students', + 'type' => 'menu-item', + 'text' => 'View students', 'route' => 'students.index', - 'can' => 'read student', + 'can' => 'read student', ], [ - 'type' => 'menu-item', - 'text' => 'Create student', + 'type' => 'menu-item', + 'text' => 'Create student', 'route' => 'students.create', - 'can' => 'create student', + 'can' => 'create student', ], [ - 'type' => 'menu-item', - 'text' => 'Promote students', + 'type' => 'menu-item', + 'text' => 'Promote students', 'route' => 'students.promote', - 'can' => 'promote student', + 'can' => 'promote student', ], [ - 'type' => 'menu-item', - 'text' => 'Manage promotions', + 'type' => 'menu-item', + 'text' => 'Manage promotions', 'route' => 'students.promotions', - 'can' => 'read promotion', + 'can' => 'read promotion', ], [ - 'type' => 'menu-item', - 'text' => 'Graduate students', + 'type' => 'menu-item', + 'text' => 'Graduate students', 'route' => 'students.graduate', - 'can' => 'graduate student', + 'can' => 'graduate student', ], [ - 'type' => 'menu-item', - 'text' => 'Manage graduations', + 'type' => 'menu-item', + 'text' => 'Manage graduations', 'route' => 'students.graduations', - 'can' => 'view graduations', + 'can' => 'view graduations', ], ], ], [ - 'type' => 'menu-item', - 'text' => 'Account Applications', - 'icon' => 'fas fa-plus', - 'can' => 'menu-account-application', + 'type' => 'menu-item', + 'text' => 'Account Applications', + 'icon' => 'fas fa-plus', + 'can' => 'menu-account-application', 'submenu' => [ [ - 'type' => 'menu-item', - 'text' => 'View account applications', + 'type' => 'menu-item', + 'text' => 'View account applications', 'route' => 'account-applications.index', - 'can' => 'read applicant', + 'can' => 'read applicant', ], [ - 'type' => 'menu-item', - 'text' => 'View rejected applications', + 'type' => 'menu-item', + 'text' => 'View rejected applications', 'route' => 'account-applications.rejected-applications', - 'can' => 'read applicant', + 'can' => 'read applicant', ], ], ], [ - 'type' => 'menu-item', - 'text' => 'Teachers', - 'icon' => 'fas fa-user', - 'can' => 'menu-teacher', + 'type' => 'menu-item', + 'text' => 'Teachers', + 'icon' => 'fas fa-user', + 'can' => 'menu-teacher', 'submenu' => [ [ - 'type' => 'menu-item', - 'text' => 'View teachers', + 'type' => 'menu-item', + 'text' => 'View teachers', 'route' => 'teachers.index', - 'can' => 'read teacher', + 'can' => 'read teacher', ], [ - 'type' => 'menu-item', - 'text' => 'Create teacher', + 'type' => 'menu-item', + 'text' => 'Create teacher', 'route' => 'teachers.create', - 'can' => 'create teacher', + 'can' => 'create teacher', ], ], ], [ - 'type' => 'menu-item', - 'text' => 'Parents', - 'icon' => 'fas fa-user', - 'can' => 'menu-parent', + 'type' => 'menu-item', + 'text' => 'Parents', + 'icon' => 'fas fa-user', + 'can' => 'menu-parent', 'submenu' => [ [ - 'type' => 'menu-item', - 'text' => 'View parents', + 'type' => 'menu-item', + 'text' => 'View parents', 'route' => 'parents.index', - 'can' => 'read parent', + 'can' => 'read parent', ], [ - 'type' => 'menu-item', - 'text' => 'Create parent', + 'type' => 'menu-item', + 'text' => 'Create parent', 'route' => 'parents.create', - 'can' => 'create parent', + 'can' => 'create parent', ], ], ], [ - 'type' => 'menu-item', - 'text' => 'Admins', - 'icon' => 'fas fa-user', - 'can' => 'menu-admin', + 'type' => 'menu-item', + 'text' => 'Admins', + 'icon' => 'fas fa-user', + 'can' => 'menu-admin', 'submenu' => [ [ - 'type' => 'menu-item', - 'text' => 'View admins', + 'type' => 'menu-item', + 'text' => 'View admins', 'route' => 'admins.index', - 'can' => 'read admin', + 'can' => 'read admin', ], [ - 'type' => 'menu-item', - 'text' => 'Create admin', + 'type' => 'menu-item', + 'text' => 'Create admin', 'route' => 'admins.create', - 'can' => 'create admin', + 'can' => 'create admin', ], ], ], [ - 'type' => 'menu-item', - 'text' => 'Academic years', - 'icon' => 'fas fa-calendar', - 'can' => 'menu-academic-year', + 'type' => 'menu-item', + 'text' => 'Academic years', + 'icon' => 'fas fa-calendar', + 'can' => 'menu-academic-year', 'submenu' => [ [ - 'type' => 'menu-item', - 'text' => 'View academic years', + 'type' => 'menu-item', + 'text' => 'View academic years', 'route' => 'academic-years.index', - 'can' => 'read academic year', + 'can' => 'read academic year', ], [ - 'type' => 'menu-item', - 'text' => 'Create academic year', + 'type' => 'menu-item', + 'text' => 'Create academic year', 'route' => 'academic-years.create', - 'can' => 'create academic year', + 'can' => 'create academic year', ], ], ], [ - 'type' => 'menu-item', - 'text' => 'Semesters', - 'icon' => 'fas fa-clock', - 'can' => 'menu-semester', + 'type' => 'menu-item', + 'text' => 'Semesters', + 'icon' => 'fas fa-clock', + 'can' => 'menu-semester', 'submenu' => [ [ - 'type' => 'menu-item', - 'text' => 'View semesters', + 'type' => 'menu-item', + 'text' => 'View semesters', 'route' => 'semesters.index', - 'can' => 'read semester', + 'can' => 'read semester', ], [ - 'type' => 'menu-item', - 'text' => 'Create semester', + 'type' => 'menu-item', + 'text' => 'Create semester', 'route' => 'semesters.create', - 'can' => 'create semester', + 'can' => 'create semester', ], ], ], [ - 'type' => 'menu-item', - 'text' => 'Subjects', - 'icon' => 'fas fa-lightbulb', - 'can' => 'menu-subject', + 'type' => 'menu-item', + 'text' => 'Subjects', + 'icon' => 'fas fa-lightbulb', + 'can' => 'menu-subject', 'submenu' => [ [ - 'type' => 'menu-item', - 'text' => 'View subjects', + 'type' => 'menu-item', + 'text' => 'View subjects', 'route' => 'subjects.index', - 'can' => 'read subject', + 'can' => 'read subject', ], [ - 'type' => 'menu-item', - 'text' => 'Create subject', + 'type' => 'menu-item', + 'text' => 'Create subject', 'route' => 'subjects.create', - 'can' => 'create subject', + 'can' => 'create subject', ], [ - 'type' => 'menu-item', - 'text' => 'Assign teacher to subjects', + 'type' => 'menu-item', + 'text' => 'Assign teacher to subjects', 'route' => 'subjects.assign-teacher', - 'can' => 'update subject', + 'can' => 'update subject', ], ], ], ['header' => 'Academics', 'can' => 'header-academics'], [ - 'type' => 'menu-item', - 'text' => 'Notices', - 'icon' => 'fas fa-bell', - 'can' => 'menu-notice', + 'type' => 'menu-item', + 'text' => 'Notices', + 'icon' => 'fas fa-bell', + 'can' => 'menu-notice', 'submenu' => [ [ - 'type' => 'menu-item', - 'text' => 'View notices', + 'type' => 'menu-item', + 'text' => 'View notices', 'route' => 'notices.index', - 'can' => 'read notice', + 'can' => 'read notice', ], [ - 'type' => 'menu-item', - 'text' => 'Create notice', + 'type' => 'menu-item', + 'text' => 'Create notice', 'route' => 'notices.create', - 'can' => 'create notice', + 'can' => 'create notice', ], ], ], [ - 'type' => 'menu-item', - 'text' => 'Syllabi', - 'icon' => 'fas fa-list-alt', - 'can' => 'menu-syllabus', + 'type' => 'menu-item', + 'text' => 'Syllabi', + 'icon' => 'fas fa-list-alt', + 'can' => 'menu-syllabus', 'submenu' => [ [ - 'type' => 'menu-item', - 'text' => 'View Syllabi', + 'type' => 'menu-item', + 'text' => 'View Syllabi', 'route' => 'syllabi.index', - 'can' => 'read syllabus', + 'can' => 'read syllabus', ], [ - 'type' => 'menu-item', - 'text' => 'Create Syllabus', + 'type' => 'menu-item', + 'text' => 'Create Syllabus', 'route' => 'syllabi.create', - 'can' => 'create syllabus', + 'can' => 'create syllabus', ], ], ], [ - 'type' => 'menu-item', - 'text' => 'Timetables', - 'icon' => 'fas fa-tasks', - 'can' => 'menu-timetable', + 'type' => 'menu-item', + 'text' => 'Timetables', + 'icon' => 'fas fa-tasks', + 'can' => 'menu-timetable', 'submenu' => [ [ - 'type' => 'menu-item', - 'text' => 'View Timetables', + 'type' => 'menu-item', + 'text' => 'View Timetables', 'route' => 'timetables.index', - 'can' => 'read timetable', + 'can' => 'read timetable', ], [ - 'type' => 'menu-item', - 'text' => 'Create Timetable', + 'type' => 'menu-item', + 'text' => 'Create Timetable', 'route' => 'timetables.create', - 'can' => 'create timetable', + 'can' => 'create timetable', ], [ - 'type' => 'menu-item', - 'text' => 'View custom items', + 'type' => 'menu-item', + 'text' => 'View custom items', 'route' => 'custom-timetable-items.index', - 'can' => 'read custom timetable items', + 'can' => 'read custom timetable items', ], [ - 'type' => 'menu-item', - 'text' => 'Create Custom Items', + 'type' => 'menu-item', + 'text' => 'Create Custom Items', 'route' => 'custom-timetable-items.create', - 'can' => 'create custom timetable items', + 'can' => 'create custom timetable items', ], ], ], [ - 'type' => 'menu-item', - 'text' => 'Exams', - 'icon' => 'fas fa-book-open', - 'can' => 'menu-exam', + 'type' => 'menu-item', + 'text' => 'Exams', + 'icon' => 'fas fa-book-open', + 'can' => 'menu-exam', 'submenu' => [ [ - 'type' => 'menu-item', - 'text' => 'View Exams', + 'type' => 'menu-item', + 'text' => 'View Exams', 'route' => 'exams.index', - 'can' => 'read exam', + 'can' => 'read exam', ], [ - 'type' => 'menu-item', - 'text' => 'Create Exam', + 'type' => 'menu-item', + 'text' => 'Create Exam', 'route' => 'exams.create', - 'can' => 'create exam', + 'can' => 'create exam', ], [ - 'type' => 'menu-item', - 'text' => 'Manage Exam records', + 'type' => 'menu-item', + 'text' => 'Manage Exam records', 'route' => 'exam-records.index', - 'can' => 'update exam record', + 'can' => 'update exam record', ], [ - 'type' => 'menu-item', - 'text' => 'Exam tabulation sheet', + 'type' => 'menu-item', + 'text' => 'Exam tabulation sheet', 'route' => 'exams.tabulation', - 'can' => 'read exam', + 'can' => 'read exam', ], [ - 'type' => 'menu-item', - 'text' => 'Semester Result Sheet', + 'type' => 'menu-item', + 'text' => 'Semester Result Sheet', 'route' => 'exams.semester-result-tabulation', - 'can' => 'read exam', + 'can' => 'read exam', ], [ - 'type' => 'menu-item', - 'text' => 'Academic Year Result Sheet', + 'type' => 'menu-item', + 'text' => 'Academic Year Result Sheet', 'route' => 'exams.academic-year-result-tabulation', - 'can' => 'read exam', + 'can' => 'read exam', ], [ - 'type' => 'menu-item', - 'text' => 'Result Checker', + 'type' => 'menu-item', + 'text' => 'Result Checker', 'route' => 'exams.result-checker', - 'can' => 'check result', + 'can' => 'check result', ], ], ], [ - 'type' => 'menu-item', - 'text' => 'Grade systems', - 'icon' => 'fa fa-graduation-cap', - 'can' => 'menu-grade-system', + 'type' => 'menu-item', + 'text' => 'Grade systems', + 'icon' => 'fa fa-graduation-cap', + 'can' => 'menu-grade-system', 'submenu' => [ [ - 'type' => 'menu-item', - 'text' => 'View Grades', + 'type' => 'menu-item', + 'text' => 'View Grades', 'route' => 'grade-systems.index', - 'can' => 'read grade system', + 'can' => 'read grade system', ], [ - 'type' => 'menu-item', - 'text' => 'Create Grades', + 'type' => 'menu-item', + 'text' => 'Create Grades', 'route' => 'grade-systems.create', - 'can' => 'create grade system', + 'can' => 'create grade system', ], ], ], [ - 'type' => 'menu-item', - 'text' => 'View Logs', + 'type' => 'menu-item', + 'text' => 'View Logs', 'route' => 'blv.index', - 'icon' => 'fa fa-sticky-note', + 'icon' => 'fa fa-sticky-note', //it checks with roles for now so this is to prevent other users from viewing menu item 'can' => 'view logs', ], diff --git a/app/Http/Livewire/ListExamRecordsTable.php b/app/Http/Livewire/ListExamRecordsTable.php index 53c7830d..19f6df03 100644 --- a/app/Http/Livewire/ListExamRecordsTable.php +++ b/app/Http/Livewire/ListExamRecordsTable.php @@ -68,7 +68,7 @@ public function mount(ExamService $examService, MyClassService $myClassService, $this->exams->count() ? $this->exam = $this->exams[0]->id : $this->exam = null; $this->classes = $myClassService->getAllClasses(); //sets subjects etc if class isn't empty - if (! $this->classes->isEmpty()) { + if (!$this->classes->isEmpty()) { $this->subjects = $this->classes[0]->subjects; if ($this->subjects->isNotEmpty()) { $this->subject = $this->subjects[0]->id; diff --git a/app/Http/Livewire/ListPromotionsTable.php b/app/Http/Livewire/ListPromotionsTable.php index 8abf71e6..4bdc0264 100644 --- a/app/Http/Livewire/ListPromotionsTable.php +++ b/app/Http/Livewire/ListPromotionsTable.php @@ -11,7 +11,7 @@ class ListPromotionsTable extends Component public function mount(AcademicYearService $academicYearService) { - if (! $this->academicYear) { + if (!$this->academicYear) { $this->academicYear = auth()->user()->school->load('academicYear')->academicYear->first(); } else { $this->academicYear = $academicYearService->getAcademicYearById($this->academicYear); diff --git a/app/Http/Livewire/NationalityAndStateInputFields.php b/app/Http/Livewire/NationalityAndStateInputFields.php index 3599efe5..5412b348 100644 --- a/app/Http/Livewire/NationalityAndStateInputFields.php +++ b/app/Http/Livewire/NationalityAndStateInputFields.php @@ -17,7 +17,7 @@ class NationalityAndStateInputFields extends Component protected $rules = [ 'nationality' => 'string', - 'state' => 'string', + 'state' => 'string', ]; public function mount() @@ -25,7 +25,7 @@ public function mount() $this->nationalities = World::countries()->data->pluck('name'); //set nationality to null if not found - if ($this->nationality != null && ! in_array($this->nationality, $this->nationalities->toArray())) { + if ($this->nationality != null && !in_array($this->nationality, $this->nationalities->toArray())) { $this->nationality = null; } } @@ -34,7 +34,7 @@ public function updatedNationality() { // $this->states = collect(World::where('name.common' , $this->nationality)->first()->hydrateStates()->states->pluck('name')); $this->states = collect(World::countries([ - 'fields' => 'states', + 'fields' => 'states', 'filters' => [ 'name' => $this->nationality, ], @@ -54,7 +54,7 @@ public function loadInitialStates() $this->nationality = $this->nationalities->first(); } $this->states = collect(World::countries([ - 'fields' => 'states', + 'fields' => 'states', 'filters' => [ 'name' => $this->nationality, ], diff --git a/app/Http/Livewire/PromoteStudents.php b/app/Http/Livewire/PromoteStudents.php index d71f0642..839d6405 100644 --- a/app/Http/Livewire/PromoteStudents.php +++ b/app/Http/Livewire/PromoteStudents.php @@ -26,9 +26,9 @@ class PromoteStudents extends Component public $students; protected $rules = [ - 'oldClass' => 'required|exists:my_classes,id', + 'oldClass' => 'required|exists:my_classes,id', 'oldSection' => 'required|exists:sections,id', - 'newClass' => 'required|exists:my_classes,id', + 'newClass' => 'required|exists:my_classes,id', 'newSection' => 'required|exists:sections,id', ]; diff --git a/app/Http/Livewire/ResultChecker.php b/app/Http/Livewire/ResultChecker.php index 87a885e3..0ffbf1c8 100644 --- a/app/Http/Livewire/ResultChecker.php +++ b/app/Http/Livewire/ResultChecker.php @@ -45,7 +45,7 @@ class ResultChecker extends Component //rules public $rules = [ 'academicYear' => 'integer|exists:academic_years,id', - 'semester' => 'required', + 'semester' => 'required', ]; public function mount(MyClassService $myClassService) @@ -122,7 +122,7 @@ public function checkResult(AcademicYear $academicYear, $semester, User $student $semester = Semester::find($semester); // make sure user student isn't another role - if (! $student->hasRole('student')) { + if (!$student->hasRole('student')) { abort(404, 'Student not found.'); } //set name that would be used in view diff --git a/app/Http/Livewire/SemesterResultTabulation.php b/app/Http/Livewire/SemesterResultTabulation.php index 33e81d84..c8d579fd 100644 --- a/app/Http/Livewire/SemesterResultTabulation.php +++ b/app/Http/Livewire/SemesterResultTabulation.php @@ -39,7 +39,7 @@ public function mount(SectionService $sectionService, MyClassService $myClassSer $this->classes = $myClassService->getAllClasses(); //sets subjects etc if class isn't empty - if (! $this->classes->isEmpty()) { + if (!$this->classes->isEmpty()) { $this->class = $this->classes[0]->id; $this->sections = $this->classes[0]->sections; $this->section = $this->sections[0]->id; diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 704089a7..2306b821 100755 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -9,12 +9,13 @@ 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) { - if (! $request->expectsJson()) { + if (!$request->expectsJson()) { return route('login'); } } diff --git a/app/Http/Middleware/EnsureAcademicYearIsSet.php b/app/Http/Middleware/EnsureAcademicYearIsSet.php index a2c281da..f1afdfb2 100755 --- a/app/Http/Middleware/EnsureAcademicYearIsSet.php +++ b/app/Http/Middleware/EnsureAcademicYearIsSet.php @@ -11,11 +11,12 @@ class EnsureAcademicYearIsSet * Handle an incoming request. * * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next + * * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse */ public function handle(Request $request, Closure $next) { - if (! $request->user()->school->academicYear) { + if (!$request->user()->school->academicYear) { return redirect()->route('academic-years.index'); } diff --git a/app/Http/Middleware/EnsureDefaultPasswordIsChanged.php b/app/Http/Middleware/EnsureDefaultPasswordIsChanged.php index 6407d017..8ca4fddc 100755 --- a/app/Http/Middleware/EnsureDefaultPasswordIsChanged.php +++ b/app/Http/Middleware/EnsureDefaultPasswordIsChanged.php @@ -12,6 +12,7 @@ class EnsureDefaultPasswordIsChanged * Handle an incoming request. * * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next + * * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse */ public function handle(Request $request, Closure $next) diff --git a/app/Http/Middleware/EnsureSemesterIsSet.php b/app/Http/Middleware/EnsureSemesterIsSet.php index f3717537..546d9e59 100755 --- a/app/Http/Middleware/EnsureSemesterIsSet.php +++ b/app/Http/Middleware/EnsureSemesterIsSet.php @@ -11,6 +11,7 @@ class EnsureSemesterIsSet * Handle an incoming request. * * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next + * * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse */ public function handle(Request $request, Closure $next) diff --git a/app/Http/Middleware/EnsureSuperAdminHasSchoolId.php b/app/Http/Middleware/EnsureSuperAdminHasSchoolId.php index a85bcfd6..530158d0 100755 --- a/app/Http/Middleware/EnsureSuperAdminHasSchoolId.php +++ b/app/Http/Middleware/EnsureSuperAdminHasSchoolId.php @@ -11,6 +11,7 @@ class EnsureSuperAdminHasSchoolId * Handle an incoming request. * * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next + * * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse */ public function handle(Request $request, Closure $next) diff --git a/app/Http/Middleware/PreventGraduatedStudent.php b/app/Http/Middleware/PreventGraduatedStudent.php index 2aaae3b1..6c7db725 100644 --- a/app/Http/Middleware/PreventGraduatedStudent.php +++ b/app/Http/Middleware/PreventGraduatedStudent.php @@ -11,11 +11,12 @@ class PreventGraduatedStudent * Handle an incoming request. * * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next + * * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse */ public function handle(Request $request, Closure $next) { - if (! auth()->user()->hasRole('student')) { + if (!auth()->user()->hasRole('student')) { return $next($request); } if (auth()->user()->studentRecord()->withoutGlobalScopes()->first()->is_graduated == true) { diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index fe886b08..77601d6c 100755 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -12,7 +12,8 @@ class RedirectIfAuthenticated /** * Handle an incoming request. * - * @param string|null ...$guards + * @param string|null ...$guards + * * @return mixed */ public function handle(Request $request, Closure $next, ...$guards) diff --git a/app/Http/Requests/AcademicYearStoreRequest.php b/app/Http/Requests/AcademicYearStoreRequest.php index fc1510a1..ff128b91 100755 --- a/app/Http/Requests/AcademicYearStoreRequest.php +++ b/app/Http/Requests/AcademicYearStoreRequest.php @@ -15,7 +15,7 @@ public function rules() { return [ 'start_year' => 'required|digits:4|integer|min:1900', - 'stop_year' => 'required|digits:4|integer|min:1900|gt:start_year', + 'stop_year' => 'required|digits:4|integer|min:1900|gt:start_year', ]; } } diff --git a/app/Http/Requests/AccountApplicationStatusChangeRequest.php b/app/Http/Requests/AccountApplicationStatusChangeRequest.php index 454d8663..b6969ce4 100644 --- a/app/Http/Requests/AccountApplicationStatusChangeRequest.php +++ b/app/Http/Requests/AccountApplicationStatusChangeRequest.php @@ -22,9 +22,9 @@ public function rules() $applicantIsStudent = true; $studentStoreRequestValidationArray = [ 'admission_number' => 'nullable|unique:student_records,admission_number', - 'admission_date' => 'required|date', - 'my_class_id' => 'required|exists:my_classes,id', - 'section_id' => 'required|exists:sections,id', + 'admission_date' => 'required|date', + 'my_class_id' => 'required|exists:my_classes,id', + 'section_id' => 'required|exists:sections,id', ]; } else { $applicantIsStudent = false; diff --git a/app/Http/Requests/AssignStudentRequest.php b/app/Http/Requests/AssignStudentRequest.php index 96026068..d0edd7e5 100755 --- a/app/Http/Requests/AssignStudentRequest.php +++ b/app/Http/Requests/AssignStudentRequest.php @@ -15,7 +15,7 @@ public function rules() { return [ 'student_id' => 'required|integer|exists:users,id', - 'assign' => 'nullable|boolean', + 'assign' => 'nullable|boolean', ]; } } diff --git a/app/Http/Requests/AssignTeacherToSubjectRequest.php b/app/Http/Requests/AssignTeacherToSubjectRequest.php index ce2f2904..79b48e7a 100644 --- a/app/Http/Requests/AssignTeacherToSubjectRequest.php +++ b/app/Http/Requests/AssignTeacherToSubjectRequest.php @@ -14,7 +14,7 @@ class AssignTeacherToSubjectRequest extends FormRequest public function rules() { return [ - 'subjects' => 'required', + 'subjects' => 'required', 'subjects.*' => 'nullable|exists:subjects,id', ]; } diff --git a/app/Http/Requests/SchoolStoreRequest.php b/app/Http/Requests/SchoolStoreRequest.php index 61c6146b..4f9ab58c 100755 --- a/app/Http/Requests/SchoolStoreRequest.php +++ b/app/Http/Requests/SchoolStoreRequest.php @@ -14,7 +14,7 @@ class SchoolStoreRequest extends FormRequest public function rules() { return [ - 'name' => 'required|max:255', + 'name' => 'required|max:255', 'address' => 'required|min:8|max:1000', ]; } diff --git a/app/Http/Requests/SchoolUpdateRequest.php b/app/Http/Requests/SchoolUpdateRequest.php index 85c0e739..e2c2c4ec 100755 --- a/app/Http/Requests/SchoolUpdateRequest.php +++ b/app/Http/Requests/SchoolUpdateRequest.php @@ -20,9 +20,9 @@ class SchoolUpdateRequest extends FormRequest public function rules() { return [ - 'name' => 'required|max:255', + 'name' => 'required|max:255', 'address' => 'required|min:8|max:1000', - 'phone' => 'nullable|regex:/^([0-9\s\-\+\(\)]*)$/|min:5', + 'phone' => 'nullable|regex:/^([0-9\s\-\+\(\)]*)$/|min:5', ]; } } diff --git a/app/Http/Requests/StoreExamRecordRequest.php b/app/Http/Requests/StoreExamRecordRequest.php index 2d3d2c5f..0795e3ab 100755 --- a/app/Http/Requests/StoreExamRecordRequest.php +++ b/app/Http/Requests/StoreExamRecordRequest.php @@ -21,12 +21,12 @@ public function rules() { //max validation for marks is handled in service class as there is no clean way of doing this return [ - 'section_id' => 'required|integer|exists:sections,id', - 'subject_id' => 'required|integer|exists:subjects,id', - 'user_id' => 'required|integer|exists:users,id', + 'section_id' => 'required|integer|exists:sections,id', + 'subject_id' => 'required|integer|exists:subjects,id', + 'user_id' => 'required|integer|exists:users,id', 'exam_records' => 'array', //validates to check if each exam record has a student_marks and exam_slot_id - 'exam_records.*.exam_slot_id' => 'required|integer|exists:exam_slots,id', + 'exam_records.*.exam_slot_id' => 'required|integer|exists:exam_slots,id', 'exam_records.*.student_marks' => 'required|integer|min:0', ]; } diff --git a/app/Http/Requests/StoreExamRequest.php b/app/Http/Requests/StoreExamRequest.php index ce327c04..6abb8fb4 100755 --- a/app/Http/Requests/StoreExamRequest.php +++ b/app/Http/Requests/StoreExamRequest.php @@ -14,11 +14,11 @@ class StoreExamRequest extends FormRequest public function rules() { return [ - 'name' => 'required|string|max:255', + 'name' => 'required|string|max:255', 'description' => 'nullable|string|max:10000', 'semester_id' => 'required|integer|exists:semesters,id', - 'start_date' => 'required|date', - 'stop_date' => 'required|date|after_or_equal:start_date', + 'start_date' => 'required|date', + 'stop_date' => 'required|date|after_or_equal:start_date', ]; } } diff --git a/app/Http/Requests/StoreExamSlotRequest.php b/app/Http/Requests/StoreExamSlotRequest.php index 1fdaf942..05cab89c 100755 --- a/app/Http/Requests/StoreExamSlotRequest.php +++ b/app/Http/Requests/StoreExamSlotRequest.php @@ -14,7 +14,7 @@ class StoreExamSlotRequest extends FormRequest public function rules() { return [ - 'name' => 'required|string|max:255', + 'name' => 'required|string|max:255', 'description' => 'nullable|string|max:10000', 'total_marks' => 'required|integer|min:1', ]; diff --git a/app/Http/Requests/StoreGradeSystemRequest.php b/app/Http/Requests/StoreGradeSystemRequest.php index 137e1896..fbcffe7b 100755 --- a/app/Http/Requests/StoreGradeSystemRequest.php +++ b/app/Http/Requests/StoreGradeSystemRequest.php @@ -14,10 +14,10 @@ class StoreGradeSystemRequest extends FormRequest public function rules() { return [ - 'grade_from' => 'required|numeric|gte:0|max:100', - 'grade_till' => 'required|numeric|gt:grade_from|max:100', - 'name' => 'required|string', - 'remark' => 'nullable|string', + 'grade_from' => 'required|numeric|gte:0|max:100', + 'grade_till' => 'required|numeric|gt:grade_from|max:100', + 'name' => 'required|string', + 'remark' => 'nullable|string', 'class_group_id' => 'required|integer|exists:class_groups,id', ]; } diff --git a/app/Http/Requests/StoreNoticeRequest.php b/app/Http/Requests/StoreNoticeRequest.php index 3fa069e3..e7e04ac0 100755 --- a/app/Http/Requests/StoreNoticeRequest.php +++ b/app/Http/Requests/StoreNoticeRequest.php @@ -20,11 +20,11 @@ class StoreNoticeRequest extends FormRequest public function rules() { return [ - 'title' => 'required|string|max:255', - 'content' => 'required|string', + 'title' => 'required|string|max:255', + 'content' => 'required|string', 'attachment' => 'nullable|file|mimes:jpeg,png,jpg,gif,svg,pdf,doc,docx|max:10000', 'start_date' => 'date', - 'stop_date' => 'date|after:start_date', + 'stop_date' => 'date|after:start_date', ]; } } diff --git a/app/Http/Requests/StoreSyllabusRequest.php b/app/Http/Requests/StoreSyllabusRequest.php index 3cd06b7a..da5c6af2 100755 --- a/app/Http/Requests/StoreSyllabusRequest.php +++ b/app/Http/Requests/StoreSyllabusRequest.php @@ -20,10 +20,10 @@ class StoreSyllabusRequest extends FormRequest public function rules() { return [ - 'name' => 'required|string|max:255', + 'name' => 'required|string|max:255', 'description' => 'nullable|string|max:255', - 'file' => 'required|file|mimes:pdf|max:10000', - 'subject_id' => 'required|integer|exists:subjects,id', + 'file' => 'required|file|mimes:pdf|max:10000', + 'subject_id' => 'required|integer|exists:subjects,id', ]; } } diff --git a/app/Http/Requests/StoreTimetableTimeSlotRequest.php b/app/Http/Requests/StoreTimetableTimeSlotRequest.php index e8a31e45..a185547b 100755 --- a/app/Http/Requests/StoreTimetableTimeSlotRequest.php +++ b/app/Http/Requests/StoreTimetableTimeSlotRequest.php @@ -27,7 +27,7 @@ public function rules() Rule::exists('timetables', 'id')->whereIn('my_class_id', auth()->user()->school->myClasses()->pluck('my_classes.id')), ], 'start_time' => 'required|date_format:H:i', - 'stop_time' => 'required|date_format:H:i|after:start_time', + 'stop_time' => 'required|date_format:H:i|after:start_time', ]; } } diff --git a/app/Http/Requests/StudentPromoteRequest.php b/app/Http/Requests/StudentPromoteRequest.php index 0c31cb76..32ad55ba 100755 --- a/app/Http/Requests/StudentPromoteRequest.php +++ b/app/Http/Requests/StudentPromoteRequest.php @@ -20,11 +20,11 @@ class StudentPromoteRequest extends FormRequest public function rules() { return [ - 'old_class_id' => 'required|exists:my_classes,id', - 'new_class_id' => 'required|exists:my_classes,id', + 'old_class_id' => 'required|exists:my_classes,id', + 'new_class_id' => 'required|exists:my_classes,id', 'old_section_id' => 'required|exists:sections,id', 'new_section_id' => 'required|exists:sections,id', - 'student_id.*' => 'nullable|exists:users,id', + 'student_id.*' => 'nullable|exists:users,id', ]; } } diff --git a/app/Http/Requests/StudentStoreRequest.php b/app/Http/Requests/StudentStoreRequest.php index 2ac205f4..32602e6d 100755 --- a/app/Http/Requests/StudentStoreRequest.php +++ b/app/Http/Requests/StudentStoreRequest.php @@ -15,9 +15,9 @@ public function rules() { return [ 'admission_number' => 'nullable|unique:student_records,admission_number', - 'admission_date' => 'required|date', - 'my_class_id' => 'required|exists:my_classes,id', - 'section_id' => 'required|exists:sections,id', + 'admission_date' => 'required|date', + 'my_class_id' => 'required|exists:my_classes,id', + 'section_id' => 'required|exists:sections,id', ]; } @@ -30,7 +30,7 @@ public function messages() { return [ 'my_class_id.required' => 'Select a class', - 'section_id.required' => 'Select a section', + 'section_id.required' => 'Select a section', ]; } @@ -43,7 +43,7 @@ public function attributes() { return [ 'my_class_id' => 'class selection', - 'section_id' => 'section selection', + 'section_id' => 'section selection', ]; } } diff --git a/app/Http/Requests/SubjectStoreRequest.php b/app/Http/Requests/SubjectStoreRequest.php index ca29faa6..83403d68 100755 --- a/app/Http/Requests/SubjectStoreRequest.php +++ b/app/Http/Requests/SubjectStoreRequest.php @@ -14,10 +14,10 @@ class SubjectStoreRequest extends FormRequest public function rules() { return [ - 'name' => 'required|max:255', - 'short_name' => 'required|max:255', + 'name' => 'required|max:255', + 'short_name' => 'required|max:255', 'my_class_id' => 'exists:my_classes,id', - 'teachers.*' => 'exists:users,id', + 'teachers.*' => 'exists:users,id', ]; } } diff --git a/app/Http/Requests/TimetableStoreRequest.php b/app/Http/Requests/TimetableStoreRequest.php index dcb951b1..a519ea75 100755 --- a/app/Http/Requests/TimetableStoreRequest.php +++ b/app/Http/Requests/TimetableStoreRequest.php @@ -20,7 +20,7 @@ class TimetableStoreRequest extends FormRequest public function rules() { return [ - 'name' => 'required|string|max:255', + 'name' => 'required|string|max:255', 'description' => 'nullable|string|max:10000', 'my_class_id' => 'required|integer|exists:my_classes,id', ]; diff --git a/app/Http/Requests/TimetableUpdateRequest.php b/app/Http/Requests/TimetableUpdateRequest.php index 8e1ae8d1..7a56a74b 100755 --- a/app/Http/Requests/TimetableUpdateRequest.php +++ b/app/Http/Requests/TimetableUpdateRequest.php @@ -20,7 +20,7 @@ class TimetableUpdateRequest extends FormRequest public function rules() { return [ - 'name' => 'required|string|max:255', + 'name' => 'required|string|max:255', 'description' => 'nullable|string|max:10000', ]; } diff --git a/app/Http/Requests/UpdateExamRequest.php b/app/Http/Requests/UpdateExamRequest.php index f924b354..565e3f0e 100755 --- a/app/Http/Requests/UpdateExamRequest.php +++ b/app/Http/Requests/UpdateExamRequest.php @@ -14,11 +14,11 @@ class UpdateExamRequest extends FormRequest public function rules() { return [ - 'name' => 'required|string|max:255', + 'name' => 'required|string|max:255', 'description' => 'nullable|string|max:10000', 'semester_id' => 'required|integer|exists:semesters,id', - 'start_date' => 'required|date', - 'stop_date' => 'required|date|after_or_equal:start_date', + 'start_date' => 'required|date', + 'stop_date' => 'required|date|after_or_equal:start_date', ]; } } diff --git a/app/Http/Requests/UpdateExamSlotRequest.php b/app/Http/Requests/UpdateExamSlotRequest.php index f33bb122..5a2d44bf 100755 --- a/app/Http/Requests/UpdateExamSlotRequest.php +++ b/app/Http/Requests/UpdateExamSlotRequest.php @@ -14,7 +14,7 @@ class UpdateExamSlotRequest extends FormRequest public function rules() { return [ - 'name' => 'required|string|max:255', + 'name' => 'required|string|max:255', 'description' => 'nullable|string|max:10000', 'total_marks' => 'required|integer|min:1', ]; diff --git a/app/Http/Requests/UpdateGradeSystemRequest.php b/app/Http/Requests/UpdateGradeSystemRequest.php index 8f93c61c..1ef4f1c2 100755 --- a/app/Http/Requests/UpdateGradeSystemRequest.php +++ b/app/Http/Requests/UpdateGradeSystemRequest.php @@ -14,10 +14,10 @@ class UpdateGradeSystemRequest extends FormRequest public function rules() { return [ - 'grade_from' => 'required|numeric|gte:0|max:100', - 'grade_till' => 'required|numeric|gt:grade_from|max:100', - 'name' => 'required|string|max:255', - 'remark' => 'nullable|string|max:255', + 'grade_from' => 'required|numeric|gte:0|max:100', + 'grade_till' => 'required|numeric|gt:grade_from|max:100', + 'name' => 'required|string|max:255', + 'remark' => 'nullable|string|max:255', 'class_group_id' => 'required|integer|exists:class_groups,id', ]; } diff --git a/app/Http/Requests/storeTimetableRecord.php b/app/Http/Requests/storeTimetableRecord.php index f3ceaca1..a31bb15c 100755 --- a/app/Http/Requests/storeTimetableRecord.php +++ b/app/Http/Requests/storeTimetableRecord.php @@ -20,7 +20,7 @@ class storeTimetableRecord extends FormRequest */ public function authorize() { - if (is_null($this->input('type')) || ! in_array($this->input('type'), ['subject', 'customTimetableItem'])) { + if (is_null($this->input('type')) || !in_array($this->input('type'), ['subject', 'customTimetableItem'])) { return false; } else { return true; diff --git a/app/Models/Exam.php b/app/Models/Exam.php index b424fdb0..a135553a 100755 --- a/app/Models/Exam.php +++ b/app/Models/Exam.php @@ -27,10 +27,10 @@ class Exam extends Model */ protected $casts = [ 'email_verified_at' => 'datetime', - 'start_date' => 'date:Y-m-d', - 'stop_date' => 'date:Y-m-d', - 'active' => 'boolean', - 'publish_result' => 'boolean', + 'start_date' => 'date:Y-m-d', + 'stop_date' => 'date:Y-m-d', + 'active' => 'boolean', + 'publish_result' => 'boolean', ]; public function semester() diff --git a/app/Models/User.php b/app/Models/User.php index 1eeaa3d9..0fd37be9 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -66,7 +66,7 @@ class User extends Authenticatable implements MustVerifyEmail */ protected $casts = [ 'email_verified_at' => 'datetime', - 'birthday' => 'datetime:Y-m-d', + 'birthday' => 'datetime:Y-m-d', ]; /** @@ -86,7 +86,8 @@ public function scopeStudents($query) /** * Active applicants. * - * @param Builder $query + * @param Builder $query + * * @return void */ public function scopeApplicants($query) @@ -99,7 +100,8 @@ public function scopeApplicants($query) /** * Active applicants. * - * @param Builder $query + * @param Builder $query + * * @return void */ public function scopeRejectedApplicants($query) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 6d69a4e4..899a5eb9 100755 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -18,9 +18,9 @@ public function register() { Schema::defaultStringLength(100); Relation::enforceMorphMap([ - 'subject' => "App\Models\Subject", - 'customTimetableItem' => "App\Models\CustomTimetableItem", - 'App\Models\User' => 'App\Models\User', + 'subject' => "App\Models\Subject", + 'customTimetableItem' => "App\Models\CustomTimetableItem", + 'App\Models\User' => 'App\Models\User', 'App\Models\AccountApplication' => 'App\Models\AccountApplication', ]); } diff --git a/app/Services/AcademicYear/AcademicYearService.php b/app/Services/AcademicYear/AcademicYearService.php index ef6f0625..b811502e 100755 --- a/app/Services/AcademicYear/AcademicYearService.php +++ b/app/Services/AcademicYear/AcademicYearService.php @@ -31,6 +31,7 @@ public function getAllAcademicYears() * Get academic year by Id. * *@param int $id + * * @return App\Models\AcademicYear */ public function getAcademicYearById($id) @@ -41,7 +42,8 @@ public function getAcademicYearById($id) /** * Create academic year. * - * @param array|Collection $records + * @param array|Collection $records + * * @return AcademicYear */ public function createAcademicYear($records) @@ -53,7 +55,8 @@ public function createAcademicYear($records) /** * Update Academic Year. * - * @param array|Collection $records + * @param array|Collection $records + * * @return void */ public function updateAcademicYear(AcademicYear $academicYear, $records) @@ -77,13 +80,14 @@ public function deleteAcademicYear(AcademicYear $academicYear) /** * Set academic year as current.one in school. * - * @param int $academicYearId - * @param int $schoolId + * @param int $academicYearId + * @param int $schoolId + * * @return void */ public function setAcademicYear($academicYearId, $schoolId = null) { - if (! isset($schoolId)) { + if (!isset($schoolId)) { $schoolId = auth()->user()->school_id; } $school = $this->schoolService->getSchoolById($schoolId); diff --git a/app/Services/AccountApplication/AccountApplicationService.php b/app/Services/AccountApplication/AccountApplicationService.php index a65ced42..9e42b89d 100755 --- a/app/Services/AccountApplication/AccountApplicationService.php +++ b/app/Services/AccountApplication/AccountApplicationService.php @@ -78,8 +78,9 @@ public function createAccountApplication(int $userId, int $roleId) /** * Update account application. * - * @param User $user - * @param object $record + * @param User $user + * @param object $record + * * @return void */ public function updateAccountApplication(User $applicant, object|array $record) diff --git a/app/Services/Admin/AdminService.php b/app/Services/Admin/AdminService.php index 754dc9ee..0b2efa11 100755 --- a/app/Services/Admin/AdminService.php +++ b/app/Services/Admin/AdminService.php @@ -30,7 +30,8 @@ public function getAllAdmins() /** * Create Admin. * - * @param array|Collection $records + * @param array|Collection $records + * * @return \App\Models\User * @return void */ @@ -43,7 +44,8 @@ public function createAdmin($records) /** * Update Admin. * - * @param array|Collection $records + * @param array|Collection $records + * * @return void */ public function updateAdmin(User $admin, $records) diff --git a/app/Services/Exam/ExamRecordService.php b/app/Services/Exam/ExamRecordService.php index f0c8ed5d..889e8aa7 100755 --- a/app/Services/Exam/ExamRecordService.php +++ b/app/Services/Exam/ExamRecordService.php @@ -65,8 +65,9 @@ public function getAllUserExamRecordInExamForSubject(Exam $exam, int $user, int /** * Get all exam records for a user in a subject and an específic semester. * - * @param int $user - * @param int $subject + * @param int $user + * @param int $subject + * * @return App\Models\ExamRecord */ public function getAllUserExamRecordInSemesterForSubject(Semester $semester, $user, $subject) @@ -89,7 +90,8 @@ public function getAllUserExamRecordInSemesterForSubject(Semester $semester, $us /** * Get all user exam records for user in an academic year. * - * @param Semester $semester + * @param Semester $semester + * * @return App\Models\ExamRecord */ public function getAllUserExamRecordInAcademicYear(AcademicYear $academicYear, int $user) @@ -143,7 +145,8 @@ public function getAllExamSlotsInExams($exams) /** * Create exam record. * - * @param array|object $records + * @param array|object $records + * * @return void */ public function createExamRecord($records) @@ -165,9 +168,9 @@ public function createExamRecord($records) // creates exam record or updates if records already exists ExamRecord::updateOrCreate( - ['user_id' => $records['user_id'], - 'section_id' => $records['section_id'], - 'subject_id' => $records['subject_id'], + ['user_id' => $records['user_id'], + 'section_id' => $records['section_id'], + 'subject_id' => $records['subject_id'], 'exam_slot_id' => $record['exam_slot_id'], ], [ diff --git a/app/Services/Exam/ExamService.php b/app/Services/Exam/ExamService.php index 92274251..081c3db8 100755 --- a/app/Services/Exam/ExamService.php +++ b/app/Services/Exam/ExamService.php @@ -61,24 +61,26 @@ public function getExamById(int $id) /** * Create exam in semester. * - * @param array|object $records + * @param array|object $records + * * @return void */ public function createExam($records) { $exam = Exam::create([ - 'name' => $records['name'], + 'name' => $records['name'], 'description' => $records['description'], 'semester_id' => $records['semester_id'], - 'start_date' => $records['start_date'], - 'stop_date' => $records['stop_date'], + 'start_date' => $records['start_date'], + 'stop_date' => $records['stop_date'], ]); } /** * Update an exam. * - * @param array|object $records + * @param array|object $records + * * @return void */ public function updateExam(Exam $exam, $records) @@ -145,7 +147,8 @@ public function totalMarksAttainableInExamForSubject(Exam $exam) /** * Calculate total marks attainable in each subject across all exams in a semester. * - * @param Exam $exam + * @param Exam $exam + * * @return int */ public function totalMarksAttainableInSemesterForSubject(Semester $semester) diff --git a/app/Services/Exam/ExamSlotService.php b/app/Services/Exam/ExamSlotService.php index db2ee533..8ebc6f8a 100755 --- a/app/Services/Exam/ExamSlotService.php +++ b/app/Services/Exam/ExamSlotService.php @@ -22,7 +22,8 @@ public function getAllExamSlots(Exam $exam) /** * Get an exam slot by id. * - * @param int $id + * @param int $id + * * @return App\Models\ExamSlot */ public function getExamSlotById($id) @@ -39,11 +40,11 @@ public function getExamSlotById($id) public function createExamSlot(Exam $exam, array $data) { DB::transaction(function () use ($data, $exam) { - if (! isset($data['description'])) { + if (!isset($data['description'])) { $data['description'] = null; } $exam->examSlots()->create([ - 'name' => $data['name'], + 'name' => $data['name'], 'description' => $data['description'], 'total_marks' => $data['total_marks'], ]); @@ -59,11 +60,11 @@ public function createExamSlot(Exam $exam, array $data) public function updateExamSlot(ExamSlot $examSlot, array $data) { DB::transaction(function () use ($data, $examSlot) { - if (! isset($data['description'])) { + if (!isset($data['description'])) { $data['description'] = null; } $examSlot->update([ - 'name' => $data['name'], + 'name' => $data['name'], 'description' => $data['description'], 'total_marks' => $data['total_marks'], ]); diff --git a/app/Services/GradeSystem/GradeSystemService.php b/app/Services/GradeSystem/GradeSystemService.php index 2d819b95..7a69f653 100755 --- a/app/Services/GradeSystem/GradeSystemService.php +++ b/app/Services/GradeSystem/GradeSystemService.php @@ -34,10 +34,11 @@ public function getGrade(int $classGroup, int $percentage) /** * Create grade in gradesystem. * - * @param array|object $records - * @return void + * @param array|object $records * * @throws DuplicateRangeException + * + * @return void */ public function createGradeSystem($records) { @@ -50,20 +51,21 @@ public function createGradeSystem($records) GradeSystem::create([ 'class_group_id' => $records['class_group_id'], - 'grade_from' => $records['grade_from'], - 'grade_till' => $records['grade_till'], - 'name' => $records['name'], - 'remark' => $records['remark'], + 'grade_from' => $records['grade_from'], + 'grade_till' => $records['grade_till'], + 'name' => $records['name'], + 'remark' => $records['remark'], ]); } /** * Update grade in gradesystem. * - * @param array|object $records - * @return void + * @param array|object $records * * @throws DuplicateRangeException + * + * @return void */ public function updateGradeSystem(GradeSystem $grade, $records) { @@ -75,10 +77,10 @@ public function updateGradeSystem(GradeSystem $grade, $records) $grade->update([ 'class_group_id' => $records['class_group_id'], - 'grade_from' => $records['grade_from'], - 'grade_till' => $records['grade_till'], - 'name' => $records['name'], - 'remark' => $records['remark'], + 'grade_from' => $records['grade_from'], + 'grade_till' => $records['grade_till'], + 'name' => $records['name'], + 'remark' => $records['remark'], ]); $grade->save(); } @@ -95,8 +97,9 @@ public function deleteGradeSystem(GradeSystem $grade) } /** - * @param array $grade with grade_from and grade_till - * @param array $grades each with grade_from and grade_till (testing against) + * @param array $grade with grade_from and grade_till + * @param array $grades each with grade_from and grade_till (testing against) + * * @return bool */ public function gradeRangeExists($grade, $grades) diff --git a/app/Services/MyClass/MyClassService.php b/app/Services/MyClass/MyClassService.php index 4a98b84c..d4d4c677 100755 --- a/app/Services/MyClass/MyClassService.php +++ b/app/Services/MyClass/MyClassService.php @@ -76,7 +76,8 @@ public function getClassGroupById(int $id) /** * Create new class. * - * @param array|object $record + * @param array|object $record + * * @return App\Models\MyClass */ public function createClass($record) @@ -89,7 +90,8 @@ public function createClass($record) /** * Create new class group. * - * @param array|object $record + * @param array|object $record + * * @return App\Models\ClassGroup */ public function createClassGroup($record) @@ -102,14 +104,15 @@ public function createClassGroup($record) /** * Update class. * - * @param App\Models\MyClass $class - * @param array|object $records + * @param App\Models\MyClass $class + * @param array|object $records + * * @return App\Models\MyClass */ public function updateClass($class, $records) { $class->update([ - 'name' => $records['name'], + 'name' => $records['name'], 'class_group_id' => $records['class_group_id'], ]); @@ -119,8 +122,9 @@ public function updateClass($class, $records) /** * Update class group. * - * @param App\Models\ClassGroup $classGroup - * @param array|object $records + * @param App\Models\ClassGroup $classGroup + * @param array|object $records + * * @return App\Models\ClassGroup */ public function updateClassGroup(ClassGroup $classGroup, $records) @@ -137,10 +141,11 @@ public function updateClassGroup(ClassGroup $classGroup, $records) /** * Delete class group. * - * @param App\Models\ClassGroup $classGroup - * @return void + * @param App\Models\ClassGroup $classGroup * * @throws ResourceNotEmptyException + * + * @return void */ public function deleteClassGroup(ClassGroup $classGroup) { @@ -153,10 +158,11 @@ public function deleteClassGroup(ClassGroup $classGroup) /** * Delete class. * - * @param App\Models\MyClass $class - * @return void + * @param App\Models\MyClass $class * * @throws ResourceNotEmptyException + * + * @return void */ public function deleteClass(MyClass $class) { diff --git a/app/Services/Notice/NoticeService.php b/app/Services/Notice/NoticeService.php index 541316c0..e1a1ab7b 100755 --- a/app/Services/Notice/NoticeService.php +++ b/app/Services/Notice/NoticeService.php @@ -51,12 +51,12 @@ public function storeNotice(array $data) DB::beginTransaction(); Notice::create([ - 'title' => $data['title'], - 'content' => $data['content'], + 'title' => $data['title'], + 'content' => $data['content'], 'start_date' => $data['start_date'], - 'stop_date' => $data['stop_date'], + 'stop_date' => $data['stop_date'], 'attachment' => $data['attachment'], - 'school_id' => auth()->user()->school_id, + 'school_id' => auth()->user()->school_id, ]); DB::commit(); @@ -65,7 +65,8 @@ public function storeNotice(array $data) /** * Delete notice. * - * @param App\Models\Notice $notice + * @param App\Models\Notice $notice + * * @return void */ public function deleteNotice(Notice $notice) diff --git a/app/Services/Parent/ParentService.php b/app/Services/Parent/ParentService.php index 8efe128d..416b636c 100755 --- a/app/Services/Parent/ParentService.php +++ b/app/Services/Parent/ParentService.php @@ -33,7 +33,8 @@ public function getAllParents() /** * Create a new parent. * - * @param collection $record + * @param collection $record + * * @return User */ public function createParent($record) @@ -52,7 +53,8 @@ public function createParent($record) /** * Update a parent. * - * @param array|object|collection $records + * @param array|object|collection $records + * * @return User */ public function updateParent(User $parent, $records) @@ -87,15 +89,16 @@ public function printProfile(string $name, string $view, array $data) /** * Add student as child of parent or remove student from parent. * - * @param App\Models\Users $parent - * @return void + * @param App\Models\Users $parent * * @throws InvalidUserException + * + * @return void */ public function assignStudentToParent(User $parent, int $student, bool $assign = true) { $student = $this->user->getUserById($student); - if (! $this->user->verifyRole($student->id, 'student')) { + if (!$this->user->verifyRole($student->id, 'student')) { throw new InvalidUserException('User is not a student', 1); return; diff --git a/app/Services/Print/PrintService.php b/app/Services/Print/PrintService.php index ef3172e4..eda9b262 100755 --- a/app/Services/Print/PrintService.php +++ b/app/Services/Print/PrintService.php @@ -19,8 +19,8 @@ public static function createPdfFromView(string $name, string $view, array $data stream_context_create([ 'ssl' => [ 'allow_self_signed' => true, - 'verify_peer' => false, - 'verify_peer_name' => false, + 'verify_peer' => false, + 'verify_peer_name' => false, ], ]) ); diff --git a/app/Services/School/SchoolService.php b/app/Services/School/SchoolService.php index 764c7491..f1cf08b8 100755 --- a/app/Services/School/SchoolService.php +++ b/app/Services/School/SchoolService.php @@ -35,7 +35,8 @@ public function getAllSchools() /** * Get a school by id. * - * @param int $id + * @param int $id + * * @return \App\Models\School */ public function getSchoolById($id) @@ -46,7 +47,8 @@ public function getSchoolById($id) /** * Create school. * - * @param array $record + * @param array $record + * * @return App\Models\School */ public function createSchool($record) @@ -76,7 +78,8 @@ public function updateSchool(School $school, $records) /** * Set authenticated user's school. * - * @param int $id + * @param int $id + * * @return void */ public function setSchool(School $school) diff --git a/app/Services/Section/SectionService.php b/app/Services/Section/SectionService.php index ddcb0195..1c1fef7f 100755 --- a/app/Services/Section/SectionService.php +++ b/app/Services/Section/SectionService.php @@ -48,7 +48,8 @@ public function getSectionById(int $id) /** * Create section. * - * @param mixed $records + * @param mixed $records + * * @return void */ public function createSection($records) @@ -61,7 +62,8 @@ public function createSection($records) /** * Update section. * - * @param mixed $record + * @param mixed $record + * * @return void */ public function updateSection(Section $section, $record) diff --git a/app/Services/Semester/SemesterService.php b/app/Services/Semester/SemesterService.php index b380ef7f..6087aac3 100755 --- a/app/Services/Semester/SemesterService.php +++ b/app/Services/Semester/SemesterService.php @@ -42,7 +42,8 @@ public function getSemesterById(int $id) /** * Create a new semester. * - * @param mixed $data + * @param mixed $data + * * @return Semester */ public function createSemester($data) @@ -50,8 +51,8 @@ public function createSemester($data) $data['academic_year_id'] = auth()->user()->school->academicYear->id; $data['school_id'] = auth()->user()->school->id; $semester = Semester::create([ - 'name' => $data['name'], - 'school_id' => $data['school_id'], + 'name' => $data['name'], + 'school_id' => $data['school_id'], 'academic_year_id' => $data['academic_year_id'], ]); @@ -62,9 +63,9 @@ public function createSemester($data) * Set current semester. * * - * @return void - * * @throws InvalidValueException + * + * @return void */ public function setSemester(Semester $semester) { @@ -79,7 +80,8 @@ public function setSemester(Semester $semester) /** * Semester service. * - * @param mixed $data + * @param mixed $data + * * @return void */ public function updateSemester(Semester $semester, $data) diff --git a/app/Services/Student/StudentService.php b/app/Services/Student/StudentService.php index 03ff6554..8a385d5e 100755 --- a/app/Services/Student/StudentService.php +++ b/app/Services/Student/StudentService.php @@ -81,7 +81,8 @@ public function getAllGraduatedStudents() /** * Get a student by id. * - * @param array|int $id student id + * @param array|int $id student id + * * @return \App\Models\User */ public function getStudentById($id) @@ -92,7 +93,8 @@ public function getStudentById($id) /** * Create student. * - * @param array $record Array of student record + * @param array $record Array of student record + * * @return void */ public function createStudent($record) @@ -108,17 +110,18 @@ public function createStudent($record) /** * Create record for student. * - * @param User $student $name - * @param array|object $record - * @return void + * @param User $student $name + * @param array|object $record * * @throws InvalidValueException + * + * @return void */ public function createStudentRecord(User $student, $record) { $record['admission_number'] || $record['admission_number'] = $this->generateAdmissionNumber(); $section = $this->sectionService->getSectionById($record['section_id']); - if (! $this->myClassService->getClassById($record['my_class_id'])->sections->contains($section)) { + if (!$this->myClassService->getClassById($record['my_class_id'])->sections->contains($section)) { throw new InvalidValueException('Section is not in class'); } @@ -129,17 +132,17 @@ public function createStudentRecord(User $student, $record) $student->studentRecord()->firstOrCreate([ 'user_id' => $student->id, ], [ - 'my_class_id' => $record['my_class_id'], - 'section_id' => $record['section_id'], + 'my_class_id' => $record['my_class_id'], + 'section_id' => $record['section_id'], 'admission_number' => $record['admission_number'], - 'admission_date' => $record['admission_date'], + 'admission_date' => $record['admission_date'], ]); //create record history $currentAcademicYear = $student->school->academicYear; $student->studentRecord->load('academicYears')->academicYears()->sync([$currentAcademicYear->id => [ 'my_class_id' => $record['my_class_id'], - 'section_id' => $record['section_id'], + 'section_id' => $record['section_id'], ]]); } @@ -201,7 +204,8 @@ public function printProfile(string $name, string $view, array $data) /** * Promote students. * - * @param array $records + * @param array $records + * * @return void */ public function promoteStudents($records) @@ -210,11 +214,11 @@ public function promoteStudents($records) $newClass = $this->myClassService->getClassById($records['new_class_id']); $academicYear = auth()->user()->school->academic_year_id; - if (! $oldClass->sections()->where('id', $records['old_section_id'])->exists()) { + if (!$oldClass->sections()->where('id', $records['old_section_id'])->exists()) { throw new InvalidValueException('Old section is not in old class'); } - if (! $newClass->sections()->where('id', $records['new_section_id'])->exists()) { + if (!$newClass->sections()->where('id', $records['new_section_id'])->exists()) { throw new InvalidValueException('New section is not in new class'); } @@ -227,7 +231,7 @@ public function promoteStudents($records) $students = $this->getAllActiveStudents()->whereIn('id', $records['student_id']); // make sure there are students to promote - if (! $students->count()) { + if (!$students->count()) { throw new EmptyRecordsException('No students to promote', 1); } @@ -237,24 +241,24 @@ public function promoteStudents($records) if (in_array($student->id, $records['student_id'])) { $student->studentRecord()->update([ 'my_class_id' => $records['new_class_id'], - 'section_id' => $records['new_section_id'], + 'section_id' => $records['new_section_id'], ]); $student->studentRecord->load('academicYears')->academicYears()->syncWithoutDetaching([$currentAcademicYear->id => [ 'my_class_id' => $records['new_class_id'], - 'section_id' => $records['new_section_id'], + 'section_id' => $records['new_section_id'], ]]); } } // create promotion record Promotion::create([ - 'old_class_id' => $records['old_class_id'], - 'new_class_id' => $records['new_class_id'], - 'old_section_id' => $records['old_section_id'], - 'new_section_id' => $records['new_section_id'], - 'students' => $students->pluck('id'), + 'old_class_id' => $records['old_class_id'], + 'new_class_id' => $records['new_class_id'], + 'old_section_id' => $records['old_section_id'], + 'new_section_id' => $records['new_section_id'], + 'students' => $students->pluck('id'), 'academic_year_id' => $academicYear, - 'school_id' => auth()->user()->school_id, + 'school_id' => auth()->user()->school_id, ]); } @@ -271,7 +275,8 @@ public function getAllPromotions() /** * Get promotions by academic year Id. * - * @param int $academicYearId The Primary key of the academic year + * @param int $academicYearId The Primary key of the academic year + * * @return \Illuminate\Database\Eloquent\Collection */ public function getPromotionsByAcademicYearId(int $academicYearId) @@ -282,7 +287,8 @@ public function getPromotionsByAcademicYearId(int $academicYearId) /** * Reset promotion. * - * @param Promotion $promotion instance of promotion to reset + * @param Promotion $promotion instance of promotion to reset + * * @return void */ public function resetPromotion(Promotion $promotion) @@ -293,11 +299,11 @@ public function resetPromotion(Promotion $promotion) foreach ($students as $student) { $student->allStudentRecords->load('academicYears')->academicYears()->syncWithoutDetaching([$currentAcademicYear->id => [ 'my_class_id' => $promotion->old_class_id, - 'section_id' => $promotion->old_section_id, + 'section_id' => $promotion->old_section_id, ]]); $student->allStudentRecords()->update([ 'my_class_id' => $promotion->old_class_id, - 'section_id' => $promotion->old_section_id, + 'section_id' => $promotion->old_section_id, ]); } @@ -307,10 +313,11 @@ public function resetPromotion(Promotion $promotion) /** * Graduate students. * - * @param mixed $records - * @return void + * @param mixed $records * * @throws InvalidValueException + * + * @return void */ public function graduateStudents($records) { @@ -318,7 +325,7 @@ public function graduateStudents($records) $students = $this->getAllActiveStudents()->whereIn('id', $records['student_id']); // make sure there are students to graduate - if (! $students->count()) { + if (!$students->count()) { throw new InvalidValueException('No students to graduate'); } diff --git a/app/Services/Subject/SubjectService.php b/app/Services/Subject/SubjectService.php index e20e24d3..e1d25181 100755 --- a/app/Services/Subject/SubjectService.php +++ b/app/Services/Subject/SubjectService.php @@ -42,19 +42,20 @@ public function getSubjectById(int $id) /** * Create subject. * - * @param mixed $data + * @param mixed $data + * * @return void */ public function createSubject($data) { $subject = Subject::firstOrCreate([ - 'name' => $data['name'], - 'short_name' => $data['short_name'], - 'school_id' => auth()->user()->school_id, + 'name' => $data['name'], + 'short_name' => $data['short_name'], + 'school_id' => auth()->user()->school_id, 'my_class_id' => $data['my_class_id'], ]); - if (! $subject->wasRecentlyCreated) { + if (!$subject->wasRecentlyCreated) { return session()->flash('danger', 'Subject already exists or something went wrong'); } @@ -73,7 +74,8 @@ public function createSubject($data) /** * Update subject. * - * @param mixed $data + * @param mixed $data + * * @return void */ public function updateSubject(Subject $subject, $data) @@ -113,6 +115,7 @@ public function deleteSubject(Subject $subject) * Assign a teacher to a list of subjects. * * @param array!mixed $records Array or collection of ids + * * @return void */ public function assignTeacherToSubjects(User $teacher, $records) diff --git a/app/Services/Syllabus/SyllabusService.php b/app/Services/Syllabus/SyllabusService.php index 775f4043..8d779e46 100755 --- a/app/Services/Syllabus/SyllabusService.php +++ b/app/Services/Syllabus/SyllabusService.php @@ -35,10 +35,10 @@ public function createSyllabus($data) ); Syllabus::create([ - 'name' => $data['name'], + 'name' => $data['name'], 'description' => $data['description'], - 'file' => $data['file'], - 'subject_id' => $data['subject_id'], + 'file' => $data['file'], + 'subject_id' => $data['subject_id'], 'semester_id' => $data['semester_id'], ]); } diff --git a/app/Services/Teacher/TeacherService.php b/app/Services/Teacher/TeacherService.php index f5265cb7..3b9b607d 100755 --- a/app/Services/Teacher/TeacherService.php +++ b/app/Services/Teacher/TeacherService.php @@ -31,7 +31,8 @@ public function getAllTeachers() /** * Create a new teacher. * - * @param collection $record + * @param collection $record + * * @return void */ public function createTeacher($record) @@ -43,7 +44,8 @@ public function createTeacher($record) /** * Update a teacher. * - * @param array|object|collection $records + * @param array|object|collection $records + * * @return void */ public function updateTeacher(User $teacher, $records) diff --git a/app/Services/Timetable/TimeSlotService.php b/app/Services/Timetable/TimeSlotService.php index 7401589f..18d0b6db 100755 --- a/app/Services/Timetable/TimeSlotService.php +++ b/app/Services/Timetable/TimeSlotService.php @@ -10,15 +10,16 @@ class TimeSlotService /** * Create timetable time slot. * - * @param Timetabke $timetable - * @param mixed $data + * @param Timetabke $timetable + * @param mixed $data + * * @return void */ public function createTimeSlot($data) { TimetableTimeSlot::create([ - 'start_time' => $data['start_time'], - 'stop_time' => $data['stop_time'], + 'start_time' => $data['start_time'], + 'stop_time' => $data['stop_time'], 'timetable_id' => $data['timetable_id'], ]); } @@ -31,13 +32,14 @@ public function deleteTimeSlot(TimetableTimeSlot $timeSlot) /** * Create timetable time record. * - * @param mixed $data + * @param mixed $data + * * @return void */ public function createTimetableRecord(TimetableTimeSlot $timeSlot, $data) { //remove existing record - if ($timeSlot->weekdays->find($data['weekday_id']) || ! isset($data['id']) || $data['id'] != null) { + if ($timeSlot->weekdays->find($data['weekday_id']) || !isset($data['id']) || $data['id'] != null) { $timeSlot->weekdays()->detach($data['weekday_id']); } diff --git a/app/Services/Timetable/TimetableService.php b/app/Services/Timetable/TimetableService.php index e66811ab..fca9f609 100755 --- a/app/Services/Timetable/TimetableService.php +++ b/app/Services/Timetable/TimetableService.php @@ -19,13 +19,14 @@ public function getAllTimetablesInSemesterAndClass($semester_id, $class_id) /** * Create timetable. * - * @param mixed $data + * @param mixed $data + * * @return void */ public function createTimetable($data) { Timetable::create([ - 'name' => $data['name'], + 'name' => $data['name'], 'description' => $data['description'] ?? null, 'my_class_id' => $data['my_class_id'], 'semester_id' => $data['semester_id'], @@ -35,7 +36,8 @@ public function createTimetable($data) /** * Update timetable. * - * @param mixed $data + * @param mixed $data + * * @return void */ public function updateTimetable(Timetable $timetable, $data) @@ -80,13 +82,14 @@ public function getAllCustomTimetableItem() /** * Create custom timetable item. * - * @param array $record + * @param array $record + * * @return \App\Models\CustomTimetableItem */ public function createCustomTimetableItem($record) { return CustomTimetableItem::create([ - 'name' => $record['name'], + 'name' => $record['name'], 'school_id' => $record['school_id'], ]); } @@ -94,7 +97,8 @@ public function createCustomTimetableItem($record) /** * Update a given custom timetable item. * - * @param array $record + * @param array $record + * * @return \App\Models\CustomTimetableItem */ public function updateCustomTimetableItem(CustomTimetableItem $customTimetableItem, $record) diff --git a/app/Services/User/UserService.php b/app/Services/User/UserService.php index 42938387..c9372e41 100755 --- a/app/Services/User/UserService.php +++ b/app/Services/User/UserService.php @@ -37,7 +37,8 @@ public function getAllUsers() /** * Get a user by id. * - * @param int $id + * @param int $id + * * @return \App\Models\User */ public function getUserById($id) @@ -48,7 +49,8 @@ public function getUserById($id) /** * Get users by role. * - * @param string $role + * @param string $role + * * @return \Illuminate\Database\Eloquent\Collection|static[] */ public function getUsersByRole($role) @@ -64,28 +66,28 @@ public function getUsersByRole($role) */ public function createUser($record) { - if (! $record['other_names']) { + if (!$record['other_names']) { $record['other_names'] = null; } $record['name'] = $this->createFullName($record['first_name'], $record['last_name'], $record['other_names']); $record['school_id'] = $record['school_id'] ?? auth()->user()->school_id; $user = $this->createUserAction->create([ - 'name' => $record['name'], - 'email' => $record['email'], - 'photo' => $record['profile_photo'] ?? null, - 'password' => $record['password'], - 'school_id' => $record['school_id'], - 'birthday' => $record['birthday'], + 'name' => $record['name'], + 'email' => $record['email'], + 'photo' => $record['profile_photo'] ?? null, + 'password' => $record['password'], + 'school_id' => $record['school_id'], + 'birthday' => $record['birthday'], 'password_confirmation' => $record['password_confirmation'], - 'address' => $record['address'], - 'blood_group' => $record['blood_group'], - 'religion' => $record['religion'], - 'nationality' => $record['nationality'], - 'state' => $record['state'], - 'city' => $record['city'], - 'gender' => $record['gender'], - 'phone' => $record['phone'], + 'address' => $record['address'], + 'blood_group' => $record['blood_group'], + 'religion' => $record['religion'], + 'nationality' => $record['nationality'], + 'state' => $record['state'], + 'city' => $record['city'], + 'gender' => $record['gender'], + 'phone' => $record['phone'], ]); return $user; @@ -94,7 +96,8 @@ public function createUser($record) /** * Create full name from first name, last name and other names. * - * @param string|null $othernames + * @param string|null $othernames + * * @return string */ public function createFullName($firstname, $lastname, $othernames = null) @@ -105,8 +108,9 @@ public function createFullName($firstname, $lastname, $othernames = null) /** * Check if user has a role. * - * @param int $id - * @param string $role + * @param int $id + * @param string $role + * * @return bool */ public function verifyRole($id, $role) @@ -119,18 +123,19 @@ public function verifyRole($id, $role) /** * Update user profile information. * - * @param User $user User instance - * @param string $role Verify role before updating + * @param User $user User instance + * @param string $role Verify role before updating + * * @return \App\Models\User */ public function updateUser(User $user, $record, string $role = null) { if (isset($role)) { - if (! $this->verifyRole($user->id, $role)) { + if (!$this->verifyRole($user->id, $role)) { abort('403', "User isn't a/an $role"); } } - if (! $record['other_names']) { + if (!$record['other_names']) { $record['other_names'] = null; } @@ -149,7 +154,8 @@ public function updateUser(User $user, $record, string $role = null) /** * Delete a user. * - * @param string $role + * @param string $role + * * @return void */ public function deleteUser(User $user) @@ -165,7 +171,7 @@ public function deleteUser(User $user) */ public function verifyUserIsOfRoleElseNotFound(User $user, string $role) { - if (! $this->verifyRole($user->id, $role)) { + if (!$this->verifyRole($user->id, $role)) { abort(404); } } diff --git a/app/Traits/EnvEditorTrait.php b/app/Traits/EnvEditorTrait.php index 2822c964..37816e56 100644 --- a/app/Traits/EnvEditorTrait.php +++ b/app/Traits/EnvEditorTrait.php @@ -26,7 +26,7 @@ public function setEnvironmentValue(array $values) $oldLine = substr($str, $keyPosition, $endOfLinePosition - $keyPosition); // If environment variable does not exist, add it - if ($keyPosition === false || ! $endOfLinePosition || ! $oldLine) { + if ($keyPosition === false || !$endOfLinePosition || !$oldLine) { $str .= "{$envKey}=\"{$envValue}\"\n"; } else { //else replace it @@ -36,7 +36,7 @@ public function setEnvironmentValue(array $values) } $str = trim($str); - if (! file_put_contents($envFile, $str)) { + if (!file_put_contents($envFile, $str)) { return false; } diff --git a/app/Traits/InSchool.php b/app/Traits/InSchool.php index afe4c659..c801acbf 100644 --- a/app/Traits/InSchool.php +++ b/app/Traits/InSchool.php @@ -9,7 +9,8 @@ trait InSchool /** * Scopes school procied else scopes school of currently authenticated user. * - * @param Illuminate\Database\Eloquent\Builder $query + * @param Illuminate\Database\Eloquent\Builder $query + * * @return Illuminate\Database\Eloquent\Builder */ public function scopeInSchool($query, ?School $school = null) diff --git a/app/Traits/MarkTabulationTrait.php b/app/Traits/MarkTabulationTrait.php index 855e96f9..f86a38f6 100644 --- a/app/Traits/MarkTabulationTrait.php +++ b/app/Traits/MarkTabulationTrait.php @@ -28,9 +28,10 @@ trait MarkTabulationTrait public Collection $students; /** - * @param Collection $subjects - * @param Collection $students - * @param Collection $examSlots + * @param Collection $subjects + * @param Collection $students + * @param Collection $examSlots + * * @return Collection */ public function tabulateMarks(ClassGroup $classGroup, Collection|SupportCollection $subjects, Collection|SupportCollection $students, Collection|SupportCollection $examSlots) diff --git a/config/app.php b/config/app.php index 4ca3c92b..c206182a 100755 --- a/config/app.php +++ b/config/app.php @@ -201,44 +201,44 @@ 'aliases' => [ - 'App' => Illuminate\Support\Facades\App::class, - 'Arr' => Illuminate\Support\Arr::class, - 'Artisan' => Illuminate\Support\Facades\Artisan::class, - 'Auth' => Illuminate\Support\Facades\Auth::class, - 'Blade' => Illuminate\Support\Facades\Blade::class, - 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, - 'Bus' => Illuminate\Support\Facades\Bus::class, - 'Cache' => Illuminate\Support\Facades\Cache::class, - 'Config' => Illuminate\Support\Facades\Config::class, - 'Cookie' => Illuminate\Support\Facades\Cookie::class, - 'Crypt' => Illuminate\Support\Facades\Crypt::class, - 'Date' => Illuminate\Support\Facades\Date::class, - 'DB' => Illuminate\Support\Facades\DB::class, - 'Eloquent' => Illuminate\Database\Eloquent\Model::class, - 'Event' => Illuminate\Support\Facades\Event::class, - 'File' => Illuminate\Support\Facades\File::class, - 'Gate' => Illuminate\Support\Facades\Gate::class, - 'Hash' => Illuminate\Support\Facades\Hash::class, - 'Http' => Illuminate\Support\Facades\Http::class, - 'Lang' => Illuminate\Support\Facades\Lang::class, - 'Log' => Illuminate\Support\Facades\Log::class, - 'Mail' => Illuminate\Support\Facades\Mail::class, + 'App' => Illuminate\Support\Facades\App::class, + 'Arr' => Illuminate\Support\Arr::class, + 'Artisan' => Illuminate\Support\Facades\Artisan::class, + 'Auth' => Illuminate\Support\Facades\Auth::class, + 'Blade' => Illuminate\Support\Facades\Blade::class, + 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, + 'Bus' => Illuminate\Support\Facades\Bus::class, + 'Cache' => Illuminate\Support\Facades\Cache::class, + 'Config' => Illuminate\Support\Facades\Config::class, + 'Cookie' => Illuminate\Support\Facades\Cookie::class, + 'Crypt' => Illuminate\Support\Facades\Crypt::class, + 'Date' => Illuminate\Support\Facades\Date::class, + 'DB' => Illuminate\Support\Facades\DB::class, + 'Eloquent' => Illuminate\Database\Eloquent\Model::class, + 'Event' => Illuminate\Support\Facades\Event::class, + 'File' => Illuminate\Support\Facades\File::class, + 'Gate' => Illuminate\Support\Facades\Gate::class, + 'Hash' => Illuminate\Support\Facades\Hash::class, + 'Http' => Illuminate\Support\Facades\Http::class, + 'Lang' => Illuminate\Support\Facades\Lang::class, + 'Log' => Illuminate\Support\Facades\Log::class, + 'Mail' => Illuminate\Support\Facades\Mail::class, 'Notification' => Illuminate\Support\Facades\Notification::class, - 'Password' => Illuminate\Support\Facades\Password::class, - 'Queue' => Illuminate\Support\Facades\Queue::class, - 'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class, - 'Redirect' => Illuminate\Support\Facades\Redirect::class, + 'Password' => Illuminate\Support\Facades\Password::class, + 'Queue' => Illuminate\Support\Facades\Queue::class, + 'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class, + 'Redirect' => Illuminate\Support\Facades\Redirect::class, // 'Redis' => Illuminate\Support\Facades\Redis::class, - 'Request' => Illuminate\Support\Facades\Request::class, - 'Response' => Illuminate\Support\Facades\Response::class, - 'Route' => Illuminate\Support\Facades\Route::class, - 'Schema' => Illuminate\Support\Facades\Schema::class, - 'Session' => Illuminate\Support\Facades\Session::class, - 'Storage' => Illuminate\Support\Facades\Storage::class, - 'Str' => Illuminate\Support\Str::class, - 'URL' => Illuminate\Support\Facades\URL::class, + 'Request' => Illuminate\Support\Facades\Request::class, + 'Response' => Illuminate\Support\Facades\Response::class, + 'Route' => Illuminate\Support\Facades\Route::class, + 'Schema' => Illuminate\Support\Facades\Schema::class, + 'Session' => Illuminate\Support\Facades\Session::class, + 'Storage' => Illuminate\Support\Facades\Storage::class, + 'Str' => Illuminate\Support\Str::class, + 'URL' => Illuminate\Support\Facades\URL::class, 'Validator' => Illuminate\Support\Facades\Validator::class, - 'View' => Illuminate\Support\Facades\View::class, + 'View' => Illuminate\Support\Facades\View::class, ], diff --git a/config/auth.php b/config/auth.php index d8c6cee7..413cfe35 100755 --- a/config/auth.php +++ b/config/auth.php @@ -14,7 +14,7 @@ */ 'defaults' => [ - 'guard' => 'web', + 'guard' => 'web', 'passwords' => 'users', ], @@ -37,7 +37,7 @@ 'guards' => [ 'web' => [ - 'driver' => 'session', + 'driver' => 'session', 'provider' => 'users', ], ], @@ -62,7 +62,7 @@ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\Models\User::class, + 'model' => App\Models\User::class, ], // 'users' => [ @@ -89,8 +89,8 @@ 'passwords' => [ 'users' => [ 'provider' => 'users', - 'table' => 'password_resets', - 'expire' => 60, + 'table' => 'password_resets', + 'expire' => 60, 'throttle' => 60, ], ], diff --git a/config/broadcasting.php b/config/broadcasting.php index 67fcbbd6..c25efe51 100755 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -31,13 +31,13 @@ 'connections' => [ 'pusher' => [ - 'driver' => 'pusher', - 'key' => env('PUSHER_APP_KEY'), - 'secret' => env('PUSHER_APP_SECRET'), - 'app_id' => env('PUSHER_APP_ID'), + 'driver' => 'pusher', + 'key' => env('PUSHER_APP_KEY'), + 'secret' => env('PUSHER_APP_SECRET'), + 'app_id' => env('PUSHER_APP_ID'), 'options' => [ 'cluster' => env('PUSHER_APP_CLUSTER'), - 'useTLS' => true, + 'useTLS' => true, ], 'client_options' => [ // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html @@ -46,11 +46,11 @@ 'ably' => [ 'driver' => 'ably', - 'key' => env('ABLY_KEY'), + 'key' => env('ABLY_KEY'), ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'default', ], diff --git a/config/cache.php b/config/cache.php index 8736c7a7..5cf05e6d 100755 --- a/config/cache.php +++ b/config/cache.php @@ -38,26 +38,26 @@ ], 'array' => [ - 'driver' => 'array', + 'driver' => 'array', 'serialize' => false, ], 'database' => [ - 'driver' => 'database', - 'table' => 'cache', - 'connection' => null, + 'driver' => 'database', + 'table' => 'cache', + 'connection' => null, 'lock_connection' => null, ], 'file' => [ 'driver' => 'file', - 'path' => storage_path('framework/cache/data'), + 'path' => storage_path('framework/cache/data'), ], 'memcached' => [ - 'driver' => 'memcached', + 'driver' => 'memcached', 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), - 'sasl' => [ + 'sasl' => [ env('MEMCACHED_USERNAME'), env('MEMCACHED_PASSWORD'), ], @@ -66,25 +66,25 @@ ], 'servers' => [ [ - 'host' => env('MEMCACHED_HOST', '127.0.0.1'), - 'port' => env('MEMCACHED_PORT', 11211), + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), 'weight' => 100, ], ], ], 'redis' => [ - 'driver' => 'redis', - 'connection' => 'cache', + 'driver' => 'redis', + 'connection' => 'cache', 'lock_connection' => 'default', ], 'dynamodb' => [ - 'driver' => 'dynamodb', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), - 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'driver' => 'dynamodb', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 'endpoint' => env('DYNAMODB_ENDPOINT'), ], diff --git a/config/database.php b/config/database.php index 3a491a24..e8a8eece 100755 --- a/config/database.php +++ b/config/database.php @@ -36,58 +36,58 @@ 'connections' => [ 'sqlite' => [ - 'driver' => 'sqlite', - 'url' => env('DATABASE_URL'), - 'database' => env('DB_DATABASE', database_path('database.sqlite')), - 'prefix' => '', + 'driver' => 'sqlite', + 'url' => env('DATABASE_URL'), + 'database' => env('DB_DATABASE', database_path('database.sqlite')), + 'prefix' => '', 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), ], 'mysql' => [ - 'driver' => 'mysql', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'unix_socket' => env('DB_SOCKET', ''), - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', - 'prefix' => '', + 'driver' => 'mysql', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_unicode_ci', + 'prefix' => '', 'prefix_indexes' => true, - 'strict' => true, - 'engine' => 'innoDb', - 'options' => extension_loaded('pdo_mysql') ? array_filter([ + 'strict' => true, + 'engine' => 'innoDb', + 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), ]) : [], ], 'pgsql' => [ - 'driver' => 'pgsql', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '5432'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'driver' => 'pgsql', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', 'prefix_indexes' => true, - 'search_path' => 'public', - 'sslmode' => 'prefer', + 'search_path' => 'public', + 'sslmode' => 'prefer', ], 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '1433'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'driver' => 'sqlsrv', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1433'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', 'prefix_indexes' => true, ], @@ -123,22 +123,22 @@ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), ], 'default' => [ - 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', '6379'), + 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_DB', '0'), ], 'cache' => [ - 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', '6379'), + 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_CACHE_DB', '1'), ], diff --git a/config/filesystems.php b/config/filesystems.php index cf5abce7..e1a6ccc5 100755 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -32,24 +32,24 @@ 'local' => [ 'driver' => 'local', - 'root' => storage_path('app'), + 'root' => storage_path('app'), ], 'public' => [ - 'driver' => 'local', - 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => env('APP_URL').'/storage', 'visibility' => 'public', ], 's3' => [ - 'driver' => 's3', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION'), - 'bucket' => env('AWS_BUCKET'), - 'url' => env('AWS_URL'), - 'endpoint' => env('AWS_ENDPOINT'), + 'driver' => 's3', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), + 'url' => env('AWS_URL'), + 'endpoint' => env('AWS_ENDPOINT'), 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), ], diff --git a/config/fortify.php b/config/fortify.php index ea3300df..d5be26c7 100755 --- a/config/fortify.php +++ b/config/fortify.php @@ -103,7 +103,7 @@ */ 'limiters' => [ - 'login' => 'login', + 'login' => 'login', 'two-factor' => 'two-factor', ], diff --git a/config/hashing.php b/config/hashing.php index 84257708..5b10c09d 100755 --- a/config/hashing.php +++ b/config/hashing.php @@ -44,9 +44,9 @@ */ 'argon' => [ - 'memory' => 1024, + 'memory' => 1024, 'threads' => 2, - 'time' => 2, + 'time' => 2, ], ]; diff --git a/config/logging.php b/config/logging.php index fefe0885..deecfb98 100755 --- a/config/logging.php +++ b/config/logging.php @@ -49,65 +49,65 @@ 'channels' => [ 'stack' => [ - 'driver' => 'stack', - 'channels' => ['single'], + 'driver' => 'stack', + 'channels' => ['single'], 'ignore_exceptions' => false, ], 'single' => [ 'driver' => 'single', - 'path' => storage_path('logs/laravel.log'), - 'level' => env('LOG_LEVEL', 'debug'), + 'path' => storage_path('logs/laravel.log'), + 'level' => env('LOG_LEVEL', 'debug'), ], 'daily' => [ 'driver' => 'daily', - 'path' => storage_path('logs/laravel.log'), - 'level' => env('LOG_LEVEL', 'debug'), - 'days' => 14, + 'path' => storage_path('logs/laravel.log'), + 'level' => env('LOG_LEVEL', 'debug'), + 'days' => 14, ], 'slack' => [ - 'driver' => 'slack', - 'url' => env('LOG_SLACK_WEBHOOK_URL'), + 'driver' => 'slack', + 'url' => env('LOG_SLACK_WEBHOOK_URL'), 'username' => 'Laravel Log', - 'emoji' => ':boom:', - 'level' => env('LOG_LEVEL', 'critical'), + 'emoji' => ':boom:', + 'level' => env('LOG_LEVEL', 'critical'), ], 'papertrail' => [ - 'driver' => 'monolog', - 'level' => env('LOG_LEVEL', 'debug'), - 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), + 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), + 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), 'handler_with' => [ - 'host' => env('PAPERTRAIL_URL'), - 'port' => env('PAPERTRAIL_PORT'), + 'host' => env('PAPERTRAIL_URL'), + 'port' => env('PAPERTRAIL_PORT'), 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), ], ], 'stderr' => [ - 'driver' => 'monolog', - 'level' => env('LOG_LEVEL', 'debug'), - 'handler' => StreamHandler::class, + 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), + 'handler' => StreamHandler::class, 'formatter' => env('LOG_STDERR_FORMATTER'), - 'with' => [ + 'with' => [ 'stream' => 'php://stderr', ], ], 'syslog' => [ 'driver' => 'syslog', - 'level' => env('LOG_LEVEL', 'debug'), + 'level' => env('LOG_LEVEL', 'debug'), ], 'errorlog' => [ 'driver' => 'errorlog', - 'level' => env('LOG_LEVEL', 'debug'), + 'level' => env('LOG_LEVEL', 'debug'), ], 'null' => [ - 'driver' => 'monolog', + 'driver' => 'monolog', 'handler' => NullHandler::class, ], diff --git a/config/mail.php b/config/mail.php index d3e125d2..34355294 100755 --- a/config/mail.php +++ b/config/mail.php @@ -35,13 +35,13 @@ 'mailers' => [ 'smtp' => [ - 'transport' => 'smtp', - 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), - 'port' => env('MAIL_PORT', 587), + 'transport' => 'smtp', + 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), + 'port' => env('MAIL_PORT', 587), 'encryption' => env('MAIL_ENCRYPTION', 'tls'), - 'username' => env('MAIL_USERNAME'), - 'password' => env('MAIL_PASSWORD'), - 'timeout' => null, + 'username' => env('MAIL_USERNAME'), + 'password' => env('MAIL_PASSWORD'), + 'timeout' => null, ], 'ses' => [ @@ -58,12 +58,12 @@ 'sendmail' => [ 'transport' => 'sendmail', - 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -t -i'), + 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -t -i'), ], 'log' => [ 'transport' => 'log', - 'channel' => env('MAIL_LOG_CHANNEL'), + 'channel' => env('MAIL_LOG_CHANNEL'), ], 'array' => [ @@ -72,7 +72,7 @@ 'failover' => [ 'transport' => 'failover', - 'mailers' => [ + 'mailers' => [ 'smtp', 'log', ], @@ -92,12 +92,12 @@ 'from' => [ 'address' => env('MAIL_FROM_ADDRESS', 'hello@skuul.test'), - 'name' => env('MAIL_FROM_NAME', 'Example'), + 'name' => env('MAIL_FROM_NAME', 'Example'), ], 'reply_to' => [ 'address' => env('MAIL_REPLY_ADDRESS', 'contact@skuul.test'), - 'name' => env('MAIL_REPLY_NAME', env('APP_NAME')), + 'name' => env('MAIL_REPLY_NAME', env('APP_NAME')), ], /* diff --git a/config/permission.php b/config/permission.php index 5b6e184c..276fa9e0 100755 --- a/config/permission.php +++ b/config/permission.php @@ -75,7 +75,7 @@ /* * Change this if you want to name the related pivots other than defaults */ - 'role_pivot_key' => null, //default 'role_id', + 'role_pivot_key' => null, //default 'role_id', 'permission_pivot_key' => null, //default 'permission_id', /* diff --git a/config/queue.php b/config/queue.php index 25ea5a81..84f74388 100755 --- a/config/queue.php +++ b/config/queue.php @@ -35,39 +35,39 @@ ], 'database' => [ - 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', - 'retry_after' => 90, + 'driver' => 'database', + 'table' => 'jobs', + 'queue' => 'default', + 'retry_after' => 90, 'after_commit' => false, ], 'beanstalkd' => [ - 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', - 'retry_after' => 90, - 'block_for' => 0, + 'driver' => 'beanstalkd', + 'host' => 'localhost', + 'queue' => 'default', + 'retry_after' => 90, + 'block_for' => 0, 'after_commit' => false, ], 'sqs' => [ - 'driver' => 'sqs', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), - 'queue' => env('SQS_QUEUE', 'default'), - 'suffix' => env('SQS_SUFFIX'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'driver' => 'sqs', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), + 'queue' => env('SQS_QUEUE', 'default'), + 'suffix' => env('SQS_SUFFIX'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 'after_commit' => false, ], 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - 'queue' => env('REDIS_QUEUE', 'default'), - 'retry_after' => 90, - 'block_for' => null, + 'driver' => 'redis', + 'connection' => 'default', + 'queue' => env('REDIS_QUEUE', 'default'), + 'retry_after' => 90, + 'block_for' => null, 'after_commit' => false, ], @@ -85,9 +85,9 @@ */ 'failed' => [ - 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), + 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 'database' => env('DB_CONNECTION', 'mysql'), - 'table' => 'failed_jobs', + 'table' => 'failed_jobs', ], ]; diff --git a/config/sanctum.php b/config/sanctum.php index 442726a7..738a7249 100755 --- a/config/sanctum.php +++ b/config/sanctum.php @@ -45,7 +45,7 @@ 'middleware' => [ 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, - 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, + 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, ], ]; diff --git a/config/services.php b/config/services.php index 2a1d616c..3215b423 100755 --- a/config/services.php +++ b/config/services.php @@ -15,8 +15,8 @@ */ 'mailgun' => [ - 'domain' => env('MAILGUN_DOMAIN'), - 'secret' => env('MAILGUN_SECRET'), + 'domain' => env('MAILGUN_DOMAIN'), + 'secret' => env('MAILGUN_SECRET'), 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), ], @@ -25,7 +25,7 @@ ], 'ses' => [ - 'key' => env('AWS_ACCESS_KEY_ID'), + 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], diff --git a/config/world.php b/config/world.php index ba0db649..0c5b5103 100755 --- a/config/world.php +++ b/config/world.php @@ -30,11 +30,11 @@ |-------------------------------------------------------------------------- */ 'modules' => [ - 'states' => true, - 'cities' => true, - 'timezones' => true, + 'states' => true, + 'cities' => true, + 'timezones' => true, 'currencies' => true, - 'languages' => true, + 'languages' => true, ], /* |-------------------------------------------------------------------------- @@ -49,91 +49,91 @@ */ 'migrations' => [ 'countries' => [ - 'table_name' => 'countries', + 'table_name' => 'countries', 'optional_fields' => [ 'phone_code' => [ 'required' => true, - 'type' => 'string', - 'length' => 5, + 'type' => 'string', + 'length' => 5, ], 'iso3' => [ 'required' => true, - 'type' => 'string', - 'length' => 3, + 'type' => 'string', + 'length' => 3, ], 'native' => [ 'required' => false, - 'type' => 'string', + 'type' => 'string', ], 'region' => [ 'required' => true, - 'type' => 'string', + 'type' => 'string', ], 'subregion' => [ 'required' => true, - 'type' => 'string', + 'type' => 'string', ], 'latitude' => [ 'required' => false, - 'type' => 'string', + 'type' => 'string', ], 'longitude' => [ 'required' => false, - 'type' => 'string', + 'type' => 'string', ], 'emoji' => [ 'required' => false, - 'type' => 'string', + 'type' => 'string', ], 'emojiU' => [ 'required' => false, - 'type' => 'string', + 'type' => 'string', ], ], ], 'states' => [ - 'table_name' => 'states', + 'table_name' => 'states', 'optional_fields' => [ 'country_code' => [ 'required' => true, - 'type' => 'string', - 'length' => 3, + 'type' => 'string', + 'length' => 3, ], 'state_code' => [ 'required' => false, - 'type' => 'string', - 'length' => 3, + 'type' => 'string', + 'length' => 3, ], 'latitude' => [ 'required' => false, - 'type' => 'string', + 'type' => 'string', ], 'longitude' => [ 'required' => false, - 'type' => 'string', + 'type' => 'string', ], ], ], 'cities' => [ - 'table_name' => 'cities', + 'table_name' => 'cities', 'optional_fields' => [ 'country_code' => [ 'required' => true, - 'type' => 'string', - 'length' => 3, + 'type' => 'string', + 'length' => 3, ], 'state_code' => [ 'required' => false, - 'type' => 'string', - 'length' => 3, + 'type' => 'string', + 'length' => 3, ], 'latitude' => [ 'required' => false, - 'type' => 'string', + 'type' => 'string', ], 'longitude' => [ 'required' => false, - 'type' => 'string', + 'type' => 'string', ], ], ], diff --git a/database/factories/AcademicYearFactory.php b/database/factories/AcademicYearFactory.php index 49072833..947b0686 100755 --- a/database/factories/AcademicYearFactory.php +++ b/database/factories/AcademicYearFactory.php @@ -17,8 +17,8 @@ public function definition() return [ 'start_year' => $year, - 'stop_year' => $year + 1, - 'school_id' => 1, + 'stop_year' => $year + 1, + 'school_id' => 1, ]; } } diff --git a/database/factories/ClassGroupFactory.php b/database/factories/ClassGroupFactory.php index 8635e470..9f922498 100755 --- a/database/factories/ClassGroupFactory.php +++ b/database/factories/ClassGroupFactory.php @@ -14,7 +14,7 @@ class ClassGroupFactory extends Factory public function definition() { return [ - 'name' => $this->faker->name(), + 'name' => $this->faker->name(), 'school_id' => 1, ]; } diff --git a/database/factories/CustomTimetableItemFactory.php b/database/factories/CustomTimetableItemFactory.php index 7a33c353..a5dec196 100644 --- a/database/factories/CustomTimetableItemFactory.php +++ b/database/factories/CustomTimetableItemFactory.php @@ -17,7 +17,7 @@ class CustomTimetableItemFactory extends Factory public function definition() { return [ - 'name' => $this->faker->name(), + 'name' => $this->faker->name(), 'school_id' => 1, ]; } diff --git a/database/factories/ExamFactory.php b/database/factories/ExamFactory.php index e2efbf21..8b0a8633 100755 --- a/database/factories/ExamFactory.php +++ b/database/factories/ExamFactory.php @@ -20,11 +20,11 @@ public function definition() $stop = $this->faker->dateTimeBetween($start, $start->format('Y-m-d H:i:s').' +10 days'); return [ - 'name' => $this->faker->word, + 'name' => $this->faker->word, 'description' => $this->faker->sentence, 'semester_id' => '1', - 'start_date' => $start, - 'stop_date' => $stop, + 'start_date' => $start, + 'stop_date' => $stop, ]; } } diff --git a/database/factories/ExamRecordFactory.php b/database/factories/ExamRecordFactory.php index 6ded8286..e7680d56 100755 --- a/database/factories/ExamRecordFactory.php +++ b/database/factories/ExamRecordFactory.php @@ -19,10 +19,10 @@ public function definition() return [ // 1st exam slot reserved for testing 'exam_slot_id' => $this->faker->numberBetween(2, 9), - 'section_id' => 1, - 'user_id' => 4, + 'section_id' => 1, + 'user_id' => 4, //first subject reserved for testing - 'subject_id' => $this->faker->numberBetween(1, 10), + 'subject_id' => $this->faker->numberBetween(1, 10), 'student_marks' => $this->faker->numberBetween(1, 100), ]; } diff --git a/database/factories/ExamSlotFactory.php b/database/factories/ExamSlotFactory.php index ac612685..c1736cfa 100755 --- a/database/factories/ExamSlotFactory.php +++ b/database/factories/ExamSlotFactory.php @@ -17,10 +17,10 @@ class ExamSlotFactory extends Factory public function definition() { return [ - 'name' => $this->faker->name, + 'name' => $this->faker->name, 'description' => $this->faker->sentence, 'total_marks' => $this->faker->numberBetween(1, 1000), - 'exam_id' => 1, + 'exam_id' => 1, ]; } } diff --git a/database/factories/GradeSystemFactory.php b/database/factories/GradeSystemFactory.php index e96c9a61..d0123795 100755 --- a/database/factories/GradeSystemFactory.php +++ b/database/factories/GradeSystemFactory.php @@ -19,11 +19,11 @@ public function definition() $grade_from = $this->faker->numberBetween(100, 1000); return [ - 'name' => $this->faker->word, - 'remark' => $this->faker->sentence, + 'name' => $this->faker->word, + 'remark' => $this->faker->sentence, 'class_group_id' => '1', - 'grade_from' => $grade_from, - 'grade_till' => $grade_from = 100, + 'grade_from' => $grade_from, + 'grade_till' => $grade_from = 100, ]; } } diff --git a/database/factories/MyClassFactory.php b/database/factories/MyClassFactory.php index 954ce4ee..4f2face9 100755 --- a/database/factories/MyClassFactory.php +++ b/database/factories/MyClassFactory.php @@ -14,7 +14,7 @@ class MyClassFactory extends Factory public function definition() { return [ - 'name' => $this->faker->name, + 'name' => $this->faker->name, 'class_group_id' => '1', ]; } diff --git a/database/factories/NoticeFactory.php b/database/factories/NoticeFactory.php index 0aec3d84..dbf17344 100755 --- a/database/factories/NoticeFactory.php +++ b/database/factories/NoticeFactory.php @@ -20,13 +20,13 @@ public function definition() $stopDate = $startDate->add(date_interval_create_from_date_string('10 days')); return [ - 'title' => $this->faker->sentence, - 'content' => $this->faker->paragraph, + 'title' => $this->faker->sentence, + 'content' => $this->faker->paragraph, 'attachment' => $this->faker->imageUrl(), 'start_date' => $startDate->format('Y-m-d'), - 'stop_date' => $stopDate->format('Y-m-d'), - 'active' => $this->faker->boolean, - 'school_id' => 1, + 'stop_date' => $stopDate->format('Y-m-d'), + 'active' => $this->faker->boolean, + 'school_id' => 1, ]; } } diff --git a/database/factories/PromotionFactory.php b/database/factories/PromotionFactory.php index c87d718c..b7e1f4ed 100755 --- a/database/factories/PromotionFactory.php +++ b/database/factories/PromotionFactory.php @@ -17,13 +17,13 @@ class PromotionFactory extends Factory public function definition() { return [ - 'old_class_id' => 1, - 'new_class_id' => 2, - 'old_section_id' => 1, - 'new_section_id' => 2, + 'old_class_id' => 1, + 'new_class_id' => 2, + 'old_section_id' => 1, + 'new_section_id' => 2, 'academic_year_id' => 1, - 'school_id' => 1, - 'students' => [4], + 'school_id' => 1, + 'students' => [4], ]; } } diff --git a/database/factories/SchoolFactory.php b/database/factories/SchoolFactory.php index 1c6de1aa..51debeeb 100755 --- a/database/factories/SchoolFactory.php +++ b/database/factories/SchoolFactory.php @@ -14,10 +14,10 @@ class SchoolFactory extends Factory public function definition() { return [ - 'name' => $this->faker->name(), - 'address' => $this->faker->address(), + 'name' => $this->faker->name(), + 'address' => $this->faker->address(), 'initials' => $this->faker->unique()->word(), - 'code' => $this->faker->unique()->randomNumber(5), + 'code' => $this->faker->unique()->randomNumber(5), ]; } @@ -25,11 +25,11 @@ public function createDefaultSchool() { return $this->state(function (array $attributes) { return [ - 'id' => 1, - 'name' => 'Default school', - 'address' => $this->faker->address(), + 'id' => 1, + 'name' => 'Default school', + 'address' => $this->faker->address(), 'initials' => $this->faker->unique()->word(), - 'code' => $this->faker->unique()->randomNumber(5), + 'code' => $this->faker->unique()->randomNumber(5), ]; }); } diff --git a/database/factories/SectionFactory.php b/database/factories/SectionFactory.php index 0b446302..07f4beda 100755 --- a/database/factories/SectionFactory.php +++ b/database/factories/SectionFactory.php @@ -14,7 +14,7 @@ class SectionFactory extends Factory public function definition() { return [ - 'name' => $this->faker->name, + 'name' => $this->faker->name, 'my_class_id' => 1, ]; } diff --git a/database/factories/SemesterFactory.php b/database/factories/SemesterFactory.php index 3600abac..7ed57abc 100755 --- a/database/factories/SemesterFactory.php +++ b/database/factories/SemesterFactory.php @@ -17,10 +17,10 @@ class SemesterFactory extends Factory public function definition() { return [ - 'id' => $this->faker->numberBetween(1, 10000), - 'name' => $this->faker->unique()->word, + 'id' => $this->faker->numberBetween(1, 10000), + 'name' => $this->faker->unique()->word, 'academic_year_id' => 1, - 'school_id' => 1, + 'school_id' => 1, ]; } } diff --git a/database/factories/StudentFactory.php b/database/factories/StudentFactory.php index 297392ae..2f7e327c 100644 --- a/database/factories/StudentFactory.php +++ b/database/factories/StudentFactory.php @@ -33,11 +33,11 @@ public function definition() $student->assignRole('student'); return [ - 'user_id' => $student->id, - 'my_class_id' => $class->id, - 'section_id' => $class->sections->first()->id ?? null, - 'admission_date' => $this->faker->date(), - 'is_graduated' => false, + 'user_id' => $student->id, + 'my_class_id' => $class->id, + 'section_id' => $class->sections->first()->id ?? null, + 'admission_date' => $this->faker->date(), + 'is_graduated' => false, 'admission_number' => Str::random(10), ]; } diff --git a/database/factories/SubjectFactory.php b/database/factories/SubjectFactory.php index 84c9b8ea..84ee7f5b 100755 --- a/database/factories/SubjectFactory.php +++ b/database/factories/SubjectFactory.php @@ -17,10 +17,10 @@ class SubjectFactory extends Factory public function definition() { return [ - 'name' => $this->faker->name, - 'short_name' => $this->faker->lexify('???'), + 'name' => $this->faker->name, + 'short_name' => $this->faker->lexify('???'), 'my_class_id' => 1, - 'school_id' => 1, + 'school_id' => 1, ]; } } diff --git a/database/factories/SyllabusFactory.php b/database/factories/SyllabusFactory.php index d0fa84eb..d23a776e 100755 --- a/database/factories/SyllabusFactory.php +++ b/database/factories/SyllabusFactory.php @@ -19,11 +19,11 @@ public function definition() $file = \Illuminate\Http\UploadedFile::fake()->create('test.pdf')->store('pdfs'); return [ - 'name' => $this->faker->sentence, + 'name' => $this->faker->sentence, 'description' => $this->faker->paragraph, - 'subject_id' => 1, + 'subject_id' => 1, 'semester_id' => 1, - 'file' => $file, + 'file' => $file, ]; } } diff --git a/database/factories/TimetableFactory.php b/database/factories/TimetableFactory.php index 159ac2b9..485c013a 100755 --- a/database/factories/TimetableFactory.php +++ b/database/factories/TimetableFactory.php @@ -17,8 +17,8 @@ class TimetableFactory extends Factory public function definition() { return [ - 'id' => $this->faker->numberBetween(1, 10000), - 'name' => $this->faker->name, + 'id' => $this->faker->numberBetween(1, 10000), + 'name' => $this->faker->name, 'description' => $this->faker->text, 'my_class_id' => 1, 'semester_id' => 1, diff --git a/database/factories/TimetableTimeSlotFactory.php b/database/factories/TimetableTimeSlotFactory.php index 190e8c9a..be877382 100755 --- a/database/factories/TimetableTimeSlotFactory.php +++ b/database/factories/TimetableTimeSlotFactory.php @@ -18,8 +18,8 @@ public function definition() { return [ 'timetable_id' => 1, - 'start_time' => $this->faker->time('H:i'), - 'stop_time' => $this->faker->time('H:i'), + 'start_time' => $this->faker->time('H:i'), + 'stop_time' => $this->faker->time('H:i'), ]; } diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 4277ad8a..fc0420d4 100755 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -19,21 +19,21 @@ class UserFactory extends Factory public function definition() { return [ - 'name' => $this->faker->name(), - 'email' => $this->faker->unique()->safeEmail(), + 'name' => $this->faker->name(), + 'email' => $this->faker->unique()->safeEmail(), 'email_verified_at' => now(), - 'password' => Hash::make(Str::random(10)), - 'remember_token' => Str::random(10), - 'address' => $this->faker->address(), - 'birthday' => $this->faker->date(), - 'address' => $this->faker->address(), - 'school_id' => 1, - 'blood_group' => 'a+', - 'religion' => 'christian', - 'nationality' => $this->faker->country(), - 'state' => 'wyoming', - 'city' => $this->faker->city(), - 'gender' => 'male', + 'password' => Hash::make(Str::random(10)), + 'remember_token' => Str::random(10), + 'address' => $this->faker->address(), + 'birthday' => $this->faker->date(), + 'address' => $this->faker->address(), + 'school_id' => 1, + 'blood_group' => 'a+', + 'religion' => 'christian', + 'nationality' => $this->faker->country(), + 'state' => 'wyoming', + 'city' => $this->faker->city(), + 'gender' => 'male', ]; } @@ -58,7 +58,7 @@ public function unverified() */ public function withPersonalTeam() { - if (! Features::hasTeamFeatures()) { + if (!Features::hasTeamFeatures()) { return $this->state([]); } diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index f9aaf92b..3f7f6c8d 100755 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { /** * Run the migrations. * diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php index 601e3003..47f5a296 100755 --- a/database/migrations/2014_10_12_100000_create_password_resets_table.php +++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { /** * Run the migrations. * diff --git a/database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php b/database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php index 675bec4b..00d75094 100755 --- a/database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php +++ b/database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { /** * Run the migrations. * diff --git a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php index 962b5e87..5e9a296e 100755 --- a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php +++ b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { /** * Run the migrations. * diff --git a/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php b/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php index 99abe605..031550e0 100755 --- a/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php +++ b/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { /** * Run the migrations. * diff --git a/database/migrations/2021_11_04_183411_create_sessions_table.php b/database/migrations/2021_11_04_183411_create_sessions_table.php index 9ee9e69e..4c205cd4 100755 --- a/database/migrations/2021_11_04_183411_create_sessions_table.php +++ b/database/migrations/2021_11_04_183411_create_sessions_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { /** * Run the migrations. * diff --git a/database/migrations/2021_11_04_201030_create_schools_table.php b/database/migrations/2021_11_04_201030_create_schools_table.php index 82c0bd1d..0fb2ca6d 100755 --- a/database/migrations/2021_11_04_201030_create_schools_table.php +++ b/database/migrations/2021_11_04_201030_create_schools_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { /** * Run the migrations. * diff --git a/database/migrations/2021_11_04_210323_create_permission_tables.php b/database/migrations/2021_11_04_210323_create_permission_tables.php index 686f1f96..756bfa57 100755 --- a/database/migrations/2021_11_04_210323_create_permission_tables.php +++ b/database/migrations/2021_11_04_210323_create_permission_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; use Spatie\Permission\PermissionRegistrar; -return new class() extends Migration -{ +return new class() extends Migration { /** * Run the migrations. * diff --git a/database/migrations/2021_11_05_185142_add_fields_to_users_table.php b/database/migrations/2021_11_05_185142_add_fields_to_users_table.php index 2783eef5..a4446d39 100755 --- a/database/migrations/2021_11_05_185142_add_fields_to_users_table.php +++ b/database/migrations/2021_11_05_185142_add_fields_to_users_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { /** * Run the migrations. * diff --git a/database/migrations/2021_11_06_152551_create_class_groups_table.php b/database/migrations/2021_11_06_152551_create_class_groups_table.php index 60f41ce0..ee556393 100755 --- a/database/migrations/2021_11_06_152551_create_class_groups_table.php +++ b/database/migrations/2021_11_06_152551_create_class_groups_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { /** * Run the migrations. * diff --git a/database/migrations/2021_11_11_191639_create_my_classes_table.php b/database/migrations/2021_11_11_191639_create_my_classes_table.php index e0695c17..d2fdba80 100755 --- a/database/migrations/2021_11_11_191639_create_my_classes_table.php +++ b/database/migrations/2021_11_11_191639_create_my_classes_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { /** * Run the migrations. * diff --git a/database/migrations/2021_12_03_143438_create_sections_table.php b/database/migrations/2021_12_03_143438_create_sections_table.php index 6114a406..fec64f94 100755 --- a/database/migrations/2021_12_03_143438_create_sections_table.php +++ b/database/migrations/2021_12_03_143438_create_sections_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { /** * Run the migrations. * diff --git a/database/migrations/2021_12_27_093512_create_student_records_table.php b/database/migrations/2021_12_27_093512_create_student_records_table.php index 0a9c044e..e681baf2 100755 --- a/database/migrations/2021_12_27_093512_create_student_records_table.php +++ b/database/migrations/2021_12_27_093512_create_student_records_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('student_records', static function (Blueprint $table) { diff --git a/database/migrations/2022_01_02_155324_create_academic_years_table.php b/database/migrations/2022_01_02_155324_create_academic_years_table.php index 1b5bd47e..843710cc 100755 --- a/database/migrations/2022_01_02_155324_create_academic_years_table.php +++ b/database/migrations/2022_01_02_155324_create_academic_years_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('academic_years', static function (Blueprint $table) { diff --git a/database/migrations/2022_01_03_101855_create_teacher_records_table.php b/database/migrations/2022_01_03_101855_create_teacher_records_table.php index dc301b68..f3208745 100755 --- a/database/migrations/2022_01_03_101855_create_teacher_records_table.php +++ b/database/migrations/2022_01_03_101855_create_teacher_records_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('teacher_records', static function (Blueprint $table) { diff --git a/database/migrations/2022_01_11_194118_create_subjects_table.php b/database/migrations/2022_01_11_194118_create_subjects_table.php index 7921d72f..10472e16 100755 --- a/database/migrations/2022_01_11_194118_create_subjects_table.php +++ b/database/migrations/2022_01_11_194118_create_subjects_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('subjects', static function (Blueprint $table) { diff --git a/database/migrations/2022_01_11_222345_add_academic_year_id_to_schools_table.php b/database/migrations/2022_01_11_222345_add_academic_year_id_to_schools_table.php index 100f7bcd..d71da3eb 100755 --- a/database/migrations/2022_01_11_222345_add_academic_year_id_to_schools_table.php +++ b/database/migrations/2022_01_11_222345_add_academic_year_id_to_schools_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::table('schools', static function (Blueprint $table) { diff --git a/database/migrations/2022_01_20_193649_create_subject_user_table.php b/database/migrations/2022_01_20_193649_create_subject_user_table.php index f68f9643..f7bd5485 100755 --- a/database/migrations/2022_01_20_193649_create_subject_user_table.php +++ b/database/migrations/2022_01_20_193649_create_subject_user_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('subject_user', static function (Blueprint $table) { diff --git a/database/migrations/2022_02_12_001925_create_promotions_table.php b/database/migrations/2022_02_12_001925_create_promotions_table.php index a17c60c3..a06346ae 100755 --- a/database/migrations/2022_02_12_001925_create_promotions_table.php +++ b/database/migrations/2022_02_12_001925_create_promotions_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('promotions', static function (Blueprint $table) { diff --git a/database/migrations/2022_03_04_184650_create_semester_table.php b/database/migrations/2022_03_04_184650_create_semester_table.php index 1b5fcb56..2eb7e47b 100755 --- a/database/migrations/2022_03_04_184650_create_semester_table.php +++ b/database/migrations/2022_03_04_184650_create_semester_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('semesters', static function (Blueprint $table) { diff --git a/database/migrations/2022_03_08_091612_add_semester_id_to_schools_table.php b/database/migrations/2022_03_08_091612_add_semester_id_to_schools_table.php index a53bc9ee..45a5bb88 100755 --- a/database/migrations/2022_03_08_091612_add_semester_id_to_schools_table.php +++ b/database/migrations/2022_03_08_091612_add_semester_id_to_schools_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::table('schools', static function (Blueprint $table) { diff --git a/database/migrations/2022_03_12_125021_create_syllabi_table.php b/database/migrations/2022_03_12_125021_create_syllabi_table.php index da385ce0..03911158 100755 --- a/database/migrations/2022_03_12_125021_create_syllabi_table.php +++ b/database/migrations/2022_03_12_125021_create_syllabi_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('syllabi', static function (Blueprint $table) { diff --git a/database/migrations/2022_03_26_233935_create_timetable_table.php b/database/migrations/2022_03_26_233935_create_timetable_table.php index 876581b7..c1421762 100755 --- a/database/migrations/2022_03_26_233935_create_timetable_table.php +++ b/database/migrations/2022_03_26_233935_create_timetable_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('timetables', static function (Blueprint $table) { diff --git a/database/migrations/2022_03_30_122253_create_timetable_time_slots_table.php b/database/migrations/2022_03_30_122253_create_timetable_time_slots_table.php index 67d187fe..f90b8e0c 100755 --- a/database/migrations/2022_03_30_122253_create_timetable_time_slots_table.php +++ b/database/migrations/2022_03_30_122253_create_timetable_time_slots_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('timetable_time_slots', static function (Blueprint $table) { diff --git a/database/migrations/2022_03_31_213839_create_weekdays_table.php b/database/migrations/2022_03_31_213839_create_weekdays_table.php index 59e2f383..e5c02f74 100755 --- a/database/migrations/2022_03_31_213839_create_weekdays_table.php +++ b/database/migrations/2022_03_31_213839_create_weekdays_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('weekdays', static function (Blueprint $table) { diff --git a/database/migrations/2022_03_31_225139_create_timetable_time_slot_weekday.php b/database/migrations/2022_03_31_225139_create_timetable_time_slot_weekday.php index ccc24d74..39ac4284 100755 --- a/database/migrations/2022_03_31_225139_create_timetable_time_slot_weekday.php +++ b/database/migrations/2022_03_31_225139_create_timetable_time_slot_weekday.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('timetable_time_slot_weekday', static function (Blueprint $table) { diff --git a/database/migrations/2022_04_26_033729_create_exams_table.php b/database/migrations/2022_04_26_033729_create_exams_table.php index 2fcef9ad..c7764542 100755 --- a/database/migrations/2022_04_26_033729_create_exams_table.php +++ b/database/migrations/2022_04_26_033729_create_exams_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('exams', static function (Blueprint $table) { diff --git a/database/migrations/2022_04_30_020211_create_grade_systems_table.php b/database/migrations/2022_04_30_020211_create_grade_systems_table.php index 934608eb..03627ced 100755 --- a/database/migrations/2022_04_30_020211_create_grade_systems_table.php +++ b/database/migrations/2022_04_30_020211_create_grade_systems_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('grade_systems', static function (Blueprint $table) { diff --git a/database/migrations/2022_05_02_224958_create_exam_slots_table.php b/database/migrations/2022_05_02_224958_create_exam_slots_table.php index 01c70060..e7040356 100755 --- a/database/migrations/2022_05_02_224958_create_exam_slots_table.php +++ b/database/migrations/2022_05_02_224958_create_exam_slots_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('exam_slots', static function (Blueprint $table) { diff --git a/database/migrations/2022_05_13_133106_create_exam_records_table.php b/database/migrations/2022_05_13_133106_create_exam_records_table.php index ad121366..8fa5854b 100755 --- a/database/migrations/2022_05_13_133106_create_exam_records_table.php +++ b/database/migrations/2022_05_13_133106_create_exam_records_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('exam_records', static function (Blueprint $table) { diff --git a/database/migrations/2022_05_28_205955_create_notices_table.php b/database/migrations/2022_05_28_205955_create_notices_table.php index fb5b4888..7131515a 100755 --- a/database/migrations/2022_05_28_205955_create_notices_table.php +++ b/database/migrations/2022_05_28_205955_create_notices_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('notices', static function (Blueprint $table) { diff --git a/database/migrations/2022_06_22_191157_create_parent_records_table.php b/database/migrations/2022_06_22_191157_create_parent_records_table.php index 43582460..ab23bc98 100755 --- a/database/migrations/2022_06_22_191157_create_parent_records_table.php +++ b/database/migrations/2022_06_22_191157_create_parent_records_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('parent_records', static function (Blueprint $table) { diff --git a/database/migrations/2022_07_08_131950_create_parent_record_user_table.php b/database/migrations/2022_07_08_131950_create_parent_record_user_table.php index 0231fa25..8ec66cc1 100755 --- a/database/migrations/2022_07_08_131950_create_parent_record_user_table.php +++ b/database/migrations/2022_07_08_131950_create_parent_record_user_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('parent_record_user', static function (Blueprint $table) { diff --git a/database/migrations/2022_09_02_141457_correct_unique_key_in_subjects_table.php b/database/migrations/2022_09_02_141457_correct_unique_key_in_subjects_table.php index 3a1906e0..71895616 100755 --- a/database/migrations/2022_09_02_141457_correct_unique_key_in_subjects_table.php +++ b/database/migrations/2022_09_02_141457_correct_unique_key_in_subjects_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::table('subjects', static function (Blueprint $table) { diff --git a/database/migrations/2022_09_06_172335_add_unique_key_to_my_classes_table.php b/database/migrations/2022_09_06_172335_add_unique_key_to_my_classes_table.php index bcac258e..5578ea3b 100755 --- a/database/migrations/2022_09_06_172335_add_unique_key_to_my_classes_table.php +++ b/database/migrations/2022_09_06_172335_add_unique_key_to_my_classes_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::table('my_classes', static function (Blueprint $table) { diff --git a/database/migrations/2022_09_26_202726_create_academic_year_student_record_table.php b/database/migrations/2022_09_26_202726_create_academic_year_student_record_table.php index 43994a87..fe1003e1 100755 --- a/database/migrations/2022_09_26_202726_create_academic_year_student_record_table.php +++ b/database/migrations/2022_09_26_202726_create_academic_year_student_record_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('academic_year_student_record', static function (Blueprint $table) { diff --git a/database/migrations/2022_11_03_043455_create_account_applications_table.php b/database/migrations/2022_11_03_043455_create_account_applications_table.php index 4323527b..cbc2813d 100644 --- a/database/migrations/2022_11_03_043455_create_account_applications_table.php +++ b/database/migrations/2022_11_03_043455_create_account_applications_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('account_applications', static function (Blueprint $table) { diff --git a/database/migrations/2022_12_22_171618_create_custom_timetable_items_table.php b/database/migrations/2022_12_22_171618_create_custom_timetable_items_table.php index 281bf920..6069353f 100644 --- a/database/migrations/2022_12_22_171618_create_custom_timetable_items_table.php +++ b/database/migrations/2022_12_22_171618_create_custom_timetable_items_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::create('custom_timetable_items', static function (Blueprint $table) { diff --git a/database/migrations/2022_12_22_205601_add_polymorphic_fields_to_timetable_time_slot_weekday_table.php b/database/migrations/2022_12_22_205601_add_polymorphic_fields_to_timetable_time_slot_weekday_table.php index 66ab8eea..803a7c44 100644 --- a/database/migrations/2022_12_22_205601_add_polymorphic_fields_to_timetable_time_slot_weekday_table.php +++ b/database/migrations/2022_12_22_205601_add_polymorphic_fields_to_timetable_time_slot_weekday_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::table('timetable_time_slot_weekday', static function (Blueprint $table) { diff --git a/database/migrations/2023_01_09_171340_make_description_nullable_on_sylabii_table.php b/database/migrations/2023_01_09_171340_make_description_nullable_on_sylabii_table.php index 80c315b5..65cce817 100644 --- a/database/migrations/2023_01_09_171340_make_description_nullable_on_sylabii_table.php +++ b/database/migrations/2023_01_09_171340_make_description_nullable_on_sylabii_table.php @@ -3,8 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema; -return new class() extends Migration -{ +return new class() extends Migration { public function up(): void { Schema::table('syllabi', function ($table) { diff --git a/database/seeders/AcademicYearSeeder.php b/database/seeders/AcademicYearSeeder.php index 907e822f..3fa15905 100755 --- a/database/seeders/AcademicYearSeeder.php +++ b/database/seeders/AcademicYearSeeder.php @@ -18,9 +18,9 @@ public function run() 'id' => 1, ], [ - 'school_id' => 1, + 'school_id' => 1, 'start_year' => date('Y'), - 'stop_year' => date('Y') + 1, + 'stop_year' => date('Y') + 1, ]); $academicYear->school->academic_year_id = $academicYear->id; $academicYear->school->save(); diff --git a/database/seeders/ClassGroupSeeder.php b/database/seeders/ClassGroupSeeder.php index fb80cee5..3ba21243 100755 --- a/database/seeders/ClassGroupSeeder.php +++ b/database/seeders/ClassGroupSeeder.php @@ -15,23 +15,23 @@ class ClassGroupSeeder extends Seeder public function run() { ClassGroup::firstOrcreate([ - 'id' => 1, - 'name' => 'Kindergarten', + 'id' => 1, + 'name' => 'Kindergarten', 'school_id' => 1, ]); ClassGroup::firstOrcreate([ - 'id' => 2, - 'name' => 'Nursery', + 'id' => 2, + 'name' => 'Nursery', 'school_id' => 1, ]); ClassGroup::firstOrcreate([ - 'id' => 3, - 'name' => 'Primary', + 'id' => 3, + 'name' => 'Primary', 'school_id' => 1, ]); ClassGroup::firstOrcreate([ - 'id' => 4, - 'name' => 'Secondary', + 'id' => 4, + 'name' => 'Secondary', 'school_id' => 1, ]); ClassGroup::factory()->times(4)->create(); diff --git a/database/seeders/ExamSeeder.php b/database/seeders/ExamSeeder.php index a4f119b2..cd714ea0 100755 --- a/database/seeders/ExamSeeder.php +++ b/database/seeders/ExamSeeder.php @@ -15,12 +15,12 @@ class ExamSeeder extends Seeder public function run() { Exam::firstOrCreate([ - 'id' => 1, - 'name' => 'Exam 1', + 'id' => 1, + 'name' => 'Exam 1', 'description' => 'Exam 1 description', 'semester_id' => '1', - 'start_date' => '2020-01-01', - 'stop_date' => '2020-01-31', + 'start_date' => '2020-01-01', + 'stop_date' => '2020-01-31', ]); Exam::factory()->count(10)->create(); diff --git a/database/seeders/ExamSlotSeeder.php b/database/seeders/ExamSlotSeeder.php index 36bd7159..f6a64da1 100755 --- a/database/seeders/ExamSlotSeeder.php +++ b/database/seeders/ExamSlotSeeder.php @@ -15,10 +15,10 @@ class ExamSlotSeeder extends Seeder public function run() { ExamSlot::firstOrCreate([ - 'name' => 'Objective', + 'name' => 'Objective', 'description' => 'written last week', 'total_marks' => 40, - 'exam_id' => 1, + 'exam_id' => 1, ]); ExamSlot::factory()->count(10)->create(); diff --git a/database/seeders/GradeSystemSeeder.php b/database/seeders/GradeSystemSeeder.php index 20b190c4..0df409e6 100755 --- a/database/seeders/GradeSystemSeeder.php +++ b/database/seeders/GradeSystemSeeder.php @@ -15,65 +15,65 @@ class GradeSystemSeeder extends Seeder public function run() { GradeSystem::firstOrCreate([ - 'id' => 1, - 'name' => 'A+', - 'remark' => 'Excellent', - 'grade_from' => '90', - 'grade_till' => '100', + 'id' => 1, + 'name' => 'A+', + 'remark' => 'Excellent', + 'grade_from' => '90', + 'grade_till' => '100', 'class_group_id' => 1, ]); GradeSystem::firstOrCreate([ - 'id' => 2, - 'name' => 'A', - 'remark' => 'Very Good', - 'grade_from' => '80', - 'grade_till' => '89', + 'id' => 2, + 'name' => 'A', + 'remark' => 'Very Good', + 'grade_from' => '80', + 'grade_till' => '89', 'class_group_id' => 1, ]); GradeSystem::firstOrCreate([ - 'id' => 3, - 'name' => 'B+', - 'remark' => 'Good', - 'grade_from' => '70', - 'grade_till' => '79', + 'id' => 3, + 'name' => 'B+', + 'remark' => 'Good', + 'grade_from' => '70', + 'grade_till' => '79', 'class_group_id' => 1, ]); GradeSystem::firstOrCreate([ - 'id' => 4, - 'name' => 'B', - 'remark' => 'Satisfactory', - 'grade_from' => '60', - 'grade_till' => '69', + 'id' => 4, + 'name' => 'B', + 'remark' => 'Satisfactory', + 'grade_from' => '60', + 'grade_till' => '69', 'class_group_id' => 1, ]); GradeSystem::firstOrCreate([ - 'id' => 5, - 'name' => 'C+', - 'remark' => 'Fair', - 'grade_from' => '50', - 'grade_till' => '59', + 'id' => 5, + 'name' => 'C+', + 'remark' => 'Fair', + 'grade_from' => '50', + 'grade_till' => '59', 'class_group_id' => 1, ]); GradeSystem::firstOrCreate([ - 'id' => 6, - 'name' => 'C', - 'remark' => 'Pass', - 'grade_from' => '40', - 'grade_till' => '49', + 'id' => 6, + 'name' => 'C', + 'remark' => 'Pass', + 'grade_from' => '40', + 'grade_till' => '49', 'class_group_id' => 1, ]); GradeSystem::firstOrCreate([ - 'id' => 7, - 'name' => 'D', - 'remark' => 'Fail', - 'grade_from' => '20', - 'grade_till' => '39', + 'id' => 7, + 'name' => 'D', + 'remark' => 'Fail', + 'grade_from' => '20', + 'grade_till' => '39', 'class_group_id' => 1, ]); } diff --git a/database/seeders/MyClassSeeder.php b/database/seeders/MyClassSeeder.php index 16dfa27a..9622c987 100755 --- a/database/seeders/MyClassSeeder.php +++ b/database/seeders/MyClassSeeder.php @@ -15,38 +15,38 @@ class MyClassSeeder extends Seeder public function run() { MyClass::firstOrcreate([ - 'id' => 1, - 'name' => 'Kindergarten 1', + 'id' => 1, + 'name' => 'Kindergarten 1', 'class_group_id' => 1, ]); MyClass::firstOrcreate([ - 'id' => 2, - 'name' => 'Kindergarten 2', + 'id' => 2, + 'name' => 'Kindergarten 2', 'class_group_id' => 1, ]); MyClass::firstOrcreate([ - 'id' => 3, - 'name' => 'Nursery 1', + 'id' => 3, + 'name' => 'Nursery 1', 'class_group_id' => 2, ]); MyClass::firstOrcreate([ - 'id' => 4, - 'name' => 'Nursery 2', + 'id' => 4, + 'name' => 'Nursery 2', 'class_group_id' => 2, ]); MyClass::firstOrcreate([ - 'id' => 5, - 'name' => 'Primary 1', + 'id' => 5, + 'name' => 'Primary 1', 'class_group_id' => 3, ]); MyClass::firstOrcreate([ - 'id' => 7, - 'name' => 'Primary 2', + 'id' => 7, + 'name' => 'Primary 2', 'class_group_id' => 4, ]); } diff --git a/database/seeders/SchoolSeeder.php b/database/seeders/SchoolSeeder.php index 39fefe8f..0e9bee06 100755 --- a/database/seeders/SchoolSeeder.php +++ b/database/seeders/SchoolSeeder.php @@ -18,9 +18,9 @@ public function run() School::updateOrCreate( ['id' => 1], [ - 'name' => 'Default School', - 'address' => 'School of Computing', - 'code' => Str::Random(10), + 'name' => 'Default School', + 'address' => 'School of Computing', + 'code' => Str::Random(10), 'initials' => 'DSI', ] ); diff --git a/database/seeders/SectionSeeder.php b/database/seeders/SectionSeeder.php index 12813a53..4a1d7650 100755 --- a/database/seeders/SectionSeeder.php +++ b/database/seeders/SectionSeeder.php @@ -15,14 +15,14 @@ class SectionSeeder extends Seeder public function run() { Section::firstOrCreate([ - 'id' => 1, - 'name' => 'Gold', + 'id' => 1, + 'name' => 'Gold', 'my_class_id' => 1, ]); Section::firstOrCreate([ - 'id' => 2, - 'name' => 'Ruby', + 'id' => 2, + 'name' => 'Ruby', 'my_class_id' => 1, ]); } diff --git a/database/seeders/SemesterSeeder.php b/database/seeders/SemesterSeeder.php index 7663e4be..e7c46bb8 100755 --- a/database/seeders/SemesterSeeder.php +++ b/database/seeders/SemesterSeeder.php @@ -15,10 +15,10 @@ class SemesterSeeder extends Seeder public function run() { $semester = Semester::firstOrCreate([ - 'id' => 1, ], [ - 'name' => 'Semester 1', + 'id' => 1, ], [ + 'name' => 'Semester 1', 'academic_year_id' => 1, - 'school_id' => 1, + 'school_id' => 1, ]); $semester->school->semester_id = $semester->id; $semester->school->save(); diff --git a/database/seeders/SubjectSeeder.php b/database/seeders/SubjectSeeder.php index 4fd7d9bc..1af7b724 100755 --- a/database/seeders/SubjectSeeder.php +++ b/database/seeders/SubjectSeeder.php @@ -17,17 +17,17 @@ public function run() Subject::firstOrCreate([ 'id' => 1, ], [ - 'name' => 'Maths', - 'short_name' => 'mat', + 'name' => 'Maths', + 'short_name' => 'mat', 'my_class_id' => 1, - 'school_id' => 1, + 'school_id' => 1, ]); Subject::firstOrCreate([ - 'name' => 'English', - 'short_name' => 'eng', + 'name' => 'English', + 'short_name' => 'eng', 'my_class_id' => 2, - 'school_id' => 1, + 'school_id' => 1, ]); } } diff --git a/database/seeders/TimetableSeeder.php b/database/seeders/TimetableSeeder.php index a9266594..46fd7fec 100755 --- a/database/seeders/TimetableSeeder.php +++ b/database/seeders/TimetableSeeder.php @@ -17,7 +17,7 @@ public function run() Timetable::firstOrCreate([ 'id' => 1, ], [ - 'name' => 'Timetable 1', + 'name' => 'Timetable 1', 'description' => 'Timetable 1 description', 'my_class_id' => 1, 'semester_id' => 1, diff --git a/database/seeders/UserSeeder.php b/database/seeders/UserSeeder.php index 6b828013..c9448039 100755 --- a/database/seeders/UserSeeder.php +++ b/database/seeders/UserSeeder.php @@ -20,57 +20,57 @@ public function run() DB::table('users')->delete(); $superAdmin = User::firstOrCreate([ - 'id' => 1, - 'name' => 'John Doe', - 'email' => 'super@admin.com', - 'password' => Hash::make('password'), - 'school_id' => 1, - 'address' => 'super admin street', - 'birthday' => '22/04/04', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'B+', + 'id' => 1, + 'name' => 'John Doe', + 'email' => 'super@admin.com', + 'password' => Hash::make('password'), + 'school_id' => 1, + 'address' => 'super admin street', + 'birthday' => '22/04/04', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'B+', 'email_verified_at' => now(), - 'gender' => 'male', + 'gender' => 'male', ]); $superAdmin->assignRole('super-admin'); $superAdmin->save(); $admin = User::firstOrCreate([ - 'id' => 2, - 'name' => 'Jane Doe', - 'email' => 'admin@admin.com', - 'password' => Hash::make('password'), - 'school_id' => 1, - 'address' => 'admin street', - 'birthday' => '22/04/04', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'B+', + 'id' => 2, + 'name' => 'Jane Doe', + 'email' => 'admin@admin.com', + 'password' => Hash::make('password'), + 'school_id' => 1, + 'address' => 'admin street', + 'birthday' => '22/04/04', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'B+', 'email_verified_at' => now(), - 'gender' => 'male', + 'gender' => 'male', ]); $admin->assignRole('admin'); $teacher = User::create([ - 'id' => 3, - 'name' => 'John Doe', - 'email' => 'teacher@teacher.com', - 'password' => Hash::make('password'), - 'school_id' => 1, - 'address' => 'teacher street', - 'birthday' => '22/04/04', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'B+', + 'id' => 3, + 'name' => 'John Doe', + 'email' => 'teacher@teacher.com', + 'password' => Hash::make('password'), + 'school_id' => 1, + 'address' => 'teacher street', + 'birthday' => '22/04/04', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'B+', 'email_verified_at' => now(), - 'gender' => 'male', + 'gender' => 'male', ]); @@ -81,44 +81,44 @@ public function run() ]); $student = User::create([ - 'id' => 4, - 'name' => 'Jane Doe', - 'email' => 'student@student.com', - 'password' => Hash::make('password'), - 'school_id' => 1, - 'address' => 'student street', - 'birthday' => '22/04/04', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'B+', + 'id' => 4, + 'name' => 'Jane Doe', + 'email' => 'student@student.com', + 'password' => Hash::make('password'), + 'school_id' => 1, + 'address' => 'student street', + 'birthday' => '22/04/04', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'B+', 'email_verified_at' => now(), - 'gender' => 'male', + 'gender' => 'male', ]); $student->studentRecord()->create([ - 'my_class_id' => 1, - 'section_id' => 1, - 'admission_date' => '22/04/04', - 'is_graduated' => false, + 'my_class_id' => 1, + 'section_id' => 1, + 'admission_date' => '22/04/04', + 'is_graduated' => false, 'admission_number' => Str::random(10), ]); $student->assignRole('student'); $parent = User::create([ - 'name' => 'John Doe', - 'email' => 'parent@parent.com', - 'password' => Hash::make('password'), - 'school_id' => 1, - 'address' => 'parent street', - 'birthday' => '22/04/04', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'B+', + 'name' => 'John Doe', + 'email' => 'parent@parent.com', + 'password' => Hash::make('password'), + 'school_id' => 1, + 'address' => 'parent street', + 'birthday' => '22/04/04', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'B+', 'email_verified_at' => now(), - 'gender' => 'male', + 'gender' => 'male', ]); @@ -127,36 +127,36 @@ public function run() $parent->parentRecord()->create(); $accountant = User::create([ - 'name' => 'Jane Doe', - 'email' => 'accountant@accountant.com', - 'password' => Hash::make('password'), - 'school_id' => 1, - 'address' => 'accountant street', - 'birthday' => '22/04/04', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'B+', + 'name' => 'Jane Doe', + 'email' => 'accountant@accountant.com', + 'password' => Hash::make('password'), + 'school_id' => 1, + 'address' => 'accountant street', + 'birthday' => '22/04/04', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'B+', 'email_verified_at' => now(), - 'gender' => 'male', + 'gender' => 'male', ]); $accountant->assignRole('accountant'); $librarian = User::create([ - 'name' => 'John Doe', - 'email' => 'libratian@librarian.com', - 'password' => Hash::make('password'), - 'school_id' => 1, - 'address' => 'librarian street', - 'birthday' => '22/04/04', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'B+', + 'name' => 'John Doe', + 'email' => 'libratian@librarian.com', + 'password' => Hash::make('password'), + 'school_id' => 1, + 'address' => 'librarian street', + 'birthday' => '22/04/04', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'B+', 'email_verified_at' => now(), - 'gender' => 'male', + 'gender' => 'male', ]); diff --git a/lang/en/auth.php b/lang/en/auth.php index 6598e2c0..24e063b5 100755 --- a/lang/en/auth.php +++ b/lang/en/auth.php @@ -13,7 +13,7 @@ | */ - 'failed' => 'These credentials do not match our records.', + 'failed' => 'These credentials do not match our records.', 'password' => 'The provided password is incorrect.', 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', diff --git a/lang/en/pagination.php b/lang/en/pagination.php index d4814118..fcab34b2 100755 --- a/lang/en/pagination.php +++ b/lang/en/pagination.php @@ -14,6 +14,6 @@ */ 'previous' => '« Previous', - 'next' => 'Next »', + 'next' => 'Next »', ]; diff --git a/lang/en/passwords.php b/lang/en/passwords.php index 2345a56b..526795fb 100755 --- a/lang/en/passwords.php +++ b/lang/en/passwords.php @@ -13,10 +13,10 @@ | */ - 'reset' => 'Your password has been reset!', - 'sent' => 'We have emailed your password reset link!', + 'reset' => 'Your password has been reset!', + 'sent' => 'We have emailed your password reset link!', 'throttled' => 'Please wait before retrying.', - 'token' => 'This password reset token is invalid.', - 'user' => "We can't find a user with that email address.", + 'token' => 'This password reset token is invalid.', + 'user' => "We can't find a user with that email address.", ]; diff --git a/lang/en/validation.php b/lang/en/validation.php index 9fab4d92..fb9d2415 100755 --- a/lang/en/validation.php +++ b/lang/en/validation.php @@ -13,117 +13,117 @@ | */ - 'accepted' => 'The :attribute must be accepted.', - 'accepted_if' => 'The :attribute must be accepted when :other is :value.', - 'active_url' => 'The :attribute is not a valid URL.', - 'after' => 'The :attribute must be a date after :date.', - 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', - 'alpha' => 'The :attribute must only contain letters.', - 'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.', - 'alpha_num' => 'The :attribute must only contain letters and numbers.', - 'array' => 'The :attribute must be an array.', - 'before' => 'The :attribute must be a date before :date.', + 'accepted' => 'The :attribute must be accepted.', + 'accepted_if' => 'The :attribute must be accepted when :other is :value.', + 'active_url' => 'The :attribute is not a valid URL.', + 'after' => 'The :attribute must be a date after :date.', + 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', + 'alpha' => 'The :attribute must only contain letters.', + 'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.', + 'alpha_num' => 'The :attribute must only contain letters and numbers.', + 'array' => 'The :attribute must be an array.', + 'before' => 'The :attribute must be a date before :date.', 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', - 'between' => [ + 'between' => [ 'numeric' => 'The :attribute must be between :min and :max.', - 'file' => 'The :attribute must be between :min and :max kilobytes.', - 'string' => 'The :attribute must be between :min and :max characters.', - 'array' => 'The :attribute must have between :min and :max items.', + 'file' => 'The :attribute must be between :min and :max kilobytes.', + 'string' => 'The :attribute must be between :min and :max characters.', + 'array' => 'The :attribute must have between :min and :max items.', ], - 'boolean' => 'The :attribute field must be true or false.', - 'confirmed' => 'The :attribute confirmation does not match.', + 'boolean' => 'The :attribute field must be true or false.', + 'confirmed' => 'The :attribute confirmation does not match.', 'current_password' => 'The password is incorrect.', - 'date' => 'The :attribute is not a valid date.', - 'date_equals' => 'The :attribute must be a date equal to :date.', - 'date_format' => 'The :attribute does not match the format :format.', - 'different' => 'The :attribute and :other must be different.', - 'digits' => 'The :attribute must be :digits digits.', - 'digits_between' => 'The :attribute must be between :min and :max digits.', - 'dimensions' => 'The :attribute has invalid image dimensions.', - 'distinct' => 'The :attribute field has a duplicate value.', - 'email' => 'The :attribute must be a valid email address.', - 'ends_with' => 'The :attribute must end with one of the following: :values.', - 'exists' => 'The selected :attribute is invalid.', - 'file' => 'The :attribute must be a file.', - 'filled' => 'The :attribute field must have a value.', - 'gt' => [ + 'date' => 'The :attribute is not a valid date.', + 'date_equals' => 'The :attribute must be a date equal to :date.', + 'date_format' => 'The :attribute does not match the format :format.', + 'different' => 'The :attribute and :other must be different.', + 'digits' => 'The :attribute must be :digits digits.', + 'digits_between' => 'The :attribute must be between :min and :max digits.', + 'dimensions' => 'The :attribute has invalid image dimensions.', + 'distinct' => 'The :attribute field has a duplicate value.', + 'email' => 'The :attribute must be a valid email address.', + 'ends_with' => 'The :attribute must end with one of the following: :values.', + 'exists' => 'The selected :attribute is invalid.', + 'file' => 'The :attribute must be a file.', + 'filled' => 'The :attribute field must have a value.', + 'gt' => [ 'numeric' => 'The :attribute must be greater than :value.', - 'file' => 'The :attribute must be greater than :value kilobytes.', - 'string' => 'The :attribute must be greater than :value characters.', - 'array' => 'The :attribute must have more than :value items.', + 'file' => 'The :attribute must be greater than :value kilobytes.', + 'string' => 'The :attribute must be greater than :value characters.', + 'array' => 'The :attribute must have more than :value items.', ], 'gte' => [ 'numeric' => 'The :attribute must be greater than or equal to :value.', - 'file' => 'The :attribute must be greater than or equal to :value kilobytes.', - 'string' => 'The :attribute must be greater than or equal to :value characters.', - 'array' => 'The :attribute must have :value items or more.', + 'file' => 'The :attribute must be greater than or equal to :value kilobytes.', + 'string' => 'The :attribute must be greater than or equal to :value characters.', + 'array' => 'The :attribute must have :value items or more.', ], - 'image' => 'The :attribute must be an image.', - 'in' => 'The selected :attribute is invalid.', + 'image' => 'The :attribute must be an image.', + 'in' => 'The selected :attribute is invalid.', 'in_array' => 'The :attribute field does not exist in :other.', - 'integer' => 'The :attribute must be an integer.', - 'ip' => 'The :attribute must be a valid IP address.', - 'ipv4' => 'The :attribute must be a valid IPv4 address.', - 'ipv6' => 'The :attribute must be a valid IPv6 address.', - 'json' => 'The :attribute must be a valid JSON string.', - 'lt' => [ + 'integer' => 'The :attribute must be an integer.', + 'ip' => 'The :attribute must be a valid IP address.', + 'ipv4' => 'The :attribute must be a valid IPv4 address.', + 'ipv6' => 'The :attribute must be a valid IPv6 address.', + 'json' => 'The :attribute must be a valid JSON string.', + 'lt' => [ 'numeric' => 'The :attribute must be less than :value.', - 'file' => 'The :attribute must be less than :value kilobytes.', - 'string' => 'The :attribute must be less than :value characters.', - 'array' => 'The :attribute must have less than :value items.', + 'file' => 'The :attribute must be less than :value kilobytes.', + 'string' => 'The :attribute must be less than :value characters.', + 'array' => 'The :attribute must have less than :value items.', ], 'lte' => [ 'numeric' => 'The :attribute must be less than or equal to :value.', - 'file' => 'The :attribute must be less than or equal to :value kilobytes.', - 'string' => 'The :attribute must be less than or equal to :value characters.', - 'array' => 'The :attribute must not have more than :value items.', + 'file' => 'The :attribute must be less than or equal to :value kilobytes.', + 'string' => 'The :attribute must be less than or equal to :value characters.', + 'array' => 'The :attribute must not have more than :value items.', ], 'max' => [ 'numeric' => 'The :attribute must not be greater than :max.', - 'file' => 'The :attribute must not be greater than :max kilobytes.', - 'string' => 'The :attribute must not be greater than :max characters.', - 'array' => 'The :attribute must not have more than :max items.', + 'file' => 'The :attribute must not be greater than :max kilobytes.', + 'string' => 'The :attribute must not be greater than :max characters.', + 'array' => 'The :attribute must not have more than :max items.', ], - 'mimes' => 'The :attribute must be a file of type: :values.', + 'mimes' => 'The :attribute must be a file of type: :values.', 'mimetypes' => 'The :attribute must be a file of type: :values.', - 'min' => [ + 'min' => [ 'numeric' => 'The :attribute must be at least :min.', - 'file' => 'The :attribute must be at least :min kilobytes.', - 'string' => 'The :attribute must be at least :min characters.', - 'array' => 'The :attribute must have at least :min items.', + 'file' => 'The :attribute must be at least :min kilobytes.', + 'string' => 'The :attribute must be at least :min characters.', + 'array' => 'The :attribute must have at least :min items.', ], - 'multiple_of' => 'The :attribute must be a multiple of :value.', - 'not_in' => 'The selected :attribute is invalid.', - 'not_regex' => 'The :attribute format is invalid.', - 'numeric' => 'The :attribute must be a number.', - 'password' => 'The password is incorrect.', - 'present' => 'The :attribute field must be present.', - 'regex' => 'The :attribute format is invalid.', - 'required' => 'The :attribute field is required.', - 'required_if' => 'The :attribute field is required when :other is :value.', - 'required_unless' => 'The :attribute field is required unless :other is in :values.', - 'required_with' => 'The :attribute field is required when :values is present.', - 'required_with_all' => 'The :attribute field is required when :values are present.', - 'required_without' => 'The :attribute field is required when :values is not present.', + 'multiple_of' => 'The :attribute must be a multiple of :value.', + 'not_in' => 'The selected :attribute is invalid.', + 'not_regex' => 'The :attribute format is invalid.', + 'numeric' => 'The :attribute must be a number.', + 'password' => 'The password is incorrect.', + 'present' => 'The :attribute field must be present.', + 'regex' => 'The :attribute format is invalid.', + 'required' => 'The :attribute field is required.', + 'required_if' => 'The :attribute field is required when :other is :value.', + 'required_unless' => 'The :attribute field is required unless :other is in :values.', + 'required_with' => 'The :attribute field is required when :values is present.', + 'required_with_all' => 'The :attribute field is required when :values are present.', + 'required_without' => 'The :attribute field is required when :values is not present.', 'required_without_all' => 'The :attribute field is required when none of :values are present.', - 'prohibited' => 'The :attribute field is prohibited.', - 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.', - 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.', - 'prohibits' => 'The :attribute field prohibits :other from being present.', - 'same' => 'The :attribute and :other must match.', - 'size' => [ + 'prohibited' => 'The :attribute field is prohibited.', + 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.', + 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.', + 'prohibits' => 'The :attribute field prohibits :other from being present.', + 'same' => 'The :attribute and :other must match.', + 'size' => [ 'numeric' => 'The :attribute must be :size.', - 'file' => 'The :attribute must be :size kilobytes.', - 'string' => 'The :attribute must be :size characters.', - 'array' => 'The :attribute must contain :size items.', + 'file' => 'The :attribute must be :size kilobytes.', + 'string' => 'The :attribute must be :size characters.', + 'array' => 'The :attribute must contain :size items.', ], 'starts_with' => 'The :attribute must start with one of the following: :values.', - 'string' => 'The :attribute must be a string.', - 'timezone' => 'The :attribute must be a valid timezone.', - 'unique' => 'The :attribute has already been taken.', - 'uploaded' => 'The :attribute failed to upload.', - 'url' => 'The :attribute must be a valid URL.', - 'uuid' => 'The :attribute must be a valid UUID.', + 'string' => 'The :attribute must be a string.', + 'timezone' => 'The :attribute must be a valid timezone.', + 'unique' => 'The :attribute has already been taken.', + 'uploaded' => 'The :attribute failed to upload.', + 'url' => 'The :attribute must be a valid URL.', + 'uuid' => 'The :attribute must be a valid UUID.', /* |-------------------------------------------------------------------------- diff --git a/tests/Feature/AcademicYearTest.php b/tests/Feature/AcademicYearTest.php index 6a2a9066..5df77198 100755 --- a/tests/Feature/AcademicYearTest.php +++ b/tests/Feature/AcademicYearTest.php @@ -57,12 +57,12 @@ public function test_user_can_create_academic_year() $this->authorized_user(['create academic year']) ->post('/dashboard/academic-years', [ 'start_year' => '3030', - 'stop_year' => '4040', + 'stop_year' => '4040', ])->assertRedirect(); $this->assertDatabaseHas('academic_years', [ 'start_year' => '3030', - 'stop_year' => '4040', + 'stop_year' => '4040', ]); } @@ -96,13 +96,13 @@ public function test_authorized_user_can_update_academic_year() $this->authorized_user(['update academic year']) ->put('/dashboard/academic-years/1', [ 'start_year' => '3030', - 'stop_year' => '4040', + 'stop_year' => '4040', ]); $this->assertDatabaseHas('academic_years', [ - 'id' => '1', + 'id' => '1', 'start_year' => '3030', - 'stop_year' => '4040', + 'stop_year' => '4040', ]); } @@ -145,7 +145,7 @@ public function test_authorized_user_can_set_academic_year() ]); $school_id = auth()->user()->school_id; $this->assertDatabaseHas('schools', [ - 'id' => $school_id, + 'id' => $school_id, 'academic_year_id' => $academicYear->id, ]); } diff --git a/tests/Feature/AdminTest.php b/tests/Feature/AdminTest.php index 8bf51286..cd31765c 100644 --- a/tests/Feature/AdminTest.php +++ b/tests/Feature/AdminTest.php @@ -38,23 +38,23 @@ public function test_unauthorised_users_cannot_create_admins() { $email = $this->faker()->freeEmail(); $this->unauthorized_user()->post('dashboard/admins', [ - 'first_name' => 'Test', - 'last_name' => 'admin', - 'other_name' => 'cody', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test', + 'last_name' => 'admin', + 'other_name' => 'cody', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', - 'my_class_id' => 1, - 'section_id' => 1, - 'admission_date' => '2004/04/22', + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', + 'my_class_id' => 1, + 'section_id' => 1, + 'admission_date' => '2004/04/22', ])->assertForbidden(); $this->assertDatabaseMissing('users', [ @@ -67,30 +67,30 @@ public function test_authorized_user_can_create_admin() $email = $this->faker()->freeEmail(); $this->authorized_user(['create admin'])->post('dashboard/admins', [ - 'first_name' => 'Test', - 'last_name' => 'admin', - 'other_name' => 'cody', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test', + 'last_name' => 'admin', + 'other_name' => 'cody', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', - 'my_class_id' => 1, - 'section_id' => 1, - 'admission_date' => '2004/04/22', + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', + 'my_class_id' => 1, + 'section_id' => 1, + 'admission_date' => '2004/04/22', ])->assertRedirect(); $this->assertDatabaseHas('users', [ - 'email' => $email, - 'address' => 'test address', + 'email' => $email, + 'address' => 'test address', 'birthday' => '2004/04/22', - 'phone' => '08080808080', + 'phone' => '08080808080', ]); } @@ -116,22 +116,22 @@ public function test_unauthorised_users_cannot_update_admins() $admin->assignRole('admin'); $this->unauthorized_user()->put('dashboard/admins/'.$admin->id, [ - 'first_name' => 'Test', - 'last_name' => 'admin 2', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test', + 'last_name' => 'admin 2', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', - 'my_class_id' => 1, - 'section_id' => 1, - 'admission_date' => '2004/04/22', + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', + 'my_class_id' => 1, + 'section_id' => 1, + 'admission_date' => '2004/04/22', ])->assertForbidden(); $this->assertDatabaseMissing('users', [ @@ -146,20 +146,20 @@ public function test_authorised_users_can_update_admins() $email = $this->faker()->freeEmail(); $this->authorized_user(['update admin'])->put('dashboard/admins/'.$admin->id, [ - 'first_name' => 'Test 2', - 'other_names' => 'admin 2', - 'last_name' => 'admin', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test 2', + 'other_names' => 'admin 2', + 'last_name' => 'admin', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', ])->assertRedirect(); $this->assertDatabaseHas('users', [ diff --git a/tests/Feature/ApiTokenPermissionsTest.php b/tests/Feature/ApiTokenPermissionsTest.php index 829b4225..31fdb120 100755 --- a/tests/Feature/ApiTokenPermissionsTest.php +++ b/tests/Feature/ApiTokenPermissionsTest.php @@ -16,7 +16,7 @@ class ApiTokenPermissionsTest extends TestCase public function test_api_token_permissions_can_be_updated() { - if (! Features::hasApiFeatures()) { + if (!Features::hasApiFeatures()) { return $this->markTestSkipped('API support is not enabled.'); } @@ -27,8 +27,8 @@ public function test_api_token_permissions_can_be_updated() } $token = $user->tokens()->create([ - 'name' => 'Test Token', - 'token' => Str::random(40), + 'name' => 'Test Token', + 'token' => Str::random(40), 'abilities' => ['create', 'read'], ]); diff --git a/tests/Feature/AuthenticationTest.php b/tests/Feature/AuthenticationTest.php index e04e9e09..e3bc1fba 100755 --- a/tests/Feature/AuthenticationTest.php +++ b/tests/Feature/AuthenticationTest.php @@ -27,7 +27,7 @@ public function test_users_can_authenticate_using_the_login_screen() $user->save(); $response = $this->post('/login', [ - 'email' => $user->email, + 'email' => $user->email, 'password' => 'password', ]); @@ -40,7 +40,7 @@ public function test_users_can_not_authenticate_with_invalid_password() $user = User::factory()->create(); $this->post('/login', [ - 'email' => $user->email, + 'email' => $user->email, 'password' => 'wrong-password', ]); diff --git a/tests/Feature/ClassGroupTest.php b/tests/Feature/ClassGroupTest.php index b32b7ad4..7c8089be 100755 --- a/tests/Feature/ClassGroupTest.php +++ b/tests/Feature/ClassGroupTest.php @@ -46,7 +46,7 @@ public function test_authorized_user_can_create_class_group() ->post('/dashboard/class-groups', ['name' => 'test class group']); $this->assertDatabaseHas('class_groups', [ - 'name' => 'test class group', + 'name' => 'test class group', 'school_id' => 1, ]); } @@ -81,8 +81,8 @@ public function test_authorized_user_can_edit_class_group() ->put("/dashboard/class-groups/$classGroup->id", ['name' => 'test class group']); $this->assertDatabaseHas('class_groups', [ - 'id' => $classGroup->id, - 'name' => 'test class group', + 'id' => $classGroup->id, + 'name' => 'test class group', 'school_id' => 1, ]); } diff --git a/tests/Feature/ClassTest.php b/tests/Feature/ClassTest.php index ae0abc10..8e633533 100755 --- a/tests/Feature/ClassTest.php +++ b/tests/Feature/ClassTest.php @@ -60,7 +60,7 @@ public function test_authorized_user_can_create_class() ->post('/dashboard/classes', ['name' => 'Test class', 'class_group_id' => '1']); $this->assertDatabaseHas('my_classes', [ - 'name' => 'Test class', + 'name' => 'Test class', 'class_group_id' => '1', ]); } @@ -79,8 +79,8 @@ public function test_authorized_user_can_edit_class() ->put("/dashboard/classes/$class->id", ['name' => 'Test class', 'class_group_id' => '1']); $this->assertDatabaseHas('my_classes', [ - 'id' => $class->id, - 'name' => 'Test class', + 'id' => $class->id, + 'name' => 'Test class', 'class_group_id' => '1', ]); } diff --git a/tests/Feature/CreateApiTokenTest.php b/tests/Feature/CreateApiTokenTest.php index e0834fa3..f41f9c43 100755 --- a/tests/Feature/CreateApiTokenTest.php +++ b/tests/Feature/CreateApiTokenTest.php @@ -15,7 +15,7 @@ class CreateApiTokenTest extends TestCase public function test_api_tokens_can_be_created() { - if (! Features::hasApiFeatures()) { + if (!Features::hasApiFeatures()) { return $this->markTestSkipped('API support is not enabled.'); } @@ -27,7 +27,7 @@ public function test_api_tokens_can_be_created() Livewire::test(ApiTokenManager::class) ->set(['createApiTokenForm' => [ - 'name' => 'Test Token', + 'name' => 'Test Token', 'permissions' => [ 'read', 'update', diff --git a/tests/Feature/CustomTimetableItemTest.php b/tests/Feature/CustomTimetableItemTest.php index 5d81fc3e..23f65277 100644 --- a/tests/Feature/CustomTimetableItemTest.php +++ b/tests/Feature/CustomTimetableItemTest.php @@ -107,7 +107,7 @@ public function test_unauthorized_users_cannot_update_custom_items(): void $this->assertDatabaseMissing('custom_timetable_items', [ 'name' => $name, - 'id' => $customItem->id, + 'id' => $customItem->id, ]); } @@ -124,7 +124,7 @@ public function test_authorized_users_can_update_custom_items(): void $this->assertDatabaseHas('custom_timetable_items', [ 'name' => $name, - 'id' => $customItem->id, + 'id' => $customItem->id, ]); } diff --git a/tests/Feature/DeleteAccountTest.php b/tests/Feature/DeleteAccountTest.php index 7267957f..1c6b2769 100755 --- a/tests/Feature/DeleteAccountTest.php +++ b/tests/Feature/DeleteAccountTest.php @@ -15,7 +15,7 @@ class DeleteAccountTest extends TestCase public function test_user_accounts_can_be_deleted() { - if (! Features::hasAccountDeletionFeatures()) { + if (!Features::hasAccountDeletionFeatures()) { return $this->markTestSkipped('Account deletion is not enabled.'); } @@ -30,7 +30,7 @@ public function test_user_accounts_can_be_deleted() public function test_correct_password_must_be_provided_before_account_can_be_deleted() { - if (! Features::hasAccountDeletionFeatures()) { + if (!Features::hasAccountDeletionFeatures()) { return $this->markTestSkipped('Account deletion is not enabled.'); } diff --git a/tests/Feature/DeleteApiTokenTest.php b/tests/Feature/DeleteApiTokenTest.php index a8844c04..a19a84c8 100755 --- a/tests/Feature/DeleteApiTokenTest.php +++ b/tests/Feature/DeleteApiTokenTest.php @@ -16,7 +16,7 @@ class DeleteApiTokenTest extends TestCase public function test_api_tokens_can_be_deleted() { - if (! Features::hasApiFeatures()) { + if (!Features::hasApiFeatures()) { return $this->markTestSkipped('API support is not enabled.'); } @@ -27,8 +27,8 @@ public function test_api_tokens_can_be_deleted() } $token = $user->tokens()->create([ - 'name' => 'Test Token', - 'token' => Str::random(40), + 'name' => 'Test Token', + 'token' => Str::random(40), 'abilities' => ['create', 'read'], ]); diff --git a/tests/Feature/EmailVerificationTest.php b/tests/Feature/EmailVerificationTest.php index 0b4ce199..64889e31 100755 --- a/tests/Feature/EmailVerificationTest.php +++ b/tests/Feature/EmailVerificationTest.php @@ -17,7 +17,7 @@ class EmailVerificationTest extends TestCase public function test_email_verification_screen_can_be_rendered() { - if (! Features::enabled(Features::emailVerification())) { + if (!Features::enabled(Features::emailVerification())) { return $this->markTestSkipped('Email verification not enabled.'); } @@ -32,7 +32,7 @@ public function test_email_verification_screen_can_be_rendered() public function test_email_can_be_verified() { - if (! Features::enabled(Features::emailVerification())) { + if (!Features::enabled(Features::emailVerification())) { return $this->markTestSkipped('Email verification not enabled.'); } @@ -58,7 +58,7 @@ public function test_email_can_be_verified() public function test_email_can_not_verified_with_invalid_hash() { - if (! Features::enabled(Features::emailVerification())) { + if (!Features::enabled(Features::emailVerification())) { return $this->markTestSkipped('Email verification not enabled.'); } diff --git a/tests/Feature/ExamRecordTest.php b/tests/Feature/ExamRecordTest.php index 39ec4759..ccbd597f 100755 --- a/tests/Feature/ExamRecordTest.php +++ b/tests/Feature/ExamRecordTest.php @@ -44,24 +44,24 @@ public function test_authorized_user_can_create_exam_record() { $this->authorized_user(['create exam record']) ->post('/dashboard/exams/exam-records', [ - 'user_id' => 4, - 'section_id' => 1, - 'subject_id' => 1, + 'user_id' => 4, + 'section_id' => 1, + 'subject_id' => 1, 'exam_records' => [ 0 => [ - 'exam_slot_id' => 1, + 'exam_slot_id' => 1, 'student_marks' => 10, ], 1 => [ - 'exam_slot_id' => 10, + 'exam_slot_id' => 10, 'student_marks' => 20, ], ], ])->assertRedirect() && $this->assertDatabaseHas('exam_records', [ - 'user_id' => 4, - 'section_id' => 1, - 'subject_id' => 1, - 'exam_slot_id' => 1, + 'user_id' => 4, + 'section_id' => 1, + 'subject_id' => 1, + 'exam_slot_id' => 1, 'student_marks' => 10, ]); } diff --git a/tests/Feature/ExamSlotTest.php b/tests/Feature/ExamSlotTest.php index b95e2890..02a48ec7 100755 --- a/tests/Feature/ExamSlotTest.php +++ b/tests/Feature/ExamSlotTest.php @@ -62,13 +62,13 @@ public function test_authorized_user_can_create_exam_slot() { $response = $this->authorized_user(['create exam slot']) ->post('/dashboard/exams/1/manage/exam-slots', [ - 'name' => 'test exam slot', + 'name' => 'test exam slot', 'description' => 'test description', 'total_marks' => 20, ]); $this->assertDatabaseHas('exam_slots', [ - 'name' => 'test exam slot', + 'name' => 'test exam slot', 'description' => 'test description', 'total_marks' => 20, ]); @@ -104,8 +104,8 @@ public function test_unauthorized_user_cant_update_exam_slot() ->assertForbidden(); $this->assertDatabaseMissing('exam_slots', [ - 'id' => $examSlot->id, - 'name' => 'test exam slot', + 'id' => $examSlot->id, + 'name' => 'test exam slot', 'description' => 'test description', 'total_marks' => '10', ]); @@ -120,8 +120,8 @@ public function test_authorized_user_can_update_exam_slot() ->put("/dashboard/exams/1/manage/exam-slots/$examSlot->id", ['name' => 'test exam slot', 'description' => 'test description', 'total_marks' => '10']); $this->assertDatabaseHas('exam_slots', [ - 'id' => $examSlot->id, - 'name' => 'test exam slot', + 'id' => $examSlot->id, + 'name' => 'test exam slot', 'description' => 'test description', 'total_marks' => '10', ]); diff --git a/tests/Feature/ExamTest.php b/tests/Feature/ExamTest.php index c198db87..ff4be7f3 100755 --- a/tests/Feature/ExamTest.php +++ b/tests/Feature/ExamTest.php @@ -63,19 +63,19 @@ public function test_authorized_user_can_create_exam() { $this->authorized_user(['create exam']) ->post('/dashboard/exams', [ - 'name' => 'test exam', + 'name' => 'test exam', 'semester_id' => '1', 'description' => 'test description', - 'start_date' => '2020-01-01', - 'stop_date' => '2020-01-01', + 'start_date' => '2020-01-01', + 'stop_date' => '2020-01-01', ]); $this->assertDatabaseHas('exams', [ - 'name' => 'test exam', + 'name' => 'test exam', 'semester_id' => '1', 'description' => 'test description', - 'start_date' => '2020-01-01', - 'stop_date' => '2020-01-01', + 'start_date' => '2020-01-01', + 'stop_date' => '2020-01-01', ]); } @@ -104,11 +104,11 @@ public function test_unauthorized_user_cant_update_exam() $exam = Exam::factory()->create(); $this->unauthorized_user() ->put("/dashboard/exams/$exam->id", [ - 'name' => 'test', + 'name' => 'test', 'semester_id' => '1', 'description' => 'test', - 'start_date' => '2018-01-01', - 'stop_date' => '2018-01-01', + 'start_date' => '2018-01-01', + 'stop_date' => '2018-01-01', ]) ->assertForbidden(); } @@ -120,20 +120,20 @@ public function test_authorized_user_can_update_exam() $exam = Exam::factory()->create(); $this->authorized_user(['update exam']) ->put("/dashboard/exams/$exam->id", [ - 'name' => 'test', + 'name' => 'test', 'semester_id' => '1', 'description' => 'test', - 'start_date' => '2018-01-01', - 'stop_date' => '2018-01-02', + 'start_date' => '2018-01-01', + 'stop_date' => '2018-01-02', ]); $this->assertDatabaseHas('exams', [ - 'id' => $exam->id, - 'name' => 'test', + 'id' => $exam->id, + 'name' => 'test', 'semester_id' => '1', 'description' => 'test', - 'start_date' => '2018-01-01', - 'stop_date' => '2018-01-02', + 'start_date' => '2018-01-01', + 'stop_date' => '2018-01-02', ]); } diff --git a/tests/Feature/GradeSystemTest.php b/tests/Feature/GradeSystemTest.php index 785fed1a..96533319 100755 --- a/tests/Feature/GradeSystemTest.php +++ b/tests/Feature/GradeSystemTest.php @@ -62,18 +62,18 @@ public function test_authorized_user_can_create_grade_system() { $this->authorized_user(['create grade system']) ->post('/dashboard/grade-systems', [ - 'name' => 'test grade', - 'remark' => 'test remarks', - 'grade_from' => '0', - 'grade_till' => '10', + 'name' => 'test grade', + 'remark' => 'test remarks', + 'grade_from' => '0', + 'grade_till' => '10', 'class_group_id' => '1', ]); $this->assertDatabaseHas('grade_systems', [ - 'name' => 'test grade', - 'remark' => 'test remarks', - 'grade_from' => '0', - 'grade_till' => '10', + 'name' => 'test grade', + 'remark' => 'test remarks', + 'grade_from' => '0', + 'grade_till' => '10', 'class_group_id' => '1', ]); } @@ -111,19 +111,19 @@ public function test_authorized_user_can_update_grade_system() { $this->authorized_user(['update grade system']) ->put('/dashboard/grade-systems/1', [ - 'name' => 'test grade', - 'remark' => 'test remarks', - 'grade_from' => '90', - 'grade_till' => '100', + 'name' => 'test grade', + 'remark' => 'test remarks', + 'grade_from' => '90', + 'grade_till' => '100', 'class_group_id' => '1', ]); $this->assertDatabaseHas('grade_systems', [ - 'id' => '1', - 'name' => 'test grade', - 'remark' => 'test remarks', - 'grade_from' => '90', - 'grade_till' => '100', + 'id' => '1', + 'name' => 'test grade', + 'remark' => 'test remarks', + 'grade_from' => '90', + 'grade_till' => '100', 'class_group_id' => '1', ]); } diff --git a/tests/Feature/NoticeTest.php b/tests/Feature/NoticeTest.php index 7c06394e..7fcde5d4 100755 --- a/tests/Feature/NoticeTest.php +++ b/tests/Feature/NoticeTest.php @@ -53,10 +53,10 @@ public function test_unauthorized_user_can_not_create_notice() { $this->unauthorized_user(['create notice']) ->post('dashboard/notices', [ - 'title' => 'test', - 'content' => 'test', + 'title' => 'test', + 'content' => 'test', 'start_date' => '2019-01-01', - 'stop_date' => '2019-01-02', + 'stop_date' => '2019-01-02', ])->assertForbidden(); } @@ -66,17 +66,17 @@ public function test_authorized_user_can_create_notice() { $response = $this->authorized_user(['create notice']) ->post('dashboard/notices', [ - 'title' => 'Test Notice', - 'content' => 'Test Description', + 'title' => 'Test Notice', + 'content' => 'Test Description', 'start_date' => '2019-01-01', - 'stop_date' => '2019-01-02', + 'stop_date' => '2019-01-02', ]); $response->assertRedirect() && $this->assertDatabaseHas('notices', [ - 'title' => 'Test Notice', - 'content' => 'Test Description', + 'title' => 'Test Notice', + 'content' => 'Test Description', 'start_date' => '2019-01-01', - 'stop_date' => '2019-01-02', + 'stop_date' => '2019-01-02', ]); } @@ -86,10 +86,10 @@ public function test_authorized_user_can_not_create_notice_with_invalid_data() { $this->authorized_user(['create notice']) ->post('dashboard/notices', [ - 'title' => '', - 'content' => 'Test Description', + 'title' => '', + 'content' => 'Test Description', 'start_date' => '2019-01-01', - 'stop_date' => '2019-01-02', + 'stop_date' => '2019-01-02', ]) ->assertSessionHasErrors(); } @@ -100,10 +100,10 @@ public function test_authorized_user_can_not_create_notice_with_invalid_data_2() { $this->authorized_user(['create notice']) ->post('dashboard/notices', [ - 'title' => 'Test Notice', - 'content' => '', + 'title' => 'Test Notice', + 'content' => '', 'start_date' => '2019-01-01', - 'stop_date' => '2019-01-01', + 'stop_date' => '2019-01-01', ]) ->assertSessionHasErrors(); } @@ -114,10 +114,10 @@ public function test_authorized_user_can_not_create_notice_with_invalid_data_3() { $this->authorized_user(['create notice']) ->post('dashboard/notices', [ - 'title' => 'Test Notice', - 'content' => 'Test Description', + 'title' => 'Test Notice', + 'content' => 'Test Description', 'start_date' => '2019-01-01', - 'stop_date' => '2018-01-01', + 'stop_date' => '2018-01-01', ]) ->assertSessionHasErrors(); } diff --git a/tests/Feature/ParentTest.php b/tests/Feature/ParentTest.php index 3a2d1e90..cc6cd505 100644 --- a/tests/Feature/ParentTest.php +++ b/tests/Feature/ParentTest.php @@ -38,23 +38,23 @@ public function test_unauthorised_users_cannot_create_parents() { $email = $this->faker()->freeEmail(); $this->unauthorized_user()->post('dashboard/parents', [ - 'first_name' => 'Test', - 'last_name' => 'parent', - 'other_name' => 'cody', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test', + 'last_name' => 'parent', + 'other_name' => 'cody', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', - 'my_class_id' => 1, - 'section_id' => 1, - 'admission_date' => '2004/04/22', + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', + 'my_class_id' => 1, + 'section_id' => 1, + 'admission_date' => '2004/04/22', ])->assertForbidden(); $this->assertDatabaseMissing('users', [ @@ -67,30 +67,30 @@ public function test_authorized_user_can_create_parent() $email = $this->faker()->freeEmail(); $this->authorized_user(['create parent'])->post('dashboard/parents', [ - 'first_name' => 'Test', - 'last_name' => 'parent', - 'other_name' => 'cody', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test', + 'last_name' => 'parent', + 'other_name' => 'cody', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', - 'my_class_id' => 1, - 'section_id' => 1, - 'admission_date' => '2004/04/22', + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', + 'my_class_id' => 1, + 'section_id' => 1, + 'admission_date' => '2004/04/22', ])->assertRedirect(); $this->assertDatabaseHas('users', [ - 'email' => $email, - 'address' => 'test address', + 'email' => $email, + 'address' => 'test address', 'birthday' => '2004/04/22', - 'phone' => '08080808080', + 'phone' => '08080808080', ]); } @@ -116,22 +116,22 @@ public function test_unauthorised_users_cannot_update_parents() $parent->assignRole('parent'); $this->unauthorized_user()->put('dashboard/parents/'.$parent->id, [ - 'first_name' => 'Test', - 'last_name' => 'parent 2', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test', + 'last_name' => 'parent 2', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', - 'my_class_id' => 1, - 'section_id' => 1, - 'admission_date' => '2004/04/22', + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', + 'my_class_id' => 1, + 'section_id' => 1, + 'admission_date' => '2004/04/22', ])->assertForbidden(); $this->assertDatabaseMissing('users', [ @@ -146,20 +146,20 @@ public function test_authorised_users_can_update_parents() $email = $this->faker()->freeEmail(); $this->authorized_user(['update parent'])->put('dashboard/parents/'.$parent->id, [ - 'first_name' => 'Test 2', - 'other_names' => 'parent 2', - 'last_name' => 'parent', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test 2', + 'other_names' => 'parent 2', + 'last_name' => 'parent', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', ])->assertRedirect(); $this->assertDatabaseHas('users', [ @@ -194,10 +194,10 @@ public function test_unauthorised_users_cannot_assign_student_to_parent() $student = User::factory()->create(); $student->assignRole('student'); $student->studentRecord()->create([ - 'my_class_id' => 1, - 'section_id' => 2, + 'my_class_id' => 1, + 'section_id' => 2, 'admission_date' => '22/04/04', - 'is_graduated' => false, + 'is_graduated' => false, ]); $parent = User::factory()->create(); @@ -207,13 +207,13 @@ public function test_unauthorised_users_cannot_assign_student_to_parent() $this->unauthorized_user() ->post("dashboard/parents/$parent->id/assign-student-to-parent", [ 'student_id' => $student->id, - 'assign' => true, + 'assign' => true, ]) ->assertForbidden(); $this->assertDatabaseMissing('parent_record_user', [ 'parent_record_id' => $parent->parentRecord->id, - 'user_id' => $student->id, + 'user_id' => $student->id, ]); } @@ -222,10 +222,10 @@ public function test_authorised_users_can_assign_student_to_parent() $student = User::factory()->create(); $student->assignRole('student'); $student->studentRecord()->create([ - 'my_class_id' => 1, - 'section_id' => 2, + 'my_class_id' => 1, + 'section_id' => 2, 'admission_date' => '22/04/04', - 'is_graduated' => false, + 'is_graduated' => false, ]); $parent = User::factory()->create(); @@ -235,13 +235,13 @@ public function test_authorised_users_can_assign_student_to_parent() $this->authorized_user(['update parent']) ->post("dashboard/parents/$parent->id/assign-student-to-parent", [ 'student_id' => $student->id, - 'assign' => true, + 'assign' => true, ]) ->assertRedirect(); $this->assertDatabaseHas('parent_record_user', [ 'parent_record_id' => $parent->parentRecord->id, - 'user_id' => $student->id, + 'user_id' => $student->id, ]); } } diff --git a/tests/Feature/PasswordResetTest.php b/tests/Feature/PasswordResetTest.php index 13b94b2d..3733415f 100755 --- a/tests/Feature/PasswordResetTest.php +++ b/tests/Feature/PasswordResetTest.php @@ -15,7 +15,7 @@ class PasswordResetTest extends TestCase public function test_reset_password_link_screen_can_be_rendered() { - if (! Features::enabled(Features::resetPasswords())) { + if (!Features::enabled(Features::resetPasswords())) { return $this->markTestSkipped('Password updates are not enabled.'); } @@ -26,7 +26,7 @@ public function test_reset_password_link_screen_can_be_rendered() public function test_reset_password_link_can_be_requested() { - if (! Features::enabled(Features::resetPasswords())) { + if (!Features::enabled(Features::resetPasswords())) { return $this->markTestSkipped('Password updates are not enabled.'); } @@ -43,7 +43,7 @@ public function test_reset_password_link_can_be_requested() public function test_reset_password_screen_can_be_rendered() { - if (! Features::enabled(Features::resetPasswords())) { + if (!Features::enabled(Features::resetPasswords())) { return $this->markTestSkipped('Password updates are not enabled.'); } @@ -66,7 +66,7 @@ public function test_reset_password_screen_can_be_rendered() public function test_password_can_be_reset_with_valid_token() { - if (! Features::enabled(Features::resetPasswords())) { + if (!Features::enabled(Features::resetPasswords())) { return $this->markTestSkipped('Password updates are not enabled.'); } @@ -80,9 +80,9 @@ public function test_password_can_be_reset_with_valid_token() Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user) { $response = $this->post('/reset-password', [ - 'token' => $notification->token, - 'email' => $user->email, - 'password' => 'password', + 'token' => $notification->token, + 'email' => $user->email, + 'password' => 'password', 'password_confirmation' => 'password', ]); diff --git a/tests/Feature/SchoolTest.php b/tests/Feature/SchoolTest.php index 3cd91d96..095cff9c 100755 --- a/tests/Feature/SchoolTest.php +++ b/tests/Feature/SchoolTest.php @@ -48,10 +48,10 @@ public function test_user_can_create_school() ->post('/dashboard/schools', ['name' => 'Test school', 'address' => 'Test address', 'phone' => 'Test phone', 'email' => 'test@email.com', 'initials' => 'TS']); $this->assertDatabaseHas('schools', [ - 'name' => 'Test school', - 'address' => 'Test address', - 'phone' => 'Test phone', - 'email' => 'test@email.com', + 'name' => 'Test school', + 'address' => 'Test address', + 'phone' => 'Test phone', + 'email' => 'test@email.com', 'initials' => 'TS', ]); } @@ -105,12 +105,12 @@ public function test_authorized_user_can_update_School() ->patch("/dashboard/schools/$school->id", ['name' => 'Test school 2', 'address' => 'something street', 'initials' => 'TS2', 'phone' => '123456789', 'email' => 'school@test.com']); $this->assertDatabaseHas('schools', [ - 'id' => $school->id, - 'name' => 'Test school 2', - 'address' => 'something street', + 'id' => $school->id, + 'name' => 'Test school 2', + 'address' => 'something street', 'initials' => 'TS2', - 'phone' => '123456789', - 'email' => 'school@test.com', + 'phone' => '123456789', + 'email' => 'school@test.com', ]); } diff --git a/tests/Feature/SectionTest.php b/tests/Feature/SectionTest.php index 0a7a4ead..ad5e5bb6 100755 --- a/tests/Feature/SectionTest.php +++ b/tests/Feature/SectionTest.php @@ -74,7 +74,7 @@ public function test_user_can_create_section() ->post('/dashboard/sections', ['name' => 'Test section', 'my_class_id' => 1]); $this->assertDatabaseHas('sections', [ - 'name' => 'Test section', + 'name' => 'Test section', 'my_class_id' => 1, ]); } @@ -93,8 +93,8 @@ public function test_user_can_update_section() ->put("/dashboard/sections/$section->id", ['name' => 'Test section', 'my_class_id' => 1]); $this->assertDatabaseHas('sections', [ - 'id' => $section->id, - 'name' => 'Test section', + 'id' => $section->id, + 'name' => 'Test section', 'my_class_id' => 1, ]); } diff --git a/tests/Feature/SemesterTest.php b/tests/Feature/SemesterTest.php index b2b5c221..ac6f03da 100755 --- a/tests/Feature/SemesterTest.php +++ b/tests/Feature/SemesterTest.php @@ -104,7 +104,7 @@ public function test_authorized_user_can_update_a_semester() $this->authorized_user(['update semester']) ->put("/dashboard/semesters/$semester->id", ['name' => 'Test semester']); $this->assertDatabaseHas('semesters', [ - 'id' => $semester->id, + 'id' => $semester->id, 'name' => 'Test semester', ]); } @@ -151,7 +151,7 @@ public function test_authorized_user_can_set_semester() ->post('/dashboard/semesters/set', ['semester_id' => $semester->id]); $this->assertDatabaseHas('schools', [ - 'id' => auth()->user()->school->id, + 'id' => auth()->user()->school->id, 'semester_id' => $semester->id, ]); } diff --git a/tests/Feature/StudentTest.php b/tests/Feature/StudentTest.php index 828809b4..ec5c497e 100755 --- a/tests/Feature/StudentTest.php +++ b/tests/Feature/StudentTest.php @@ -49,23 +49,23 @@ public function test_unauthorised_users_cannot_create_students() { $email = $this->faker()->freeEmail(); $this->unauthorized_user()->post('dashboard/students', [ - 'first_name' => 'Test', - 'last_name' => 'Student', - 'other_name' => 'cody', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test', + 'last_name' => 'Student', + 'other_name' => 'cody', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', - 'my_class_id' => 1, - 'section_id' => 1, - 'admission_date' => '2004/04/22', + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', + 'my_class_id' => 1, + 'section_id' => 1, + 'admission_date' => '2004/04/22', ])->assertForbidden(); $this->assertDatabaseMissing('users', [ @@ -80,29 +80,29 @@ public function test_authorized_user_can_create_student() $email = $this->faker()->freeEmail(); $this->authorized_user(['create student'])->post('dashboard/students', [ - 'first_name' => 'Test', - 'last_name' => 'Student', - 'other_name' => 'cody', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test', + 'last_name' => 'Student', + 'other_name' => 'cody', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', - 'my_class_id' => 1, - 'section_id' => 1, - 'admission_date' => '2004/04/22', ]); + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', + 'my_class_id' => 1, + 'section_id' => 1, + 'admission_date' => '2004/04/22', ]); $this->assertDatabaseHas('users', [ - 'email' => $email, - 'address' => 'test address', + 'email' => $email, + 'address' => 'test address', 'birthday' => '2004/04/22', - 'phone' => '08080808080', + 'phone' => '08080808080', ]); } @@ -113,10 +113,10 @@ public function test_edit_student_cannot_be_accessed_to_unauthorised_users() $student = User::factory()->create(); $student->assignRole('student'); $student->studentRecord()->create([ - 'my_class_id' => 1, - 'section_id' => 1, + 'my_class_id' => 1, + 'section_id' => 1, 'admission_date' => '22/04/04', - 'is_graduated' => false, + 'is_graduated' => false, ]); $this->unauthorized_user()->get('dashboard/students/'.$student->id.'/edit')->assertForbidden(); } @@ -128,10 +128,10 @@ public function test_edit_student_can_be_accessed_by_authorised_users() $student = User::factory()->create(); $student->assignRole('student'); $student->studentRecord()->create([ - 'my_class_id' => 1, - 'section_id' => 1, + 'my_class_id' => 1, + 'section_id' => 1, 'admission_date' => '22/04/04', - 'is_graduated' => false, + 'is_graduated' => false, ]); $this->authorized_user(['update student'])->get('dashboard/students/'.$student->id.'/edit')->assertOk(); @@ -144,29 +144,29 @@ public function test_unauthorised_users_cannot_update_students() $student = User::factory()->create(); $student->assignRole('student'); $student->studentRecord()->create([ - 'my_class_id' => 1, - 'section_id' => 1, + 'my_class_id' => 1, + 'section_id' => 1, 'admission_date' => '22/04/04', - 'is_graduated' => false, + 'is_graduated' => false, ]); $this->unauthorized_user()->put('dashboard/students/'.$student->id, [ - 'first_name' => 'Test', - 'last_name' => 'Student 2', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test', + 'last_name' => 'Student 2', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', - 'my_class_id' => 1, - 'section_id' => 1, - 'admission_date' => '2004/04/22', ]) + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', + 'my_class_id' => 1, + 'section_id' => 1, + 'admission_date' => '2004/04/22', ]) ->assertForbidden(); $this->assertDatabaseMissing('users', [ @@ -179,28 +179,28 @@ public function test_authorised_users_can_update_students() $student = User::factory()->create(); $student->assignRole('student'); $student->studentRecord()->create([ - 'my_class_id' => 1, - 'section_id' => 1, + 'my_class_id' => 1, + 'section_id' => 1, 'admission_date' => '22/04/04', - 'is_graduated' => false, + 'is_graduated' => false, ]); $email = $this->faker()->freeEmail(); $this->authorized_user(['update student'])->put('dashboard/students/'.$student->id, [ - 'first_name' => 'Test 2', - 'other_names' => 'Student 2', - 'last_name' => 'Student', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test 2', + 'other_names' => 'Student 2', + 'last_name' => 'Student', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', ]); $this->assertDatabaseHas('users', [ @@ -215,10 +215,10 @@ public function test_unauthorised_users_cannot_delete_students() $student = User::factory()->create(); $student->assignRole('student'); $student->studentRecord()->create([ - 'my_class_id' => 1, - 'section_id' => 1, + 'my_class_id' => 1, + 'section_id' => 1, 'admission_date' => '22/04/04', - 'is_graduated' => false, + 'is_graduated' => false, ]); $this->unauthorized_user()->delete('dashboard/students/'.$student->id)->assertForbidden(); } @@ -230,10 +230,10 @@ public function test_authorised_users_can_delete_students() $student = User::factory()->create(); $student->assignRole('student'); $student->studentRecord()->create([ - 'my_class_id' => 1, - 'section_id' => 1, + 'my_class_id' => 1, + 'section_id' => 1, 'admission_date' => '22/04/04', - 'is_graduated' => false, + 'is_graduated' => false, ]); $this->authorized_user(['delete student'])->delete('dashboard/students/'.$student->id); @@ -294,16 +294,16 @@ public function test_unauthorized_user_cannot_promote_students() $student->assignRole('student'); $student->studentRecord()->create([ - 'my_class_id' => 1, - 'section_id' => 2, + 'my_class_id' => 1, + 'section_id' => 2, 'admission_date' => '22/04/04', - 'is_graduated' => false, + 'is_graduated' => false, ]); $this->unauthorized_user()->post('/dashboard/students/promote', [ - 'student_id' => [$student->id], - 'old_class_id' => 1, + 'student_id' => [$student->id], + 'old_class_id' => 1, 'old_section_id' => 2, - 'new_class_id' => 1, + 'new_class_id' => 1, 'new_section_id' => 1, ])->assertForbidden(); } @@ -315,22 +315,22 @@ public function test_authorized_user_can_promote_students() $student = User::factory()->create(); $student->assignRole('student'); $student->studentRecord()->create([ - 'my_class_id' => 1, - 'section_id' => 2, + 'my_class_id' => 1, + 'section_id' => 2, 'admission_date' => '22/04/04', - 'is_graduated' => false, + 'is_graduated' => false, ]); $this->authorized_user(['promote student'])->post('/dashboard/students/promote', [ - 'student_id' => [$student->id], - 'old_class_id' => 1, + 'student_id' => [$student->id], + 'old_class_id' => 1, 'old_section_id' => 2, - 'new_class_id' => 1, + 'new_class_id' => 1, 'new_section_id' => 1, ]); $promotion = Promotion::where([ - 'old_class_id' => 1, + 'old_class_id' => 1, 'old_section_id' => 2, - 'new_class_id' => 1, + 'new_class_id' => 1, 'new_section_id' => 1, ])->whereJsonContains('students', [$student->id])->first(); @@ -375,10 +375,10 @@ public function test_unauthorized_user_cannot_graduate_student() $student = User::factory()->create(); $student->assignRole('student'); $student->studentRecord()->create([ - 'my_class_id' => 1, - 'section_id' => 2, + 'my_class_id' => 1, + 'section_id' => 2, 'admission_date' => '22/04/04', - 'is_graduated' => false, + 'is_graduated' => false, ]); $this->unauthorized_user()->post('/dashboard/students/graduate', [ 'student_id' => [$student->id], diff --git a/tests/Feature/SubjectTest.php b/tests/Feature/SubjectTest.php index 2cfa6c61..b52335ad 100755 --- a/tests/Feature/SubjectTest.php +++ b/tests/Feature/SubjectTest.php @@ -53,10 +53,10 @@ public function test_unauthorized_user_cannot_create_subject() $user = User::factory()->create(); $this->actingAs($user); $response = $this->post('/dashboard/subjects', [ - 'name' => 'Test Subject', - 'short_name' => 'TS', + 'name' => 'Test Subject', + 'short_name' => 'TS', 'my_class_id' => 1, - 'school_id' => 1, + 'school_id' => 1, ]); $response->assertForbidden(); @@ -68,10 +68,10 @@ public function test_authorized_user_can_create_subject() $user->givePermissionTo(['create subject']); $this->actingAs($user); $response = $this->post('/dashboard/subjects', [ - 'name' => 'Test Subject', - 'short_name' => 'TS', + 'name' => 'Test Subject', + 'short_name' => 'TS', 'my_class_id' => 1, - 'school_id' => 1, + 'school_id' => 1, ]); $subject = \App\Models\Subject::where('name', 'Test Subject')->first(); @@ -102,10 +102,10 @@ public function test_unauthorized_user_cannot_update_subject() $user = User::factory()->create(); $this->actingAs($user); $response = $this->patch('/dashboard/subjects/1', [ - 'name' => 'Test Subject 2', - 'short_name' => 'TS2', + 'name' => 'Test Subject 2', + 'short_name' => 'TS2', 'my_class_id' => 1, - 'school_id' => 1, + 'school_id' => 1, ]); $response->assertForbidden(); @@ -118,10 +118,10 @@ public function test_authorized_user_can_update_subject() $this->actingAs($user); $subject = \App\Models\Subject::factory()->create(); $response = $this->patch("/dashboard/subjects/$subject->id", [ - 'name' => 'Test Subject 2', - 'short_name' => 'TS2', + 'name' => 'Test Subject 2', + 'short_name' => 'TS2', 'my_class_id' => 1, - 'school_id' => 1, + 'school_id' => 1, ]); $this->assertEquals('Test Subject 2', $subject->fresh()->name); diff --git a/tests/Feature/SyllabusTest.php b/tests/Feature/SyllabusTest.php index 5023fa52..72e07da7 100755 --- a/tests/Feature/SyllabusTest.php +++ b/tests/Feature/SyllabusTest.php @@ -57,11 +57,11 @@ public function test_unauthorized_user_cant_create_syllabus() $file = Storage::fake('syllabi'); $this->unauthorized_user() ->post('/dashboard/syllabi', [ - 'name' => 'Test syllabus', + 'name' => 'Test syllabus', 'my_class_id' => 1, - 'subject_id' => 1, + 'subject_id' => 1, 'description' => 'Test syllabus description', - 'file' => UploadedFile::fake()->create('test-syllabus.pdf', 100), + 'file' => UploadedFile::fake()->create('test-syllabus.pdf', 100), ])->assertForbidden(); } @@ -72,15 +72,15 @@ public function test_authorized_user_can_create_syllabus() $file = Storage::fake('syllabi'); $this->authorized_user(['create syllabus']) ->post('/dashboard/syllabi', [ - 'name' => 'Test syllabus', - 'subject_id' => 1, + 'name' => 'Test syllabus', + 'subject_id' => 1, 'description' => 'Test syllabus description', - 'file' => UploadedFile::fake()->create('test-syllabus.pdf', 100), + 'file' => UploadedFile::fake()->create('test-syllabus.pdf', 100), ]); $this->assertDatabaseHas('syllabi', [ - 'name' => 'Test syllabus', - 'subject_id' => 1, + 'name' => 'Test syllabus', + 'subject_id' => 1, 'description' => 'Test syllabus description', ]); } diff --git a/tests/Feature/TeacherTest.php b/tests/Feature/TeacherTest.php index ae903f23..9a76e541 100644 --- a/tests/Feature/TeacherTest.php +++ b/tests/Feature/TeacherTest.php @@ -38,23 +38,23 @@ public function test_unauthorised_users_cannot_create_teachers() { $email = $this->faker()->freeEmail(); $this->unauthorized_user()->post('dashboard/teachers', [ - 'first_name' => 'Test', - 'last_name' => 'teacher', - 'other_name' => 'cody', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test', + 'last_name' => 'teacher', + 'other_name' => 'cody', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', - 'my_class_id' => 1, - 'section_id' => 1, - 'admission_date' => '2004/04/22', + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', + 'my_class_id' => 1, + 'section_id' => 1, + 'admission_date' => '2004/04/22', ])->assertForbidden(); $this->assertDatabaseMissing('users', [ @@ -67,30 +67,30 @@ public function test_authorized_user_can_create_teacher() $email = $this->faker()->freeEmail(); $this->authorized_user(['create teacher'])->post('dashboard/teachers', [ - 'first_name' => 'Test', - 'last_name' => 'teacher', - 'other_name' => 'cody', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test', + 'last_name' => 'teacher', + 'other_name' => 'cody', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', - 'my_class_id' => 1, - 'section_id' => 1, - 'admission_date' => '2004/04/22', + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', + 'my_class_id' => 1, + 'section_id' => 1, + 'admission_date' => '2004/04/22', ])->assertRedirect(); $this->assertDatabaseHas('users', [ - 'email' => $email, - 'address' => 'test address', + 'email' => $email, + 'address' => 'test address', 'birthday' => '2004/04/22', - 'phone' => '08080808080', + 'phone' => '08080808080', ]); } @@ -116,22 +116,22 @@ public function test_unauthorised_users_cannot_update_teachers() $teacher->assignRole('teacher'); $this->unauthorized_user()->put('dashboard/teachers/'.$teacher->id, [ - 'first_name' => 'Test', - 'last_name' => 'teacher 2', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test', + 'last_name' => 'teacher 2', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', - 'my_class_id' => 1, - 'section_id' => 1, - 'admission_date' => '2004/04/22', + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', + 'my_class_id' => 1, + 'section_id' => 1, + 'admission_date' => '2004/04/22', ])->assertForbidden(); $this->assertDatabaseMissing('users', [ @@ -146,20 +146,20 @@ public function test_authorised_users_can_update_teachers() $email = $this->faker()->freeEmail(); $this->authorized_user(['update teacher'])->put('dashboard/teachers/'.$teacher->id, [ - 'first_name' => 'Test 2', - 'other_names' => 'teacher 2', - 'last_name' => 'teacher', - 'email' => $email, - 'password' => 'password', + 'first_name' => 'Test 2', + 'other_names' => 'teacher 2', + 'last_name' => 'teacher', + 'email' => $email, + 'password' => 'password', 'password_confirmation' => 'password', - 'gender' => 'male', - 'nationality' => 'nigeria', - 'state' => 'lagos', - 'city' => 'lagos', - 'blood_group' => 'a+', - 'address' => 'test address', - 'birthday' => '2004/04/22', - 'phone' => '08080808080', + 'gender' => 'male', + 'nationality' => 'nigeria', + 'state' => 'lagos', + 'city' => 'lagos', + 'blood_group' => 'a+', + 'address' => 'test address', + 'birthday' => '2004/04/22', + 'phone' => '08080808080', ])->assertRedirect(); $this->assertDatabaseHas('users', [ diff --git a/tests/Feature/TimetableTest.php b/tests/Feature/TimetableTest.php index 72162554..f61378bd 100755 --- a/tests/Feature/TimetableTest.php +++ b/tests/Feature/TimetableTest.php @@ -73,7 +73,7 @@ public function test_unauthorized_user_cant_update_timetable() { $this->unauthorized_user() ->patch('/dashboard/timetables/1', [ - 'name' => 'Test timetable', + 'name' => 'Test timetable', 'my_class_id' => 1, 'description' => 'Test timetable description', ])->assertForbidden(); @@ -87,14 +87,14 @@ public function test_user_can_update_timetable() $this->authorized_user(['update timetable']) ->patch("/dashboard/timetables/$timetable->id", [ - 'name' => 'Test timetable', + 'name' => 'Test timetable', 'my_class_id' => 1, 'description' => 'Test timetable description', ]); $this->assertDatabaseHas('timetables', [ - 'id' => $timetable->id, - 'name' => 'Test timetable', + 'id' => $timetable->id, + 'name' => 'Test timetable', 'my_class_id' => 1, 'description' => 'Test timetable description', ]); @@ -119,8 +119,8 @@ public function test_user_can_delete_timetable() ->delete("/dashboard/timetables/$timetable->id"); $this->assertDatabaseMissing('timetables', [ - 'id' => $timetable->id, - 'name' => $timetable->name, + 'id' => $timetable->id, + 'name' => $timetable->name, 'my_class_id' => $timetable->my_class_id, 'description' => $timetable->description, ]); @@ -151,7 +151,7 @@ public function test_unauthorized_user_cant_store_timetable_time_slot() $this->unauthorized_user() ->post('/dashboard/timetables/manage/time-slots', [ 'start_time' => '10:00', - 'stop_time' => '11:00', + 'stop_time' => '11:00', ])->assertForbidden(); } @@ -163,15 +163,15 @@ public function test_authorized_user_can_store_timetable_time_slot() $this->authorized_user(['update timetable']) ->post('/dashboard/timetables/manage/time-slots', [ - 'start_time' => '10:00', - 'stop_time' => '11:00', + 'start_time' => '10:00', + 'stop_time' => '11:00', 'timetable_id' => $timetable->id, ]); $this->assertDatabaseHas('timetable_time_slots', [ 'timetable_id' => $timetable->id, - 'start_time' => '10:00:00', - 'stop_time' => '11:00:00', + 'start_time' => '10:00:00', + 'stop_time' => '11:00:00', ]); } @@ -194,10 +194,10 @@ public function test_authorized_user_can_delete_timetable_time_slot() ->delete("/dashboard/timetables/manage/time-slots/$timeslot->id"); $this->assertDatabaseMissing('timetable_time_slots', [ - 'id' => $timeslot->id, + 'id' => $timeslot->id, 'timetable_id' => $timeslot->timetable_id, - 'start_time' => "$timeslot->start_time:00", - 'stop_time' => "$timeslot->stop_time:00", + 'start_time' => "$timeslot->start_time:00", + 'stop_time' => "$timeslot->stop_time:00", ]); } @@ -208,9 +208,9 @@ public function test_unauthorized_user_cannot_create_timetable_record() $timeslot = TimetableTimeSlot::factory()->create(); $this->unauthorized_user() ->post("/dashboard/timetables/manage/time-slots/$timeslot->id/record/create", [ - 'type' => 'subject', + 'type' => 'subject', 'weekday_id' => '1', - 'id' => 1, + 'id' => 1, ])->assertForbidden(); } @@ -221,14 +221,14 @@ public function test_authorized_user_can_create_timetable_record() $timeslot = TimetableTimeSlot::factory()->create(); $this->authorized_user(['update timetable']) ->post("/dashboard/timetables/manage/time-slots/$timeslot->id/record/create", [ - 'type' => 'subject', + 'type' => 'subject', 'weekday_id' => '1', - 'id' => '1', + 'id' => '1', ])->assertRedirect(); $this->assertDatabaseHas('timetable_time_slot_weekday', [ - 'timetable_time_slot_id' => $timeslot->id, - 'weekday_id' => 1, + 'timetable_time_slot_id' => $timeslot->id, + 'weekday_id' => 1, 'timetable_time_slot_weekdayable_id' => 1, ]); } diff --git a/tests/Feature/UpdatePasswordTest.php b/tests/Feature/UpdatePasswordTest.php index 1430cad4..63e0a4fb 100755 --- a/tests/Feature/UpdatePasswordTest.php +++ b/tests/Feature/UpdatePasswordTest.php @@ -22,8 +22,8 @@ public function test_password_can_be_updated() Livewire::test(UpdatePasswordForm::class) ->set('state', [ - 'current_password' => 'password', - 'password' => 'new-password', + 'current_password' => 'password', + 'password' => 'new-password', 'password_confirmation' => 'new-password', ]) ->call('updatePassword'); @@ -40,8 +40,8 @@ public function test_current_password_must_be_correct() Livewire::test(UpdatePasswordForm::class) ->set('state', [ - 'current_password' => 'wrong-password', - 'password' => 'new-password', + 'current_password' => 'wrong-password', + 'password' => 'new-password', 'password_confirmation' => 'new-password', ]) ->call('updatePassword') @@ -59,8 +59,8 @@ public function test_new_passwords_must_match() Livewire::test(UpdatePasswordForm::class) ->set('state', [ - 'current_password' => 'password', - 'password' => 'new-password', + 'current_password' => 'password', + 'password' => 'new-password', 'password_confirmation' => 'wrong-password', ]) ->call('updatePassword') diff --git a/tests/Unit/GradeSystemTest.php b/tests/Unit/GradeSystemTest.php index 0d62344c..1446b39c 100755 --- a/tests/Unit/GradeSystemTest.php +++ b/tests/Unit/GradeSystemTest.php @@ -18,37 +18,37 @@ public function test_grade_range_exists() [ 'grade_from' => 20, 'grade_till' => 70, - 'expected' => true, + 'expected' => true, ], //check if test range is in grade Range [ 'grade_from' => 50, 'grade_till' => 55, - 'expected' => true, + 'expected' => true, ], //check if test range starts from grade range and stops in another grade range [ 'grade_from' => 50, 'grade_till' => 80, - 'expected' => true, + 'expected' => true, ], //check if grade range starts at grade range and ends outside grade range [ 'grade_from' => 88, 'grade_till' => 150, - 'expected' => true, + 'expected' => true, ], //check if grade range starts outside test range and ends in grade range [ 'grade_from' => 70, 'grade_till' => 100, - 'expected' => true, + 'expected' => true, ], //false when grade range is not in test range [ 'grade_from' => 70, 'grade_till' => 79, - 'expected' => false, + 'expected' => false, ], ]; $grades = [ @@ -66,7 +66,7 @@ public function test_grade_range_exists() ]; $this->gradeSystemService = app(GradeSystemService::class); foreach ($testCases as $testCase) { - if (! array_key_exists('expected', $testCase)) { + if (!array_key_exists('expected', $testCase)) { return dd('expected value not pass in one or more test cases'); } elseif ($testCase['expected'] == true) { $this->assertTrue($this->gradeSystemService->gradeRangeExists($testCase, $grades));