From 10c9c78e30d58cba7abf546bfa2aaeb2aa03e744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Thu, 7 Jul 2022 17:35:24 +0300 Subject: [PATCH] added role duplicate method.. --- app/Models/Auth/Role.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Models/Auth/Role.php b/app/Models/Auth/Role.php index 7c844462a..6f7e0dadc 100644 --- a/app/Models/Auth/Role.php +++ b/app/Models/Auth/Role.php @@ -4,13 +4,14 @@ namespace App\Models\Auth; use Akaunting\Sortable\Traits\Sortable; use App\Traits\Tenants; +use Bkwld\Cloner\Cloneable; use Laratrust\Models\LaratrustRole; use Laratrust\Traits\LaratrustRoleTrait; use Lorisleiva\LaravelSearchString\Concerns\SearchString; class Role extends LaratrustRole { - use LaratrustRoleTrait, SearchString, Sortable, Tenants; + use Cloneable, LaratrustRoleTrait, SearchString, Sortable, Tenants; protected $table = 'roles'; @@ -21,6 +22,13 @@ class Role extends LaratrustRole */ protected $fillable = ['name', 'display_name', 'description', 'created_from', 'created_by']; + /** + * Clonable relationships. + * + * @var array + */ + public $cloneable_relations = ['permissions']; + /** * Get the line actions. *