haritz
haritz
FFilament
Created by haritz on 5/3/2024 in #❓┊help
Open url in modal action
Hello, I am trying to open an url with parameters in a table modal. I want to open a modal, ask the user to write the message and then send it. So far I have the next code but I do not know how to make it work.
->extraModalFooterActions(fn (ActionTable $action): array => [
$action->makeModalSubmitAction('send')
->label('Send')
->icon('heroicon-o-paper-airplane')
->color('success'),
])
->action(function (array $data, array $arguments, $record, $action): void {
if ($data['message']) {
$customer = Customer::find($record->customer_id);
$message = $data['message'];
$url = 'https://api.whatsapp.com/send?phone=' . $customer->number . '&text=' . urlencode($message);
$action->url($url);
$action->openUrlInNewTab();
}
})
->extraModalFooterActions(fn (ActionTable $action): array => [
$action->makeModalSubmitAction('send')
->label('Send')
->icon('heroicon-o-paper-airplane')
->color('success'),
])
->action(function (array $data, array $arguments, $record, $action): void {
if ($data['message']) {
$customer = Customer::find($record->customer_id);
$message = $data['message'];
$url = 'https://api.whatsapp.com/send?phone=' . $customer->number . '&text=' . urlencode($message);
$action->url($url);
$action->openUrlInNewTab();
}
})
12 replies
FFilament
Created by haritz on 3/13/2024 in #❓┊help
Authentication user provider is not defined
I am trying to access current user in the AdminPanelProvider but I get the title error. auth()->user() If I do the same in any Reaource, works fine. I just want to check user role and depending on the role display navigation or not. We have ->navigation(true/false) so I want to make it work with the current user role. Thank you.
4 replies
FFilament
Created by haritz on 10/11/2023 in #❓┊help
Widget not rendering well on modal
No description
8 replies
FFilament
Created by haritz on 9/26/2023 in #❓┊help
Get data on getCreateEventFormSchema fullcalendar
No description
2 replies
FFilament
Created by haritz on 9/23/2023 in #❓┊help
Autofocus on tabs?
So I made a custom login page where I added 2 tabs. Since I'm using tabs, autofocus() is not working anymore. I want to focus the textinput of the first tab. Is there a way to do it?
public function form(Form $form): Form
{
return $form
->schema([
Tabs::make('Label')
->tabs([
Tabs\Tab::make('Tarjeta')
->translateLabel()
->schema([
$this->getCardFormComponent(),
]),
Tabs\Tab::make('Usuario')
->translateLabel()
->schema([
$this->getLoginFormComponent(),
$this->getPasswordFormComponent(),
]),
])
->contained(false)
->activeTab(1)
])
->statePath('data');
}

protected function getCardFormComponent(): Component
{
return TextInput::make('card')
->label('Tarjeta')
->requiredWithout('login')
->password()
->autofocus()
->translateLabel();
}

protected function getLoginFormComponent(): Component
{
return TextInput::make('login')
->label('Usuario')
->requiredWithout('card')
->autocomplete()
->translateLabel();
}

protected function getPasswordFormComponent(): Component
{
return TextInput::make('password')
->label('Contraseña')
->requiredWith('login')
->password()
->autocomplete('current-password')
->translateLabel();
}
public function form(Form $form): Form
{
return $form
->schema([
Tabs::make('Label')
->tabs([
Tabs\Tab::make('Tarjeta')
->translateLabel()
->schema([
$this->getCardFormComponent(),
]),
Tabs\Tab::make('Usuario')
->translateLabel()
->schema([
$this->getLoginFormComponent(),
$this->getPasswordFormComponent(),
]),
])
->contained(false)
->activeTab(1)
])
->statePath('data');
}

protected function getCardFormComponent(): Component
{
return TextInput::make('card')
->label('Tarjeta')
->requiredWithout('login')
->password()
->autofocus()
->translateLabel();
}

protected function getLoginFormComponent(): Component
{
return TextInput::make('login')
->label('Usuario')
->requiredWithout('card')
->autocomplete()
->translateLabel();
}

protected function getPasswordFormComponent(): Component
{
return TextInput::make('password')
->label('Contraseña')
->requiredWith('login')
->password()
->autocomplete('current-password')
->translateLabel();
}
2 replies
FFilament
Created by haritz on 9/21/2023 in #❓┊help
Is possible to add 2 filter to a widget?
I would like to have 2 filter, lets say one to choose when, like this today, last month... and another to choose a machine model id.
10 replies
FFilament
Created by haritz on 9/15/2023 in #❓┊help
Login without password
It is possible to use the current login form to login without password? I want users to be able to login with a card. That card has a code inside that will be use to login. If they do not have the card, they will login with user and password.
6 replies
FFilament
Created by haritz on 9/13/2023 in #❓┊help
Create custom page inside admin panel
No description
3 replies
FFilament
Created by haritz on 9/10/2023 in #❓┊help
Issue with fullcalendar not loading well first tiem
No description
9 replies
FFilament
Created by haritz on 8/30/2023 in #❓┊help
Customize modal component
No description
5 replies
FFilament
Created by haritz on 8/3/2023 in #❓┊help
Use Filament v2 table style in a custom table
3 replies