Laravel
Models Migration Relation
Introduction,istallation Strucutre,model,migration Migration,Models,Relation
Les Relations
BelongsTo HasOne HasMany BelongsToMany HasManyThrough
Exemples des Relations
Relations:oneToMany,ManyToMany... Relations:Exemples
Exercices
Exercice 1 Exercice 2
Controllers Views Routes
Routes,Controller,Model,view CRUD: Etudiant CRUD: Car CRUD,Recherche: Book
Validation
Exemple :Projets
Api:Laravel +React
Middleware

Seeders & Factories

Authenfication
Layouts





Gestions Projet: Migration

projets
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up()
    {
        Schema::create('projets', function (Blueprint $table) {
            $table->id("idP");
            $table->string("nomP");
            $table->string("description");
            $table->string("photoP");
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('projets');
    }
};
developpeurs
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up()
    {
        Schema::create('developpeurs', function (Blueprint $table) {
            $table->id("idD");
            $table->string("nomD");
            $table->string("prenomD");
            $table->string("cv");
            $table->string("photoD");
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('developpeurs');
    }
};
taches
<?phpuse Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{

    public function up()
    {
        Schema::create('taches', function (Blueprint $table) {
            $table->id("idT");
            $table->unsignedBigInteger("idP");
            $table->foreign("idP")->references("idP")->on("projets")->onDelete("cascade");
            $table->unsignedBigInteger("idD");
            $table->foreign("idD")->references("idD")->on("developpeurs")->onDelete("cascade");
            $table->float("dureeHeure");
            $table->float("coutHeure");
            $table->string("etat");
            $table->timestamps();
        });
    }


    public function down()
    {
        Schema::dropIfExists('taches');
    }
};