<?php

class Page extends Eloquent
{
    protected $table = 'pages';
    public $timestamps = true;

    public static function getPageBySlug($slug, $remember)
    {
        $page = self::where([
            'slug' => $slug,
            'status' => 1
        ]);

        if($remember){
            $page->remember($remember);
        }

        return $page->get()->first();
    }

    public static function getAll()
    {
        return self::where('status', 1)->get();
    }


}