%PDF- %PDF-
Direktori : /var/www/html/workeasy-api/database/seeds/ |
Current File : /var/www/html/workeasy-api/database/seeds/JobPositionsTableSeeder.php |
<?php use Illuminate\Database\Seeder; use Spatie\MediaLibrary\HasMedia\HasMediaTrait; use Workeasy\Models\JobPosition; use Workeasy\Traits\AddImageTrait; class JobPositionsTableSeeder extends Seeder { use HasMediaTrait; const MEDIA_COLLECTION = 'jobs'; const MEDIA_DISK = 'jobs'; /** * Run the database seeds. * * @return void */ public function run() { $backend = JobPosition::query()->create([ 'name' => 'Back End Developer', 'position' => 'Back End Developer', ]); $backend->addMedia(base_path() . '/public/img/back-end-developer.png') ->preservingOriginal() ->toMediaCollection(self::MEDIA_COLLECTION, self::MEDIA_DISK); $frontend = JobPosition::query()->create([ 'name' => 'Front End Developer', 'position' => 'Front End Developer', ]); $frontend->addMedia(base_path() . '/public/img/Front-end-developer.png') ->preservingOriginal() ->toMediaCollection(self::MEDIA_COLLECTION, self::MEDIA_DISK); $it = JobPosition::query()->create([ 'name' => 'IT Specialist', 'position' => 'IT Specialist', ]); $it->addMedia(base_path() . '/public/img/It.png') ->preservingOriginal() ->toMediaCollection(self::MEDIA_COLLECTION, self::MEDIA_DISK); $qassurance = JobPosition::query()->create([ 'name' => 'Quality Insurance', 'position' => 'Quality Insurance', ]); $qassurance->addMedia(base_path() . '/public/img/Quality-assurance.jpg') ->preservingOriginal() ->toMediaCollection(self::MEDIA_COLLECTION, self::MEDIA_DISK); $economist = JobPosition::query()->create([ 'name' => 'Economist', 'position' => 'Economist', ]); $economist->addMedia(base_path() . '/public/img/econmist.jpg') ->preservingOriginal() ->toMediaCollection(self::MEDIA_COLLECTION, self::MEDIA_DISK); $engineer = JobPosition::query()->create([ 'name' => 'Network Engineer', 'position' => 'Network Engineer', ]); $engineer->addMedia(base_path() . '/public/img/engineer.jpg') ->preservingOriginal() ->toMediaCollection(self::MEDIA_COLLECTION, self::MEDIA_DISK); $operator = JobPosition::query()->create([ 'name' => 'Call Center Operator', 'position' => 'Call Center Operator', ]); $operator->addMedia(base_path() . '/public/img/Call-Center.jpg') ->preservingOriginal() ->toMediaCollection(self::MEDIA_COLLECTION, self::MEDIA_DISK); } }