<?php

namespace App\Services;

use App\Models\Backoffice\Page;

class PageService
{
    /**
     * Get page by slug
     *
     * @param string $slug
     * @return Page
     */
    public function getPageBySlug(string $slug)
    {
        $page = Page::full()
            ->where('status', 'published')
            ->where('slug', $slug)
            ->first();

        return $page;
    }
}
