diff --git a/app/Enumerations/ContentStatuses.php b/app/Enumerations/ContentStatuses.php new file mode 100644 index 00000000..8ed34f9f --- /dev/null +++ b/app/Enumerations/ContentStatuses.php @@ -0,0 +1,21 @@ + 'admin/contents.status_' . Content::STATUS_DRAFT, + Content::STATUS_DELETED => 'admin/contents.status_' . Content::STATUS_DELETED, + Content::STATUS_PROTECTED => 'admin/contents.status_' . Content::STATUS_PROTECTED, + Content::STATUS_PUBLIC => 'admin/contents.status_' . Content::STATUS_PUBLIC + ]; + + foreach ($roles as $role => $translation) { + self::push($role, $translation); + } + } +} \ No newline at end of file diff --git a/app/Models/Content.php b/app/Models/Content.php index 908ed8e0..c07804aa 100644 --- a/app/Models/Content.php +++ b/app/Models/Content.php @@ -9,9 +9,7 @@ use Illuminate\Database\Eloquent\Model; */ class Content extends Model { - public $timestamps = true; - protected $fillable = [ 'user_id', 'module_handler', @@ -26,8 +24,9 @@ class Content extends Model 'module_settings', 'status' ]; - protected $guarded = []; - - + const STATUS_DELETED = 'deleted'; + const STATUS_DRAFT = 'draft'; + const STATUS_PROTECTED = 'protected'; + const STATUS_PUBLIC = 'public'; } \ No newline at end of file diff --git a/resources/lang/en/admin/contents.php b/resources/lang/en/admin/contents.php new file mode 100644 index 00000000..521032c1 --- /dev/null +++ b/resources/lang/en/admin/contents.php @@ -0,0 +1,7 @@ + 'Deleted', + 'status_draft' => 'Draft', + 'status_protected' => 'Protected', + 'status_public' => 'Public' +]; \ No newline at end of file