How do I seed my database for column that is a foreign key referencing to other table?
Answer / Mohd Shahnawaz Qureshi
To seed a database with data for a foreign key column, you can use the factory method on the related model and call it within your seeder class's run() method. Make sure to set the relationship before saving the instance.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is meant by Implicit Controllers
Tell me does laravel support caching?
Name some inbuilt authentication controllers of laravel.
Tell me what are the feature of laravel 5.0?
What is response in laravel?
What do you know about facades in laravel? Explain.
What is gate in laravel?
How to generate pretty urls in laravel?
What is dd() function in laravel?
Explain laravel contracts?
What are policies?
What is laravel horizon?