GrandadEvans
GrandadEvans
FFilament
Created by GrandadEvans on 2/12/2024 in #❓┊help
Can I repeat infoList in grid instead of table?
Sorry. New to the Android app... I thought that was a search box😆
8 replies
FFilament
Created by GrandadEvans on 2/12/2024 in #❓┊help
Can I repeat infoList in grid instead of table?
Modal form
8 replies
FFilament
Created by GrandadEvans on 3/5/2024 in #❓┊help
multiple() & searchable() stops Select from working.
@Leandro Ferreira @Dennis Koch Wow! You two rock! I thought I'd followed all of the installation docs (in fact all the docs). I had the wrong assumption about having to go through the separate installation instructions if I installed the entire FilamentPhp package. Looking back, I was just getting started with Filament then so probably missed something. I'd better go through the installation steps for everything, and see what else I've missed. Thank you both again for taking the time to reply. John
5 replies
FFilament
Created by GrandadEvans on 2/12/2024 in #❓┊help
Can I repeat infoList in grid instead of table?
Ignore my last mesage. I'm thinking of a different thing. It must be a different reason I didn't use RepeatableEntry. I'll look at it again
8 replies
FFilament
Created by GrandadEvans on 2/12/2024 in #❓┊help
Can I repeat infoList in grid instead of table?
Hey @jaocero that's one of the options I looked at, the dead-end (more like a traffic jam) I ran into was that I couldn't figure out how to repeat the Infolist. I couldn't get it to repeat through the Table as it wasn't the correct type. Is there something I've missed? Thanks for replying by the way
8 replies
FFilament
Created by GrandadEvans on 2/10/2024 in #❓┊help
Unsure which method to use to show CreateContactForm on url TLD/contact
I managed to sort it. I ended up with the contact page at localhost/contact (option 1), with the following inclusions in the contact page
protected function mutateFormDataBeforeCreate(array $data): array
{
if (isset($data['user_id'])) {
$user = Auth::user();
$data['name'] = $user->name;
$data['email'] = $user->email;
$data['tel'] = $user->tel;
} else {
$data['user_id'] = null;
}
return $data;
}

protected function getRedirectUrl(): string
{
return url(route('contact.confirmation'));
}
public function create(): void
{
try {
$data = $this->form->getState();

$data = $this->mutateFormDataBeforeCreate($data);

$this->record = ContactForm::create($data);

// $this->form->model($this->getRecord())->saveRelationships();
} catch (Halt $exception) {
return;
}

Notification::make()
->title('Message Sent')
->success()
->send();

$redirectUrl = '/contact-confirmation';

$this->redirect(
$redirectUrl,
navigate: FilamentView::hasSpaMode() && str($redirectUrl)->startsWith(request()->root())
);
}
protected function mutateFormDataBeforeCreate(array $data): array
{
if (isset($data['user_id'])) {
$user = Auth::user();
$data['name'] = $user->name;
$data['email'] = $user->email;
$data['tel'] = $user->tel;
} else {
$data['user_id'] = null;
}
return $data;
}

protected function getRedirectUrl(): string
{
return url(route('contact.confirmation'));
}
public function create(): void
{
try {
$data = $this->form->getState();

$data = $this->mutateFormDataBeforeCreate($data);

$this->record = ContactForm::create($data);

// $this->form->model($this->getRecord())->saveRelationships();
} catch (Halt $exception) {
return;
}

Notification::make()
->title('Message Sent')
->success()
->send();

$redirectUrl = '/contact-confirmation';

$this->redirect(
$redirectUrl,
navigate: FilamentView::hasSpaMode() && str($redirectUrl)->startsWith(request()->root())
);
}
4 replies
FFilament
Created by GrandadEvans on 2/10/2024 in #❓┊help
Unsure which method to use to show CreateContactForm on url TLD/contact
Update: OK, ignore option 2 from above, as I misunderstood the usage or getUrl()
4 replies