Dab tsi yog kev siv seeder hauv laravel?
Dab tsi yog kev siv seeder hauv laravel?

Video: Dab tsi yog kev siv seeder hauv laravel?

Video: Dab tsi yog kev siv seeder hauv laravel?
Video: Leng Yang - Yog Vim Dab Tsi (Official Full Song | Nkauj Tawm Tshiab) 2020/05/24 2024, Hlis ntuj nqeg
Anonim

Laravel qhia noob rau kev tsim cov ntaub ntawv xeem thiab yog tias koj muaj qhov project me me ces koj tuaj yeem tsim tus neeg siv admin thiab tseem teeb tsa cov ntaub ntawv qub.

Nyob rau hauv no txoj kev, dab tsi yog ib tug seeder nyob rau hauv laravel?

Laravel ua rau nws yooj yim heev los ua seeding. A noob chav kawm muaj ib txoj kev khiav los ntawm lub neej ntawd. Koj tuaj yeem ntxig cov ntaub ntawv los ntawm kev siv cov lus nug tsim lossis Eloquent qauv factories. Tom qab ntawd, koj siv lub Hoobkas qauv los tsim kaum tus neeg siv hauv txoj kev khiav.

Koj siv lub seeder li cas? Yuav Siv Lub Vaj Seeder Li Cas

  1. Kauj Ruam 1 – Xaiv cov noob. Koj yuav tsum tsis txhob ntub cov noob ua ntej koj siv lub vaj seeder.
  2. Kauj Ruam 2 – Xaiv cov noob daim phiaj. Lub vaj seeder xav tau cov noob kom raug, nyob ntawm seb cov qoob loo twg koj xav cog.
  3. Kauj Ruam 3 - Siv Cov Seeder Los Sow Noob.
  4. Kauj Ruam 4 - Siv Seeder los Fertilize qoob loo.

Kuj kom paub, Kuv yuav ua li cas khiav ib tug seeder hauv laravel?

A noob chav kawm tsuas muaj ib txoj hauv kev los ntawm lub neej ntawd: khiav . Txoj kev no yog hu ua thaum db: noob Artisan hais kom ua. Hauv lub khiav txoj kev, koj tuaj yeem ntxig cov ntaub ntawv rau hauv koj lub database txawm li cas los xij koj xav tau. Koj tuaj yeem siv tus tsim cov lus nug los ntxig cov ntaub ntawv los yog koj tuaj yeem siv Eloquent qauv factories.

Dab tsi yog migration thiab seeding?

Taw qhia Migration thiab Seeding Kev tsiv teb tsaws yog zoo li kev tswj hwm version rau koj cov ntaub ntawv, tso cai rau koj pab neeg kom hloov kho tau yooj yim thiab sib qhia daim ntawv thov cov ntaub ntawv schema. Kev tsiv teb tsaws yog feem ntau ua ke nrog Laravel's schema builder kom yooj yim tsim koj daim ntawv thov database schema.

Pom zoo: