[chore] generating the boilerplate

This commit is contained in:
Abdellah El Morabit 2025-11-10 23:10:33 +01:00
parent 8749fc0b2d
commit 543d8eaca4
26 changed files with 680 additions and 17 deletions

View File

@ -0,0 +1,28 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreLessonRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
//
];
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdateLessonRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
//
];
}
}

13
app/Models/Group.php Normal file
View File

@ -0,0 +1,13 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Group extends Model
{
protected $attributes = [
''
];
}

12
app/Models/Lesson.php Normal file
View File

@ -0,0 +1,12 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Lesson extends Model
{
/** @use HasFactory<\Database\Factories\LessonFactory> */
use HasFactory;
}

10
app/Models/Student.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Student extends Model
{
//
}

11
app/Models/SubGroup.php Normal file
View File

@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class SubGroup extends Model
{
}

23
app/Models/Teacher.php Normal file
View File

@ -0,0 +1,23 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use App\Models\Group;
class Teacher extends Model
{
protected $table = 'teacher';
/**
* @return HasMany
*/
public function group(): HasMany
{
return $this->hasMany(Group::class);
}
}

View File

@ -0,0 +1,66 @@
<?php
namespace App\Policies;
use App\Models\Group;
use App\Models\User;
use Illuminate\Auth\Access\Response;
class GroupPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return false;
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Group $group): bool
{
return false;
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return false;
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Group $group): bool
{
return false;
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Group $group): bool
{
return false;
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, Group $group): bool
{
return false;
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, Group $group): bool
{
return false;
}
}

View File

@ -0,0 +1,66 @@
<?php
namespace App\Policies;
use App\Models\Lesson;
use App\Models\User;
use Illuminate\Auth\Access\Response;
class LessonPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return false;
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Lesson $lesson): bool
{
return false;
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return false;
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Lesson $lesson): bool
{
return false;
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Lesson $lesson): bool
{
return false;
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, Lesson $lesson): bool
{
return false;
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, Lesson $lesson): bool
{
return false;
}
}

View File

@ -0,0 +1,66 @@
<?php
namespace App\Policies;
use App\Models\Student;
use App\Models\User;
use Illuminate\Auth\Access\Response;
class StudentPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return false;
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Student $student): bool
{
return false;
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return false;
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Student $student): bool
{
return false;
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Student $student): bool
{
return false;
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, Student $student): bool
{
return false;
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, Student $student): bool
{
return false;
}
}

View File

@ -0,0 +1,66 @@
<?php
namespace App\Policies;
use App\Models\SubGroup;
use App\Models\User;
use Illuminate\Auth\Access\Response;
class SubGroupPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return false;
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, SubGroup $subGroup): bool
{
return false;
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return false;
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, SubGroup $subGroup): bool
{
return false;
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, SubGroup $subGroup): bool
{
return false;
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, SubGroup $subGroup): bool
{
return false;
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, SubGroup $subGroup): bool
{
return false;
}
}

View File

@ -0,0 +1,23 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Group>
*/
class GroupFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
//
];
}
}

View File

@ -0,0 +1,23 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Lesson>
*/
class LessonFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
//
];
}
}

View File

@ -0,0 +1,23 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Student>
*/
class StudentFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
//
];
}
}

View File

@ -0,0 +1,23 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\SubGroup>
*/
class SubGroupFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
//
];
}
}

View File

@ -11,7 +11,10 @@ return new class extends Migration
*/
public function up(): void
{
//
Schema::create('groups', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
@ -19,6 +22,6 @@ return new class extends Migration
*/
public function down(): void
{
//
Schema::dropIfExists('groups');
}
};

View File

@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('sub_groups', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('sub_groups');
}
};

View File

@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('lessons', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('lessons');
}
};

View File

@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('groups', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('groups');
}
};

View File

@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('sub_groups', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('sub_groups');
}
};

View File

@ -11,15 +11,9 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('class', function(Blueprint $table)
{
$table->id('name');
$table->string('name');
$table->foreignId('teacher_id');
$table->time('start_time');
$table->time('end_time');
// amount of students can be calculated
Schema::create('students', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
@ -28,6 +22,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::drop('class');
Schema::dropIfExists('students');
}
};

View File

@ -0,0 +1,17 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class GroupSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
//
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class LessonSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
//
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class StudentSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
//
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class SubGroupSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
//
}
}

View File

@ -1,11 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<title>Teacher's Journal</title>
</head>
<body>
Hello world
<header>
<ul>
<li>home</li>
<li>about</li>
<li>login</li>
<li>register</li>
</ul>
</header
<div>
Document the courses you've teached.
</div>
</body>
</html>