<?php

namespace Database\Seeders;

use App\Models\Photo;
use App\Models\Project;
use App\Models\User;
use Illuminate\Database\Seeder;

class PhotoSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $user = User::first();
        $project = Project::first();

        if (!$project) {
            return;
        }

        Photo::create([
            'project_id' => $project->id,
            'file_path' => 'photos/sample-site-photo.jpg',
            'file_name' => 'sample-site-photo.jpg',
            'description' => 'Foundation work completed in zone A.',
            'category' => 'site_progress',
            'uploaded_by_id' => $user?->id,
        ]);
    }
}
