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
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
<?php
public function authorize(): bool
{
return true;
}
<?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();
}
}