Categories (NN)
This commit is contained in:
28
A_retenir.md
28
A_retenir.md
@@ -10,3 +10,31 @@
|
||||
- `storage` => logs, cache
|
||||
- `tests` => tests de l'app (automatisés)
|
||||
- `vendor` => le dossier de composer (on n'y touche pas)
|
||||
|
||||
# Commandes PHP Artisan (Docker)
|
||||
|
||||
- Créer une migration => `php artisan make:migration create_nom_table`
|
||||
- migration => `php artisan migrate:fresh`
|
||||
- seeder => `php artisan db:seed --class=NomSeeder`
|
||||
|
||||
php artisan make:model Categorie --migration -a
|
||||
php artisan make:model billet_categorie -m
|
||||
|
||||
```sql
|
||||
use laravel_db;
|
||||
INSERT INTO billet_categorie (id, billet_id, categorie_id, created_at, updated_at)
|
||||
VALUES
|
||||
(1, 1, 1, NULL, NULL),
|
||||
(2, 1, 2, NULL, NULL),
|
||||
(3, 1, 10, NULL, NULL),
|
||||
(4, 2, 3, NULL, NULL),
|
||||
(5, 3, 9, NULL, NULL),
|
||||
(6, 4, 1, NULL, NULL),
|
||||
(7, 4, 4, NULL, NULL),
|
||||
(8, 5, 5, NULL, NULL),
|
||||
(9, 6, 7, NULL, NULL),
|
||||
(10, 7, 1, NULL, NULL),
|
||||
(11, 8, 10, NULL, NULL),
|
||||
(12, 9, 6, NULL, NULL),
|
||||
(13, 10, 8, NULL, NULL);
|
||||
```
|
||||
Reference in New Issue
Block a user