File "NoticeBoardTableSeeder.php"
Full Path: /home/isoftco/public_html/hrm/database/seeds/NoticeBoardTableSeeder.php
File size: 734 bytes
MIME-type: text/x-php
Charset: utf-8
<?php
use Illuminate\Database\Seeder;
use Faker\Factory as Faker;
use Illuminate\Support\Facades\DB;
class NoticeBoardTableSeeder extends Seeder
{
public function run()
{
DB::table('noticeboards')->truncate(); // deleting old records.
$faker = Faker::create();
$companies = \App\Models\Company::all();
foreach ($companies as $company) {
for ($i = 0; $i < 10; $i++) {
\App\Models\Noticeboard::create([
'title' => $faker->realText(50),
'company_id' => $company->id,
'description' => $faker->realText(100),
'status' => 'active'
]);
}
}
}
}