Merge branch 'master' into Development
This commit is contained in:
@@ -13,6 +13,7 @@ class Action extends Model
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\ActionFactory> */
|
||||
use HasFactory;
|
||||
|
||||
use Searchable;
|
||||
|
||||
protected $fillable = ['name', 'color_tag', 'segment_id'];
|
||||
@@ -26,10 +27,9 @@ public function segment(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Segment::class);
|
||||
}
|
||||
|
||||
|
||||
public function activities(): HasMany
|
||||
{
|
||||
return $this->hasMany(\App\Models\Activity::class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,22 +3,23 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Traits\Uuid;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Laravel\Scout\Searchable;
|
||||
|
||||
class Client extends Model
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\ClientFactory> */
|
||||
use HasFactory;
|
||||
use Uuid;
|
||||
|
||||
use Searchable;
|
||||
use Uuid;
|
||||
|
||||
protected $fillable = [
|
||||
'person_id'
|
||||
'person_id',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
@@ -26,8 +27,7 @@ class Client extends Model
|
||||
'person_id',
|
||||
];
|
||||
|
||||
|
||||
protected function makeAllSearchableUsing(Builder $query): Builder
|
||||
protected function makeAllSearchableUsing(Builder $query): Builder
|
||||
{
|
||||
return $query->with('person');
|
||||
}
|
||||
@@ -37,12 +37,11 @@ public function toSearchableArray(): array
|
||||
|
||||
return [
|
||||
'person.full_name' => '',
|
||||
'person_addresses.address' => ''
|
||||
'person_addresses.address' => '',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function person(): BelongsTo
|
||||
public function person(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Person\Person::class);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ class ImportEvent extends Model
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'import_id','user_id','event','level','message','context','import_row_id'
|
||||
'import_id', 'user_id', 'event', 'level', 'message', 'context', 'import_row_id',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
|
||||
@@ -11,7 +11,7 @@ class ImportTemplateMapping extends Model
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'import_template_id', 'entity', 'source_column', 'target_field', 'transform', 'apply_mode', 'options', 'position'
|
||||
'import_template_id', 'entity', 'source_column', 'target_field', 'transform', 'apply_mode', 'options', 'position',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
|
||||
@@ -29,7 +29,7 @@ class MailProfile extends Model
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::created(function (MailProfile $profile): void {
|
||||
|
||||
|
||||
\Log::info('mail_profile.created', [
|
||||
'id' => $profile->id,
|
||||
'name' => $profile->name,
|
||||
|
||||
@@ -15,5 +15,4 @@ public function persons(): HasMany
|
||||
{
|
||||
return $this->hasMany(\App\Models\Person\Person::class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class PersonType extends Model
|
||||
@@ -14,12 +13,11 @@ class PersonType extends Model
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description'
|
||||
'description',
|
||||
];
|
||||
|
||||
public function persons(): HasMany
|
||||
{
|
||||
return $this->hasMany(\App\Models\Person\Person::class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ class Post extends Model
|
||||
public function toSearchableArray()
|
||||
{
|
||||
$array = $this->toArray();
|
||||
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,22 +15,24 @@ class Segment extends Model
|
||||
'name',
|
||||
'description',
|
||||
'active',
|
||||
'exclude'
|
||||
'exclude',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'active' => 'boolean',
|
||||
'exclude' => 'boolean'
|
||||
'exclude' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function contracts(): BelongsToMany {
|
||||
public function contracts(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(\App\Models\Contract::class);
|
||||
}
|
||||
|
||||
public function clientCase(): BelongsToMany {
|
||||
public function clientCase(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(\App\Models\ClientCase::class)->withTimestamps();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ class User extends Authenticatable
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
'active',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -63,6 +64,7 @@ protected function casts(): array
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
'active' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user