Advertisement
Virajsinh

Laravel Library Readme.md

Sep 26th, 2024 (edited)
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | Source Code | 0 0
  1. ### Create Exist Database Table into Migration File. Folder Path ```database/migrations``` [Reference URL](https://tinyurl.com/3kbtmdn9)
  2.  
  3. 1. install package via composer
  4.  
  5. ```composer require --dev kitloong/laravel-migrations-generator```
  6.  
  7. 2. generate all database migration file into database/migrations
  8.  
  9. ```php artisan migrate:generate```
  10.  
  11. 3. if you want to create specific migration table.
  12.  
  13. ```php artisan migrate:generate --tables="table1,table2,table3,table4,table5"```
  14.  
  15. 4. if you want to ignore table and create migration table
  16.  
  17. ```php artisan migrate:generate --ignore="table3,table4,table5"```
  18.  
  19.  
  20. ### Export Exist Table Data Using Seeders. Folder Path ```database/seeders``` [Reference URL](https://tinyurl.com/3mftwcwb)
  21.  
  22. 1. install package via composer
  23.  
  24. ```composer require orangehill/iseed```
  25. 2. Export ```users``` Table Data Export
  26.  
  27. ```php artisan iseed users```
  28. 3. Import Table Data ```UsersTableSeeder``` Class name
  29.  
  30. ```php artisan db:seed --class=UsersTableSeeder```
  31. 4. Export All Exported Seeds/Data
  32.  
  33. ```php artisan iseed --tables=all```
  34. 5. Import All Exported Seed/Data
  35.  
  36. ```php artisan db:seed```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement