diff --git a/.gitignore b/.gitignore index 2896e86..e3d64c6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ Homestead.json Homestead.yaml .env .phpunit.result.cache +Procedure_migrate_db.md diff --git a/Procedure_migrate_db.md b/Procedure_migrate_db.md index 6dcbd6a..fa05c2b 100644 --- a/Procedure_migrate_db.md +++ b/Procedure_migrate_db.md @@ -1,20 +1,24 @@ -use Flipbox\LumenGenerator\LumenGeneratorServiceProvider; +## Flipbox setup -terminal -composer require flipbox/lumen-generator +use Flipbox\LumenGenerator\LumenGeneratorServiceProvider; -copier code dans fichier boostrap/app.php -Inside your bootstrap/app.php file, add: -$app->register(Flipbox\LumenGenerator\LumenGeneratorServiceProvider::class); +`composer require flipbox/lumen-generator` +Inside your bootstrap/app.php file, in the 'Register Service Providers' section, add: +`$app->register(Flipbox\LumenGenerator\LumenGeneratorServiceProvider::class);` -//generation tables bdd -```php artisan key:generate -php artisan make:model users -fmc``` +Generate the key that will connect our app to the DB +`php artisan key:generate` +The genrated key will automatically be copied in the .env file. -//apres cette commande modifier fichier generé dans database/migrations +### Create new migration +This command will create a new migration file into the database folder and a model file for the new table +`php artisan make:model users -fmc` +In the migration file, add the properties you want to appear in the table and then send it for creation to the DB with this command: `php artisan migrate` + + // pour rajouter colonne dans table existante //ensuite relancer php artisan migration apres avois rajouté dans le nouveau fichier la ligne a rajouter dans la function de la classe ``` diff --git a/database/factories/usersFactory.php b/database/factories/usersFactory.php index a815862..c01f11f 100644 --- a/database/factories/usersFactory.php +++ b/database/factories/usersFactory.php @@ -17,8 +17,8 @@ public function definition(): array 'firstname' => $this->faker->firstName, 'email_address' => $this->faker->safeEmail, 'password' => $this->faker->password, - 'phone' => $this->faker->phoneNumber, - 'dev_id' => $this->faker->randomDigit, + //'phone' => $this->faker->phoneNumber, + //'dev_id' => $this->faker->randomDigit, 'recrut_id' => $this->randomDigit, 'subscribe_to_push_notif' => $this->faker->boolean, 'profile_picture' => $this->faker->url,