(103) Part-1 What is Laravel Seeder and How to use seeder in Laravel?
You have lots of question what is seeder in laravel?, how to use seeder in laravel?, what is command to create seeder in laravel?, why we have to use seeder in laravel 9? that's all i will example in this laravel 9 database seed tutorial.
Laravel introduce seeder for creating testing data and if you have small admin project then you can create admin user and also setting table default data.
Whenever you have admin project that don't have register page then what you will do?, i mean you need to create at least one admin user. So basically he can login and access whole admin panel. But you don't have register page on front end. you only have login page. So you can create one admin from database directly?, if yes then you have to always create new admin user from directly database when you create new setup of your project. But i will suggest you to create admin seeder so you can create admin user using laravel 9 seeder. You just fire on command to run seeder in laravel 9.
Same things, if you have default setting configuration then you can create setting seeder and add default configuration to your database table.
In this tutorial, i will show you how to create database seeder in laravel 6 and what is command to create seeder and how to run that seeder in laravel 6. so you have to just follow few step get how it's done.
Laravel gives command to create seeder in laravel. so you can run following command to make seeder in laravel application.
Create Seeder Command:
php artisan make:seeder UserSeeder
Laravel Series Goal:
My goal for the Laravel series is to create a guide for beginners/Intermediate who want to learn Laravel. This guide will take you from the very beginning of an idea into a real deployable application.
If you are facing any problem during development, you can post your queries free of cost at https://solutions.cdlcell.com so our team will respond to you within 24 hours.
If you need paid help from us, please visit https://solutions.cdlcell.com/user/instant-help to process a contract with us.
* Contact us: contact@cdlcell.com
* Our website: https://cdlcell.com
* My Twitter: https://twitter.com/HadayatNiazi3
* My FB: http://facebook.com/hadayatniaziofficial
Follow us on LinkedIn: https://linkedin.com/in/cdlcell
Follow us on Tiktok: https://tiktok.com/@cdlcell
Join us on Instagram: https://instagram.com/cdlcell
Follow us on Facebook: https://facebook.com/cdlcellpk
Join our Laravel Developers whatsapp group: https://chat.whatsapp.com/JSA8qZZGVbPIv9NdHeIwyi
#php
#phplaravel
#laravel
#webdevelopment
#cdl
#career_development_lab
#hadayatniazi
#coding
#technology