<?php

namespace App\Http\Controllers;

use App\Models\Job;
use Illuminate\View\View;

class CareerController extends Controller
{
    public function index(): View
    {
        return view('careers.index', ['jobs' => Job::published()->latest('published_at')->get()]);
    }

    public function show(Job $job): View
    {
        abort_unless($job->is_published, 404);

        return view('careers.show', compact('job'));
    }
}
