![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/rentpix.corals.io/Corals/modules/RentPix/update-batches/ |
<?php use Corals\Modules\Utility\Models\ListOfValue\ListOfValue; use Illuminate\Support\Str; $promptedPhotosOptions = [ 'DS Front Tire Tread', 'DS Rear Tire Tread', 'Spare Tire', 'PS Rear Tire Tread', 'PS Front Tire Tread', ]; $pathSampleImages = 'uploads/sample_images/'; $parent_code = ListOfValue::query()->where('code', 'rentPix_prompted_photos')->first(); foreach ($promptedPhotosOptions as $key => $photo) { $strValue = ucwords($photo); $code = Str::slug($photo, '_'); $properties = [ 'is_required' => 1, 'sample_link' => $pathSampleImages . $code . '.jpg', 'sample_link_thumb' => $pathSampleImages . $code . '_thumb.jpg', 'damage_circle_enabled' => 1, ]; ListOfValue::query()->create([ 'code' => $code, 'label' => $strValue, 'value' => $strValue, 'parent_id' => $parent_code->id, 'module' => 'RentPix', 'properties' => $properties ?? [], ]); } $photos = [ '34_ds_frontside', 'roof_front', '34_ps_frontside', '34_ps_rearside', '34_ds_rearside', 'ds_rear_roof', 'ps_rear_roof', 'ds_front_tire_tread', 'ds_rear_tire_tread', 'spare_tire', 'ps_rear_tire_tread', 'ps_front_tire_tread', 'odometer_reading', 'passenger_section', 'rear_interior', 'windshield', 'fuel_angel', ]; $display_order = 0; foreach ($photos as $photoCode) { ListOfValue::query()->where('code', $photoCode)->first() ->update(['display_order' => $display_order]); $display_order += 1; }