Add Page model

This commit is contained in:
Daniel Supernault 2019-01-31 12:55:37 -07:00
parent 492410a287
commit bb841d3d6a
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

25
app/Page.php Normal file
View file

@ -0,0 +1,25 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Page extends Model
{
const SLUG_ROOT = [
'site',
'page'
];
protected $fillable = ['slug'];
public function url()
{
return url($this->slug);
}
public function editUrl()
{
return url("/i/admin/settings/pages/edit?page=".urlencode($this->slug));
}
}