File: /mnt/data/ghayatcom/ghayatcom-api/database/seeders/FaqSeeder.php
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use App\Faq;
class FaqSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$datas = [
1 => [
'user_id' => 3,
'faq_category_id' => '1',
'question' => 'Question 1',
'answer' => '<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p><p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>',
'created_by' => 3
],
2 => [
'user_id' => 3,
'faq_category_id' => '1',
'question' => 'Question 2',
'answer' => '<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p><p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>',
'created_by' => 3
],
3 => [
'user_id' => 3,
'faq_category_id' => '2',
'question' => 'Question 1',
'answer' => '<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p><p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>',
'created_by' => 3
],
4 => [
'user_id' => 3,
'faq_category_id' => '3',
'question' => 'Question 1',
'answer' => '<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p><p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>',
'created_by' => 3
],
5 => [
'user_id' => 3,
'faq_category_id' => '4',
'question' => 'Question 1',
'answer' => '<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p><p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>',
'created_by' => 3
]
];
foreach ($datas as $id => $data) {
Faq::create($data);
}
}
}