<?php

namespace App\Services;

use App\Models\Backoffice\Information;

class InformationService
{
    /**
     * Get informations list
     *
     * @return Information
     */
    public function getInformation()
    {
        $informationList = Information::full()
            ->where('status', 'published')
            ->get();

        return $informationList;
    }

    /**
     * Get information by slug
     *
     * @param string $slug
     * @return Information
     */
    public function getInformationBySlug(string $slug)
    {
        $information = Information::full()
            ->where('status', 'published')
            ->where('slug', $slug)
            ->first();

        return $information;
    }
}
