<?php

namespace App\Http\Actions\Pages;

use App\Models\Post;
use Illuminate\Http\Request;
use Illuminate\View\View;

class PostDetailsPageAction
{
    public function __invoke(Request $request, $slug): View
    {
        $post = Post::where('slug', $slug)->firstOrFail();
        return view('pages.post-details', compact('post'));
    }
}
