<?php
namespace App\Models;

class Page extends Model {
    protected static function getTable(): string {
        return 'pages';
    }

    public static function findBySlug($slug) {
        $pages = self::all(['slug' => $slug]);
        return !empty($pages) ? $pages[0] : null;
    }
}
