blntgvn42
blntgvn42
FFilament
Created by joao nivaldo on 4/12/2024 in #❓┊help
Create a global search
This disables global search for resource. However, I dont have any idea about custom layout 🙂
15 replies
FFilament
Created by joao nivaldo on 4/12/2024 in #❓┊help
Create a global search
in your resource, just put;
public static function getGloballySearchableAttributes(): array
{
return [];
}
public static function getGloballySearchableAttributes(): array
{
return [];
}
15 replies
FFilament
Created by blntgvn42 on 4/15/2024 in #❓┊help
Filament Multi Tenant app CreateOptionForm
It was like the first line below. But in Laravel docs, it is like the second line "with brackets"
#[ObservedBy(TitleObserver::class)]
#[ObservedBy([TitleObserver::class])]
#[ObservedBy(TitleObserver::class)]
#[ObservedBy([TitleObserver::class])]
8 replies
FFilament
Created by blntgvn42 on 4/15/2024 in #❓┊help
Filament Multi Tenant app CreateOptionForm
Yee. Found the problem.
8 replies
FFilament
Created by blntgvn42 on 4/15/2024 in #❓┊help
Filament Multi Tenant app CreateOptionForm
I'm using Model::unguard() for development purposes in AppServiceProvider
8 replies
FFilament
Created by blntgvn42 on 4/15/2024 in #❓┊help
Filament Multi Tenant app CreateOptionForm
And I have also tried observers but still get company_id not null constraint
// Observer
class TitleObserver
{
public function creating(Title $title): void
{
$title->company_id = Filament::getTenant()->id;
}
}

// Model

#[ObservedBy(TitleObserver::class)]
class Title extends Model
{
use HasFactory;

public function company()
{
return $this->belongsTo(Company::class);
}

public function employees()
{
return $this->hasMany(User::class);
}
}
// Observer
class TitleObserver
{
public function creating(Title $title): void
{
$title->company_id = Filament::getTenant()->id;
}
}

// Model

#[ObservedBy(TitleObserver::class)]
class Title extends Model
{
use HasFactory;

public function company()
{
return $this->belongsTo(Company::class);
}

public function employees()
{
return $this->hasMany(User::class);
}
}
8 replies