⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
hospital.dev-unit.com
/
database
/
seeders
/
View File Name :
LandingAboutUsTableSeeder.php
<?php namespace Database\Seeders; use App\Models\LandingAboutUs; use Illuminate\Database\Seeder; class LandingAboutUsTableSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { $input = [ 'text_main' => 'How It Work', 'card_img_one' => ('/front-assets/landing-theme/images/banner/about_us.png'), 'card_img_two' => ('/front-assets/landing-theme/images/banner/check-circle-regular.svg'), 'card_img_three' => ('/front-assets/landing-theme/images/banner/credit-card-solid.svg'), 'main_img_one' => ('/front-assets/landing-theme/images/about/12.png'), 'main_img_two' => ('/front-assets/landing-theme/images/about/14.png'), 'card_one_text' => 'Research', 'card_two_text' => 'HMS Customization', 'card_three_text' => 'Cost Effective', 'card_one_text_secondary' => 'HMS specialises in developing innovative, efficient and smart healthcare solutions.', 'card_two_text_secondary' => 'We offer complete HMS customization solutions. We are staffed by eLearning experts and we know how to get the most from HMS.', 'card_three_text_secondary' => 'HMS not only saves time in the hospital but also is cost-effective in decreasing the number of people working on the Paper work.', ]; $landingAboutUs = LandingAboutUs::create($input); $imageMappings = [ 'card_img_one' => LandingAboutUs::LANDING_ABOUT_US_CARD_IMG_ONE, 'card_img_two' => LandingAboutUs::LANDING_ABOUT_US_CARD_IMG_TWO, 'card_img_three' => LandingAboutUs::LANDING_ABOUT_US_CARD_IMG_THREE, 'main_img_one' => LandingAboutUs::LANDING_ABOUT_US_MAIN_IMG_ONE, 'main_img_two' => LandingAboutUs::LANDING_ABOUT_US_MAIN_IMG_TWO, ]; foreach ($imageMappings as $field => $collection) { if (file_exists(public_path($input[$field]))) { $landingAboutUs->addMedia(public_path($input[$field])) ->preservingOriginal() ->toMediaCollection($collection, config('app.media_disk')); } } $landingAboutUs->update([ 'card_img_one' => $landingAboutUs->getFirstMediaUrl(LandingAboutUs::LANDING_ABOUT_US_CARD_IMG_ONE), 'card_img_two' => $landingAboutUs->getFirstMediaUrl(LandingAboutUs::LANDING_ABOUT_US_CARD_IMG_TWO), 'card_img_three' => $landingAboutUs->getFirstMediaUrl(LandingAboutUs::LANDING_ABOUT_US_CARD_IMG_THREE), 'main_img_one' => $landingAboutUs->getFirstMediaUrl(LandingAboutUs::LANDING_ABOUT_US_MAIN_IMG_ONE), 'main_img_two' => $landingAboutUs->getFirstMediaUrl(LandingAboutUs::LANDING_ABOUT_US_MAIN_IMG_TWO), ]); } }