Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Livewire 3 #358

Merged
merged 36 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
5d434ad
Create academic year record if student does not have
yungifez Aug 10, 2023
f3839ad
Apply fixes from StyleCI
StyleCIBot Aug 10, 2023
6eeb488
Merge pull request #350 from yungifez/analysis-kYmO61
yungifez Aug 10, 2023
c8f9a97
Fix broken app
yungifez Aug 10, 2023
4984a0b
Fix failing tests
yungifez Aug 10, 2023
2e41718
Merge branch 'dev' of http://github.com/yungifez/skuul into dev
yungifez Aug 10, 2023
1c80f5e
Apply fixes from StyleCI
StyleCIBot Aug 10, 2023
e5169d6
Merge pull request #351 from yungifez/analysis-O3B6BJ
yungifez Aug 10, 2023
571935d
Fix menu colour
yungifez Aug 10, 2023
1660b71
Livewire 3 upgrade
yungifez Aug 26, 2023
010bab5
Apply fixes from StyleCI
StyleCIBot Aug 26, 2023
ee0aca7
Merge pull request #352 from yungifez/analysis-prkBrR
yungifez Aug 26, 2023
ba5366a
Fix jetstream outdated issue
yungifez Aug 26, 2023
15af349
Merge branch 'dev' of http://github.com/yungifez/skuul into dev
yungifez Aug 26, 2023
4af3e9d
remove redundant dd
yungifez Aug 26, 2023
edc91be
update dependencies
yungifez Sep 2, 2023
a4160a1
add stats
yungifez Sep 2, 2023
eff401b
remove total downloads
yungifez Sep 2, 2023
4db0569
Merge branch 'main' of http://github.com/yungifez/skuul into dev
yungifez Sep 2, 2023
9247b74
Fix path
yungifez Sep 2, 2023
7b0ba12
updated composer dependencies
yungifez Sep 8, 2023
a5c5994
update gitignore
yungifez Sep 8, 2023
f6b3d71
slight Ui tweaks
yungifez Sep 8, 2023
09cab26
Close profile dropdown on click outside
yungifez Sep 8, 2023
62ee2c7
Add wire navigate to menu links
yungifez Sep 8, 2023
4651635
composer update
yungifez Sep 10, 2023
8c66ad6
remove redundant alpine require
yungifez Sep 10, 2023
9c10586
livewire v3.0.3 fixes pagination
yungifez Sep 12, 2023
91a500c
Revamp of the create super admin
yungifez Sep 14, 2023
965d7db
Apply fixes from StyleCI
StyleCIBot Sep 14, 2023
35879f8
Merge pull request #353 from yungifez/analysis-b0kw2a
yungifez Sep 14, 2023
aabd11c
Add session error bag as livewire's errorbag
yungifez Oct 9, 2023
3833294
Merge branch 'dev' of http://github.com/yungifez/skuul into dev
yungifez Oct 9, 2023
1dd37a0
Apply fixes from StyleCI
StyleCIBot Oct 9, 2023
9384a38
Merge pull request #357 from yungifez/analysis-Kolboe
yungifez Oct 9, 2023
b00473a
Upgrades with livewire
yungifez Oct 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
# Skuul school management system

<p align="center">
<!-- <a href="https://packagist.org/packages/yungifez/skuul">
<img src="https://poser.pugx.org/yungifez/skuul/d/total.svg" alt="Total Composer Downloads">
</a> -->
<a href="https://packagist.org/packages/yungifez/skuul">
<img src="https://poser.pugx.org/yungifez/skuul/v/stable.svg" alt="Latest Stable Version">
</a>
<a href="https://packagist.org/packages/yungifez/skuul">
<img src="https://poser.pugx.org/yungifez/skuul/license.svg" alt="License">
</a>
</p>

>In search of good school management systems written in laravel, I tried so many although most were quite remarkably good they lacked some essential features that I would have loved in a school management system.This made me passionate in building my own school management system. Although it has been difficult, it's actually forming up into a quite useable project.

![schooldash-dahboard-page](https://user-images.githubusercontent.com/63137056/216740379-18cb9f1d-5e80-4bc8-8b99-07d08ea98da4.png)


# CONGRATS V2 OF SKUUL IS OUT


Skuul is awesome, but it had a few shortcomings when it came to some areas like UI speed and application slugishness as it grows. Version 2 fixes these issues and also improves on accessibility.

V2 is way faster and doesn't slow down condiderably as the app grows. Also upgrading should be relatively easy. Requirements remain the same with one exception, we now require node for asset bundling. No worries if you don't have node, there is a solution to that
Expand Down
68 changes: 42 additions & 26 deletions app/Console/Commands/CreateSuperAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;

use function Laravel\Prompts\password;
use function Laravel\Prompts\text;

class CreateSuperAdmin extends Command
{
use PasswordValidationRules;
Expand All @@ -34,46 +37,59 @@ class CreateSuperAdmin extends Command
public function handle()
{
try {
$this->newLine();
$this->alert('Creating super admin');
$this->info('Fill in the following details. You can modify rest of profile at a later stage. Values can not be null');
$this->info('Fill in the following details. You can modify the profile later with other information.');
do {
// code...

//don't allow null values hence do while
$firstName = null;
do {
$firstName = $this->ask('First Name');
} while (is_null($firstName));
$lastName = null;
do {
$lastName = $this->ask('Last Name');
} while (is_null($lastName));
$email = null;
do {
$email = $this->ask('Email');
} while (is_null($email));
do {
$password = $this->secret('Password');
} while (is_null($password));
do {
$passwordConfirmation = $this->secret('Confirm Password');
} while (is_null($passwordConfirmation));
$firstName = text('First name?', required: true, validate: fn (string $value) => match (true) {
strlen($value) < 3 => 'The name must be at least 3 characters.',
strlen($value) > 255 => 'The name must not exceed 255 characters.',
default => null
});
$lastName = text('Last name?', required: true, validate: fn (string $value) => match (true) {
strlen($value) < 3 => 'The name must be at least 3 characters.',
strlen($value) > 255 => 'The name must not exceed 255 characters.',
default => null
});
$email = text('Email?', required: true, validate: fn (string $value) => match (true) {
strlen($value) < 3 => 'The email must be at least 3 characters.',
strlen($value) > 511 => 'The email must not exceed 255 characters.',
filter_var($value, FILTER_VALIDATE_EMAIL) === false => 'The email must be a valid email address.',
default => null
});
$password = password(
'What is your password?',
required:true,
placeholder: 'Minimum 8 characters...',
validate: fn (string $value) => match (true) {
strlen($value) < 8 => 'The password must be at least 8 characters.',
default => null
}
);
$passwordConfirmation = password(
'Confirm your password?',
required:true,
placeholder: 'Input the same password...',
validate: fn (string $value) => match (true) {
$value !== $password => 'The password confirmation does not match.',
default => null
}
);

//validate the input
$validator = Validator::make([
'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'],
'first_name' => ['required', 'string', 'max:255'],
'last_name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:511', 'unique:users'],
'password' => $this->passwordRules(),
]);

//display validation error
foreach ($validator->errors()->all() as $error) {
$this->error($error);
}
Expand All @@ -85,7 +101,7 @@ public function handle()
'email' => $email,
'password' => Hash::make($password),
'address' => 'super admin street',
'birthday' => '22/04/04',
'birthday' => '1/1/1970',
'nationality' => 'nigeria',
'state' => 'lagos',
'city' => 'lagos',
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/InitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class InitCommand extends Command
*
* @var string
*/
protected $description = 'Easily install Skuul';
protected $description = 'Install Skuul';

/**
* No of attempts to be made to connect to the
Expand Down
13 changes: 0 additions & 13 deletions app/Http/Livewire/CreateAdminForm.php

This file was deleted.

13 changes: 0 additions & 13 deletions app/Http/Livewire/CreateNoticeForm.php

This file was deleted.

13 changes: 0 additions & 13 deletions app/Http/Livewire/CreateParentForm.php

This file was deleted.

13 changes: 0 additions & 13 deletions app/Http/Livewire/CreateSchoolForm.php

This file was deleted.

13 changes: 0 additions & 13 deletions app/Http/Livewire/CreateSemesterForm.php

This file was deleted.

13 changes: 0 additions & 13 deletions app/Http/Livewire/ListAdminsTable.php

This file was deleted.

13 changes: 0 additions & 13 deletions app/Http/Livewire/ListClassesTable.php

This file was deleted.

13 changes: 0 additions & 13 deletions app/Http/Livewire/ListExamsTable.php

This file was deleted.

13 changes: 0 additions & 13 deletions app/Http/Livewire/ListFeesTable.php

This file was deleted.

13 changes: 0 additions & 13 deletions app/Http/Livewire/ListNoticesTable.php

This file was deleted.

13 changes: 0 additions & 13 deletions app/Http/Livewire/ListParentsTable.php

This file was deleted.

13 changes: 0 additions & 13 deletions app/Http/Livewire/ListSchoolsTable.php

This file was deleted.

30 changes: 30 additions & 0 deletions app/Http/Middleware/CreateCurrentAcademicYearRecord.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;

class CreateCurrentAcademicYearRecord
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
if (auth()?->user()?->studentRecord != null && !auth()->user()?->studentRecord?->academicYears()->find(auth()->user()->school->academic_year_id)) {
auth()->user()->studentRecord->academicYears()->syncWithoutDetaching([
auth()->user()->school->academicYear->id => [
'my_class_id' => auth()->user()->studentRecord->my_class_id,
'section_id' => auth()->user()->studentRecord->section_id,
],
]);
}

return $next($request);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire;
namespace App\Livewire;

use App\Models\MyClass;
use App\Models\Section;
Expand Down Expand Up @@ -33,6 +33,8 @@ class AcademicYearResultTabulation extends Component

public function mount(MyClassService $myClassService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());

//get semester and use it to fetch all exams in semester
$this->academicYear = auth()->user()->school->academicYear;
$this->classes = $myClassService->getAllClasses();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire;
namespace App\Livewire;

use App\Models\User;
use Livewire\Component;
Expand All @@ -11,6 +11,8 @@ class ApplicationHistory extends Component

public function mount()
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());

$this->applicant->loadMissing('accountApplication', 'accountApplication.statuses');
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Livewire;
namespace App\Livewire;

use App\Models\User;
use App\Services\MyClass\MyClassService;
Expand All @@ -27,6 +27,8 @@ class AssignStudentsToParent extends Component

public function mount(SectionService $sectionService, MyClassService $myClassService)
{
$this->setErrorBag(session()->get('errors', new \Illuminate\Support\MessageBag())->getMessages());

$this->classes = $myClassService->getAllClasses();
if ($this->classes->isEmpty()) {
return;
Expand Down
Loading
Loading