documents
This commit is contained in:
@@ -13,12 +13,14 @@ class DocumentSetting extends Model
|
||||
'preview_enabled',
|
||||
'whitelist',
|
||||
'date_formats',
|
||||
'custom_defaults',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'preview_enabled' => 'boolean',
|
||||
'whitelist' => 'array',
|
||||
'date_formats' => 'array',
|
||||
'custom_defaults' => 'array',
|
||||
];
|
||||
|
||||
public static function instance(): self
|
||||
@@ -30,6 +32,7 @@ public static function instance(): self
|
||||
'preview_enabled' => config('documents.preview.enabled', true),
|
||||
'whitelist' => config('documents.whitelist'),
|
||||
'date_formats' => [],
|
||||
'custom_defaults' => [],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,33 +12,39 @@ class PersonAddress extends Model
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\Person/PersonAddressFactory> */
|
||||
use HasFactory;
|
||||
|
||||
use Searchable;
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'address',
|
||||
'country',
|
||||
'post_code',
|
||||
'city',
|
||||
'type_id',
|
||||
'description',
|
||||
'person_id',
|
||||
'user_id'
|
||||
'user_id',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'user_id',
|
||||
'person_id',
|
||||
'deleted'
|
||||
'deleted',
|
||||
];
|
||||
|
||||
public function toSearchableArray(): array
|
||||
{
|
||||
return [
|
||||
'address' => $this->address,
|
||||
'country' => $this->country
|
||||
'country' => $this->country,
|
||||
'post_code' => $this->post_code,
|
||||
'city' => $this->city,
|
||||
];
|
||||
}
|
||||
|
||||
protected static function booted(){
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function (PersonAddress $address) {
|
||||
$address->user_id = auth()->id();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user