Compare commits

..

No commits in common. "chores/boilerplate" and "main" have entirely different histories.

33 changed files with 30 additions and 825 deletions

View File

@ -1,10 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class GroupController extends Controller
{
//
}

View File

@ -1,66 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\Http\Requests\StoreLessonRequest;
use App\Http\Requests\UpdateLessonRequest;
use App\Models\Lesson;
class LessonController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(StoreLessonRequest $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(Lesson $lesson)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(Lesson $lesson)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(UpdateLessonRequest $request, Lesson $lesson)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(Lesson $lesson)
{
//
}
}

View File

@ -1,10 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class StudentController extends Controller
{
//
}

View File

@ -1,10 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class SubGroupController extends Controller
{
//
}

View File

@ -1,9 +0,0 @@
<?php
namespace App\Http\Controllers;
class TeacherController extends Controller
{
}

View File

@ -1,28 +0,0 @@
<?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

@ -1,28 +0,0 @@
<?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 [
//
];
}
}

View File

@ -1,22 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Group extends Model
{
use HasFactory;
protected $attributes = [
'name'
];
public function student(): HasMany
{
return $this-hasMany(Student::class);
}
}

View File

@ -1,18 +0,0 @@
<?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;
protected $fillable = [
'topic'
];
}

View File

@ -1,25 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Student extends Model
{
Use HasFactory;
protected $fillable = [
'name',
'email',
'age',
'enrollment_date',
];
public function lessons()
{
return $this->hasMany(Lesson::class);
}
// TODO: apparently not needed? why? dont know yet... :-)
protected $table = 'lessons';
}

View File

@ -1,22 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\HasMany;
class SubGroup extends Model
{
use HasFactory;
protected $attributes = [
];
public function student(): HasMany
{
return $this-hasMany(Student::class);
}
}

View File

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

View File

@ -1,66 +0,0 @@
<?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

@ -1,66 +0,0 @@
<?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

@ -1,66 +0,0 @@
<?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

@ -1,66 +0,0 @@
<?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

@ -1,23 +0,0 @@
<?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

@ -1,23 +0,0 @@
<?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

@ -1,23 +0,0 @@
<?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

@ -1,23 +0,0 @@
<?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

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

View File

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

View File

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

View File

@ -11,14 +11,16 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('students', function (Blueprint $table) {
$table->id();
$table->timestamps();
Schema::create('student', function (Blueprint $table) {
$table->id;
$table->string('name');
$table->string('last_name');
$table->foreignId(['group_id']);
$table->foreignId(['class_id']);
$table->integer('points');
$table->timestamp();
});
}
@ -27,6 +29,7 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('students');
Schema::drop('student');
}
};

View File

@ -9,13 +9,16 @@ return new class extends Migration
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('teachers', function (Blueprint $table) {
$table->id();
$table->timestamps();
Schema::create('teacher', function (Blueprint $table) {
$table->id;
$table->string('name');
$table->string('last_name');
$table->timestamp();
});
}
@ -24,6 +27,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('teachers');
Schema::drop('teacher');
}
};

View File

@ -1,28 +0,0 @@
<?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->foreignId('group_id')->constrained()->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('sub_groups');
}
};

View File

@ -1,28 +0,0 @@
<?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->string('topic');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('lessons');
}
};

View File

@ -1,17 +0,0 @@
<?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

@ -1,17 +0,0 @@
<?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

@ -1,17 +0,0 @@
<?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

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

View File

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