Add public/private pages #641 (#644)

* Add public/private pages #641

* Cleanup the form requests
This commit is contained in:
Nabeel S
2020-03-28 13:03:52 -04:00
committed by GitHub
parent 4a3ec38919
commit 45873431e4
341 changed files with 9139 additions and 570 deletions

View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models\Enums;
use App\Contracts\Enum;
class PageType extends Enum
{
public const HTML = 0;
public const MARKDOWN = 1;
}

View File

@@ -4,6 +4,8 @@ namespace App\Models\Observers;
/**
* Create a slug from a name
*
* @property object attributes
*/
class Sluggable
{

41
app/Models/Page.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
namespace App\Models;
use App\Contracts\Model;
/**
* @property int id
* @property string name
* @property string slug
* @property string icon
* @property int type
* @property bool public
* @property bool enabled
* @property string body
*/
class Page extends Model
{
public $table = 'pages';
protected $fillable = [
'name',
'slug',
'type',
'icon',
'public',
'body',
'enabled',
];
protected $casts = [
'type' => 'integer',
'public' => 'boolean',
'enabled' => 'boolean',
];
public static $rules = [
'name' => 'required|unique:pages,name',
'body' => 'required',
];
}