<?php
namespace App\Repositories\Core\App;

use App\Models\Core\App\ApplicationPage;

class ApplicationPages
{
    public static function getBySlug($application_id, $slug)
    {
        $app = ApplicationPage::active()->byApplication($application_id)->bySlug($slug)->first();
        return $app ? $app->toArray() : null;
    }

    public static function getActiveByApplication($application_id)
    {
        $app = ApplicationPage::active()->byApplication($application_id)->get();
        return $app ? $app->toArray() : null;
    }
}
