Git Product home page Git Product logo

tp_02's Introduction

Project Setup

! Cloner le repo et installer les dépendances

  git clone https://github.com/Warisaremou/tp_02.git
  code tp_02
  cp .env.example .env
  composer install
  php artisan key:generate
  php artisan storage:link
  php artisan migrate
  php artisan db:seed
  npm install
  npm run dev
  php artisan serve

NB: Avant de lancer la migration, configurer le fichier .env en ajoutant le nom de la base de donnée et le mot de passe de la BDD

Installer laravel

  composer create-project laravel/laravel tp_02
  cd TP_02

Installer Bootstrap

  composer require laravel/ui --dev
  php artisan ui bootstrap --auth
  npm install
  npm run dev

Quelques commandes

Création de model avec migration, factory et seeder

  php artisan make:model Livres -mfs

Lancer les migrations

  php artisan migrate

Lancer les seeders

  php artisan db:seed

Création d'un controller

  php artisan make:controller LivresController

Création d'un controller avec les méthodes CRUD

  php artisan make:controller LivresController --resource

Création d'un request pour valider les données

  php artisan make:request CreateLivresRequest

Note: N'oubliez pas le fillable dans les models

Note: Dans les fichiers de request il faut changer retourner true par return false

<?php

public function authorize(): bool
{
    return true;
}

Modifier le fichier app/Providers/AppServiceProvider.php pour la pagination

<?php

namespace App\Providers;

use Illuminate\Pagination\Paginator;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     */
    public function register(): void
    {
        //
    }

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        Paginator::useBootstrap();
    }
}

tp_02's People

Contributors

warisaremou avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.