131 lines
4.4 KiB
PHP
Executable File
131 lines
4.4 KiB
PHP
Executable File
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\Hash;
|
|
use Illuminate\Support\Str;
|
|
|
|
class DatabaseSeeder extends Seeder
|
|
{
|
|
public function run(): void
|
|
{
|
|
// Create sample users
|
|
$user1Id = DB::table('users')->insertGetId([
|
|
'name' => 'Music Channel',
|
|
'email' => 'music@example.com',
|
|
'password' => Hash::make('password'),
|
|
'avatar' => null,
|
|
'role' => 'user',
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
]);
|
|
|
|
$user2Id = DB::table('users')->insertGetId([
|
|
'name' => 'Sports Channel',
|
|
'email' => 'sports@example.com',
|
|
'password' => Hash::make('password'),
|
|
'avatar' => null,
|
|
'role' => 'user',
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
]);
|
|
|
|
$user3Id = DB::table('users')->insertGetId([
|
|
'name' => 'Entertainment',
|
|
'email' => 'entertainment@example.com',
|
|
'password' => Hash::make('password'),
|
|
'avatar' => null,
|
|
'role' => 'user',
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
]);
|
|
|
|
// Create sample videos
|
|
// Video 1 - Music type
|
|
DB::table('videos')->insert([
|
|
'user_id' => $user1Id,
|
|
'title' => 'Summer Vibes - Official Music Video',
|
|
'description' => "Check out our latest summer hit! 🎵\n\n#SummerVibes #Music #2024",
|
|
'filename' => 'sample-video-1.mp4',
|
|
'path' => 'public/videos/sample-video-1.mp4',
|
|
'thumbnail' => null,
|
|
'duration' => 240,
|
|
'size' => 15000000,
|
|
'mime_type' => 'video/mp4',
|
|
'orientation' => 'landscape',
|
|
'width' => 1920,
|
|
'height' => 1080,
|
|
'status' => 'ready',
|
|
'visibility' => 'public',
|
|
'type' => 'music',
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
]);
|
|
|
|
// Video 2 - Match type
|
|
DB::table('videos')->insert([
|
|
'user_id' => $user2Id,
|
|
'title' => 'Championship Finals - Full Match Highlights',
|
|
'description' => "Watch the exciting championship finals! 🏆\n\n#Championship #Sports #Highlights",
|
|
'filename' => 'sample-video-2.mp4',
|
|
'path' => 'public/videos/sample-video-2.mp4',
|
|
'thumbnail' => null,
|
|
'duration' => 600,
|
|
'size' => 35000000,
|
|
'mime_type' => 'video/mp4',
|
|
'orientation' => 'landscape',
|
|
'width' => 1920,
|
|
'height' => 1080,
|
|
'status' => 'ready',
|
|
'visibility' => 'public',
|
|
'type' => 'match',
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
]);
|
|
|
|
// Video 3 - Generic type
|
|
DB::table('videos')->insert([
|
|
'user_id' => $user3Id,
|
|
'title' => 'Behind the Scenes - Movie Production',
|
|
'description' => "Go behind the scenes of our latest movie production! 🎬\n\n#BehindTheScenes #Movie #Production",
|
|
'filename' => 'sample-video-3.mp4',
|
|
'path' => 'public/videos/sample-video-3.mp4',
|
|
'thumbnail' => null,
|
|
'duration' => 180,
|
|
'size' => 12000000,
|
|
'mime_type' => 'video/mp4',
|
|
'orientation' => 'landscape',
|
|
'width' => 1920,
|
|
'height' => 1080,
|
|
'status' => 'ready',
|
|
'visibility' => 'public',
|
|
'type' => 'generic',
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
]);
|
|
|
|
// Video 4 - Music type
|
|
DB::table('videos')->insert([
|
|
'user_id' => $user1Id,
|
|
'title' => 'Acoustic Sessions - Live Performance',
|
|
'description' => "Our live acoustic performance at the studio 🎵\n\n#Acoustic #LiveMusic #Sessions",
|
|
'filename' => 'sample-video-4.mp4',
|
|
'path' => 'public/videos/sample-video-4.mp4',
|
|
'thumbnail' => null,
|
|
'duration' => 300,
|
|
'size' => 20000000,
|
|
'mime_type' => 'video/mp4',
|
|
'orientation' => 'landscape',
|
|
'width' => 1920,
|
|
'height' => 1080,
|
|
'status' => 'ready',
|
|
'visibility' => 'public',
|
|
'type' => 'music',
|
|
'created_at' => now(),
|
|
'updated_at' => now(),
|
|
]);
|
|
}
|
|
}
|