changes, global search (clients, cleintCases)

This commit is contained in:
Simon Pocrnjič
2024-11-19 12:49:16 +01:00
parent c45751c1e2
commit 3ae70bf340
37 changed files with 1888 additions and 229 deletions
+9
View File
@@ -6,11 +6,13 @@
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Laravel\Scout\Searchable;
class PersonPhone extends Model
{
/** @use HasFactory<\Database\Factories\Person/PersonPhoneFactory> */
use HasFactory;
use Searchable;
protected $fillable = [
'nu',
@@ -27,6 +29,13 @@ class PersonPhone extends Model
'deleted'
];
public function toSearchableArray(): array
{
return [
'nu' => $this->nu
];
}
protected static function booted(){
static::creating(function (PersonPhone $personPhone) {
if(!isset($personPhone->user_id)){