Add Page model
This commit is contained in:
parent
492410a287
commit
bb841d3d6a
1 changed files with 25 additions and 0 deletions
25
app/Page.php
Normal file
25
app/Page.php
Normal 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));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue