1 Sử dụng seeder để tạo table cho table categories
Gõ command line: php artisan make:seed CategorySeeder
Kết quả:
Tiếp theo, chúng ta sẽ code để khởi tạo ra các thông tin cần thiết:
Code ở trên sử dụng factory mà chúng ta đã tạo ở trang trước, bạn có thể tham khảo ở mục tạo factory để hiểu hơn.
2. Sử dụng seeder để tạo table cho table categories
Gõ command line: php artisan make:seed PostSeeder
Kết quả:
Tiếp theo, chúng ta sẽ code để khởi tạo ra các thông tin cần thiết:
Vậy là chúng ta đã tạo seeder cho table categories và posts rồi đấy <3.
Một bình luận trong “XI. Sử dụng seeder để tạo table cho 2 table categories và posts”
I like this blog very much, Its a very nice berth to read and obtain information.Blog monetyze