wulfheart
wulfheart
FFilament
Created by wulfheart on 5/25/2024 in #❓┊help
Button showing as loading by default
No description
4 replies
FFilament
Created by wulfheart on 5/24/2024 in #❓┊help
Github like field
No description
4 replies
FFilament
Created by wulfheart on 2/6/2024 in #❓┊help
Show different pages based on model state
Hello, I am currently unsure how I should organize my code to work better. I want to display different edit/view pages for different states a model is in. E.g. my Game model has the states PreGame, Playing, Finished with different RelationManagers each. Is there a way to have multiple edit pages with different RelationManagers each? I was unfortunately unable to find docs on this.
2 replies
FFilament
Created by wulfheart on 11/29/2023 in #❓┊help
Secondary navbar
Some time ago I saw a possibility to add a secondary navbar to a resource. Is there already a plugin to do it?
2 replies
FFilament
Created by wulfheart on 10/26/2023 in #❓┊help
Form Builder: form method somehow resets public property values
Hello, when setting properties in a Form Component in the mount method the changes don't get persisted so they return back to their default values. I only want to make the call to the AuthServiceInterface once because it also does a DB query. How can I achieve it to access values in the form method which have been set in the mount method? Thank you in advance.
class FinishUserDetailsPage extends Component implements HasForms
{
use InteractsWithForms;

public ?array $data = [];

#[Locked]
public bool $showEmailField = false;
#[Locked]
public bool $showPasswordField = false;
#[Locked]
public bool $showUsernameField = false;

public function mount(AuthServiceInterface $authService): void
{
$this->form->fill();

$user = $authService->user();
$missing = $user->getMissingProperties();
$this->showEmailField = in_array(MissingUserPropertyEnum::EMAIL, $missing);
$this->showPasswordField = in_array(MissingUserPropertyEnum::PASSWORD, $missing);
$this->showUsernameField = in_array(MissingUserPropertyEnum::USERNAME, $missing);

// Here the values are true and set corrently
}

public function form(Form $form): Form
{
// Here are they all false again, why?
return $form
->schema([
TextInput::make('email')
->label('Email')
->hidden(!$this->showEmailField)
-
Actions::make([
Action::make('Anmelden')
->submit('login-form')
])->fullWidth()
])
->statePath('data');
}

public function render()
{
return view('livewire.finish-user-details-page');
}
}
class FinishUserDetailsPage extends Component implements HasForms
{
use InteractsWithForms;

public ?array $data = [];

#[Locked]
public bool $showEmailField = false;
#[Locked]
public bool $showPasswordField = false;
#[Locked]
public bool $showUsernameField = false;

public function mount(AuthServiceInterface $authService): void
{
$this->form->fill();

$user = $authService->user();
$missing = $user->getMissingProperties();
$this->showEmailField = in_array(MissingUserPropertyEnum::EMAIL, $missing);
$this->showPasswordField = in_array(MissingUserPropertyEnum::PASSWORD, $missing);
$this->showUsernameField = in_array(MissingUserPropertyEnum::USERNAME, $missing);

// Here the values are true and set corrently
}

public function form(Form $form): Form
{
// Here are they all false again, why?
return $form
->schema([
TextInput::make('email')
->label('Email')
->hidden(!$this->showEmailField)
-
Actions::make([
Action::make('Anmelden')
->submit('login-form')
])->fullWidth()
])
->statePath('data');
}

public function render()
{
return view('livewire.finish-user-details-page');
}
}
2 replies
FFilament
Created by wulfheart on 10/25/2023 in #❓┊help
Using Actions in Forms as submit button
Hello, currently I have my custom form defined as followed:
return $form
->schema([
TextInput::make('Email')
->type('email')
->email()
->label('Email')
->required(),
TextInput::make('Password')
->label('Passwort')
->required()
->password(),
Actions::make([
Action::make('register')
->label('Registrieren')
->button()
->submit()
])->fullWidth()
])
->statePath('data');
return $form
->schema([
TextInput::make('Email')
->type('email')
->email()
->label('Email')
->required(),
TextInput::make('Password')
->label('Passwort')
->required()
->password(),
Actions::make([
Action::make('register')
->label('Registrieren')
->button()
->submit()
])->fullWidth()
])
->statePath('data');
I would somehow like to be able to define the action as the submit for the form. Is there any way I can achieve this?
2 replies
FFilament
Created by wulfheart on 10/25/2023 in #❓┊help
phpstan: Access to an undefined property App\Livewire\RegisterPage::$form.
When creating a form like described in the docs at https://filamentphp.com/docs/3.x/forms/adding-a-form-to-a-livewire-component#adding-the-form then I get the following PHPStan message. Is the documentation still up to date or do I have to set it differently? What about autocompletion?
6 replies
FFilament
Created by wulfheart on 10/25/2023 in #❓┊help
Option to show password field
Hey, how can I make the TextInput::make()->password show the password on user request (the classic password-toggle)? I know how to achieve this with AlpineJS normally, but not in the context of filament.
17 replies
FFilament
Created by wulfheart on 10/25/2023 in #❓┊help
Laravel Jetstream like sections using the forms package
No description
13 replies
FFilament
Created by wulfheart on 10/13/2023 in #❓┊help
how to build custom theme
Hello, how can I build the tailwind of a custom theme. It just does not seem to just run npm run build. How can I "register" the custom tailwind.config.js so that it generates the correct output css? Thank you in advance.
8 replies
FFilament
Created by wulfheart on 10/13/2023 in #❓┊help
Resources which do not have multiple entries
Hello, is there a way to have entries in the sidebar which do not have multiple records. I am thinking of a way to configure things like the imprint.
5 replies
FFilament
Created by wulfheart on 3/23/2023 in #❓┊help
UI evaluation question
6 replies