[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: makeFakeWebinars.php
<?php namespace Database\Seeders; use App\Models\Tag; use App\Models\Webinar; use App\Models\WebinarFilterOption; use Illuminate\Database\Seeder; use Faker\Factory as Faker; class makeFakeWebinars extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { $faker = Faker::create(); $teachers = \App\User::where('role_name', 'teacher')->get(); foreach ($teachers as $teacher) { $categories = App\Models\Category::whereNotNull('parent_id')->get()->random(3); foreach ($categories as $category) { $start_date = $faker->dateTimeBetween('-3 week', 'now')->getTimestamp(); $webinar = Webinar::create([ 'teacher_id' => $teacher->id, 'creator_id' => (!empty($teacher->organ_id)) ? $teacher->organ_id : $teacher->id, 'category_id' => $category->id, 'title' => $faker->sentence, 'start_date' => $start_date, 'duration' => rand(10, 160), 'seo_description' => $faker->sentence, 'image_cover' => 'https://picsum.photos/id/' . rand(1000, 1050) . '/1600/600', 'thumbnail' => 'https://picsum.photos/id/' . rand(1000, 1050) . '/400/300', 'video_demo' => null, 'description' => $faker->paragraph(6), 'capacity' => random_int(1, 30), 'price' => random_int(0, 99), 'support' => random_int(0, 1), 'downloadable' => random_int(0, 1), 'partner_instructor' => false, 'subscribe' => false, 'message_for_reviewer' => true, 'status' => Webinar::$active, 'created_at' => time(), ]); $filters = App\Models\Filter::where('category_id', $category->id)->get()->random(2); foreach ($filters as $filter) { $filterOptions = App\Models\FilterOption::where('filter_id', $filter->id)->get()->random(3); foreach ($filterOptions as $filterOption) { WebinarFilterOption::create([ 'webinar_id' => $webinar->id, 'filter_option_id' => $filterOption->id ]); } } foreach (range(1, random_int(2, 4)) as $index) { Tag::create([ 'webinar_id' => $webinar->id, 'title' => $faker->word, ]); } } } } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.86 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285