<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Models\Page;

class PageController extends Controller
{
    /**
     * Page content by slug.
     */
    public function show(Page $page)
    {
        if (!$page->is_active) {
            return response()->json(['message' => 'الصفحة غير متوفرة'], 404);
        }

        return response()->json(['data' => $page]);
    }
}
