Get the App
SLTechnology News&Howtos  ›  Development  › 

How to populate data in laravel Framework

Shulou Source: shulou.com Published: 2022-06-02 08:52:32 11月15日 Update

This article introduces you how to populate the data in the laravel framework, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Laravel in order to make the data more convenient to fill the database, a special filler class is defined, which can populate your database with test data. All the filler classes are placed in the database/seeds directory, so let's take a look.

Write Seeders and populate the data

Using the Artisan command make:seeder to generate Seeder

Php artisan make:seeder UserSeeder

Generate UserSeeder classes

Tags: Data commands databases methods frameworks content more constructors help queries generation good interest guys friends articles catalogs knowledge articles references Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Apple Redmi Shulou Technology MariaDB