Arthur Minasyan
Arthur Minasyan
FFilament
Created by Arthur Minasyan on 11/12/2024 in #❓┊help
How to use Spatie Translatable in filament custom page?
I have a page that is not a resource because there will be one record. But I don't know how to make LocalSwitcher work. I have tried everything possible that came to my mind.
class PrivacyPolicy extends Page implements HasForms, HasActions
{
use InteractsWithForms;
use InteractsWithActions;

protected static ?string $navigationIcon = 'heroicon-o-document-text';

protected static string $view = 'filament.pages.privacy-policy';

public ?array $data = [];

public ?PrivacyPolicyModel $record = null;

public function mount(): void
{
//...
}

protected function getHeaderActions(): array
{
return [
LocaleSwitcher::make(),
];
}

public static function getTranslatableLocales(): array
{
return getSupportedLanguagesKeys();
}

public function form(Form $form): Form
{
return $form->schema([
//...
]);
}
}
class PrivacyPolicy extends Page implements HasForms, HasActions
{
use InteractsWithForms;
use InteractsWithActions;

protected static ?string $navigationIcon = 'heroicon-o-document-text';

protected static string $view = 'filament.pages.privacy-policy';

public ?array $data = [];

public ?PrivacyPolicyModel $record = null;

public function mount(): void
{
//...
}

protected function getHeaderActions(): array
{
return [
LocaleSwitcher::make(),
];
}

public static function getTranslatableLocales(): array
{
return getSupportedLanguagesKeys();
}

public function form(Form $form): Form
{
return $form->schema([
//...
]);
}
}
2 replies
FFilament
Created by Arthur Minasyan on 2/13/2024 in #❓┊help
Make button background white )
Funny question. How can I make the button background white during hover?
.fi-btn {
@apply hover:bg-white hover:text-primary-blue;
}
.fi-btn {
@apply hover:bg-white hover:text-primary-blue;
}
Not working
2 replies
FFilament
Created by Arthur Minasyan on 1/14/2024 in #❓┊help
Has anyone created an autocomplete text input?
Has anyone created an autocomplete text input?
16 replies
FFilament
Created by Arthur Minasyan on 1/12/2024 in #❓┊help
Specific RelationManager does not show
I have several relationship managers, but one of them has started not showing up, even though it just started happening. When I dd() the relation it is there OrderResource
public static function getRelations(): array
{
return [
RelationManagers\ServicesRelationManager::class,
RelationManagers\PassengerRelationManager::class, // Not visible
RelationManagers\VehicleRelationManager::class,
RelationManagers\PaymentsRelationManager::class,
];
}
public static function getRelations(): array
{
return [
RelationManagers\ServicesRelationManager::class,
RelationManagers\PassengerRelationManager::class, // Not visible
RelationManagers\VehicleRelationManager::class,
RelationManagers\PaymentsRelationManager::class,
];
}
Order model
/**
* @var array<int, string>
*/
protected $fillable = [
'passenger_id',
// ...
];

public function passenger(): BelongsTo
{
return $this->belongsTo(
related: PassengerInfo::class,
foreignKey: 'passenger_id',
ownerKey: 'id',
);
}

// OR

public function passenger(): HasOne
{
return $this->hasOne(
related: PassengerInfo::class,
foreignKey: 'id',
localKey: 'passenger_id',
);
}

// EVEN

public function passenger(): HasMany
{
return $this->hasMany(
related: PassengerInfo::class,
foreignKey: 'id',
localKey: 'passenger_id',
);
}
/**
* @var array<int, string>
*/
protected $fillable = [
'passenger_id',
// ...
];

public function passenger(): BelongsTo
{
return $this->belongsTo(
related: PassengerInfo::class,
foreignKey: 'passenger_id',
ownerKey: 'id',
);
}

// OR

public function passenger(): HasOne
{
return $this->hasOne(
related: PassengerInfo::class,
foreignKey: 'id',
localKey: 'passenger_id',
);
}

// EVEN

public function passenger(): HasMany
{
return $this->hasMany(
related: PassengerInfo::class,
foreignKey: 'id',
localKey: 'passenger_id',
);
}
3 replies
FFilament
Created by Arthur Minasyan on 8/16/2023 in #❓┊help
[3.x] 404 for all actions in the form package.
I'm trying to use the form package but any action returns 404. search with select, click on form action.
6 replies
FFilament
Created by Arthur Minasyan on 8/16/2023 in #❓┊help
How can I use custom svg icon in form suffix action?
How can I use custom svg icon in form suffix action?
4 replies
FFilament
Created by Arthur Minasyan on 4/16/2023 in #❓┊help
How can I change the background color of the highlighted (today) day?
2 replies