From 3270b42a7778cca697aebd2c1b2307c93298835d Mon Sep 17 00:00:00 2001 From: wahyu Date: Mon, 16 Oct 2023 16:27:21 +0700 Subject: [PATCH] default page --- app/Http/Controllers/RoleController.php | 3 +++ app/Models/Role.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php index 4a29066..57b8c58 100644 --- a/app/Http/Controllers/RoleController.php +++ b/app/Http/Controllers/RoleController.php @@ -18,6 +18,9 @@ class RoleController extends Controller $data = $request->all(); $data['created_by'] = $this->currentName; + if (!isset($data['default_page'])) { + $data['default_page'] = 29; // dashboard + } $result = Role::create($data); diff --git a/app/Models/Role.php b/app/Models/Role.php index 0363567..73de4a2 100644 --- a/app/Models/Role.php +++ b/app/Models/Role.php @@ -12,6 +12,6 @@ class Role extends Model const UPDATED_AT = 'updated_at'; protected $fillable = [ - 'name', 'description', 'created_at', 'created_by', 'updated_at', 'updated_by' + 'name', 'description', 'default_page', 'created_at', 'created_by', 'updated_at', 'updated_by' ]; }