Файловый менеджер - Редактировать - /home/clickysoft/public_html/travel-guru.clickysoft.net/database/seeders/BadgeSeeder.php
Назад
<?php namespace Database\Seeders; use Illuminate\Database\Seeder; use App\Models\Badge; class BadgeSeeder extends Seeder { public function run() { // Base URL for badge images $baseUrl = env('APP_URL') . '/badges'; // Badge data $badges = [ [ 'title' => 'Virtuoso', 'description' => 'Awarded for outstanding performance.', 'image' => 'badge1.png', ], [ 'title' => 'Royal Caribbean', 'description' => 'Given to the top seller of the month.', 'image' => 'badge2.png', ], [ 'title' => 'Four Seasons', 'description' => 'Awarded for high customer satisfaction.', 'image' => 'badge3.png', ], ]; foreach ($badges as $badgeData) { // Create badge $badge = Badge::create([ 'title' => $badgeData['title'], 'description' => $badgeData['description'], ]); // Add the badge image from URL $badge->addMediaFromUrl("{$baseUrl}/{$badgeData['image']}") ->toMediaCollection('badge_image'); } } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка