Laravel
Models Migration Relation
Introduction Installation Projet:Structure Strucutre,model,migration Migration,Models,Relation Artisan CLI Migrations:Exemples Models:Exemples Relations:Exemples 1 Relations:Exemples 2
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
Les Routes
Définir:Routes Routes avec Paramètres Routes nommées Groupes de routes
Les Controllers
Les Controllers Les Contrôleurs de Ressources
Les Vues
Vues et Blade Templates Blade Layouts et Sections Sous-vues Composants et Slots Contrôles de flux
MVC :CRUD
CRUD: Produit CRUD: Etudiant CRUD: Car CRUD,Recherche: Book
Validation
Exemple :Projets
ORM:Eloquent
Exemple :Transport
Api:Laravel +React
Middleware

Seeders & Factories
Exemples :EFM

Authenfication
TP:Schools Management
Authenfication:React
Layouts
Exercices





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');
    }
};