Re Format Doctor Resource

This commit is contained in:
R
2022-09-29 11:55:51 +07:00
parent 388f7b2a9b
commit 4ff3ce9714
3 changed files with 90 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
class Organization extends Model
{
@@ -26,6 +27,11 @@ class Organization extends Model
public $appends = [
'meta'
];
public function setCodeAttribute($value)
{
$this->attributes['code'] = !empty($value) ? $value : Str::upper(Str::random('6'));
}
public function getMetaAttribute()
{