Virgil
Virgil
Explore posts from servers
TLCTuto's Laravel Corner
Created by Virgil on 10/8/2023 in #💡filament
Multitenant/Company plugin
As promised in the live stream. The link to a nice plugin for making a multi tenant installation with edit company and user profile. https://github.com/andrewdwallo/filament-companies
3 replies
TLCTuto's Laravel Corner
Created by Virgil on 10/8/2023 in #💡filament
Last stream, question about impersonation
Hello everybody, In the last stream somebody asked about acting as a other user. I found a plugin, which maybe could help. https://filamentphp.com/plugins/joseph-szobody-impersonate
2 replies
TLCTuto's Laravel Corner
Created by Virgil on 9/23/2023 in #💡filament
Google Distance Matrix API
Hello, has anyone have experience with implementing the Google Distance Matrix API into a Filament form? I need to find a solution to calculate a distance between two addresses and I need to know the distance to every country border on the route. Does anyone can help me with some coding solutions?
5 replies
FFilament
Created by Virgil on 9/23/2023 in #❓┊help
Google Distance Matrix API
Hello, has anyone have experience with implementing the Google Distance Matrix API into a Filament form? I need to find a solution to calculate a distance between two addresses and I need to know the distance to every country border on the route. Does anyone can help me with some coding solutions?
8 replies
TLCTuto's Laravel Corner
Created by Virgil on 8/20/2023 in #💡filament
Example UserResource with Password reset button
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name'),
Tables\Columns\TextColumn::make('email'),
])
->filters([
Tables\Filters\TrashedFilter::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\Action::make('changePassword')
->icon('heroicon-o-shield-check')
->label('Change password')
->form([
Forms\Components\TextInput::make('new_password')
->password()
->label('New password')
->required()
->rule(Password::default()),
Forms\Components\TextInput::make('new_password_confirmation')
->password()
->label('Retype new password')
->required()
->same('new_password')
->rule(Password::default()),
])
->action(function (User $record, array $data) {
$record->update([
'password' => Hash::make($data['new_password'])
]);
Notification::make()
->title('Password changed')
->success()
->send();
}),
])
}


public static function getPages(): array
{
return [
'index' => Pages\ListUsers::route('/'),
'create' => Pages\CreateUser::route('/create'),
'edit' => Pages\EditUser::route('/{record}/edit'),
];
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name'),
Tables\Columns\TextColumn::make('email'),
])
->filters([
Tables\Filters\TrashedFilter::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\Action::make('changePassword')
->icon('heroicon-o-shield-check')
->label('Change password')
->form([
Forms\Components\TextInput::make('new_password')
->password()
->label('New password')
->required()
->rule(Password::default()),
Forms\Components\TextInput::make('new_password_confirmation')
->password()
->label('Retype new password')
->required()
->same('new_password')
->rule(Password::default()),
])
->action(function (User $record, array $data) {
$record->update([
'password' => Hash::make($data['new_password'])
]);
Notification::make()
->title('Password changed')
->success()
->send();
}),
])
}


public static function getPages(): array
{
return [
'index' => Pages\ListUsers::route('/'),
'create' => Pages\CreateUser::route('/create'),
'edit' => Pages\EditUser::route('/{record}/edit'),
];
}
3 replies
FFilament
Created by Virgil on 8/20/2023 in #❓┊help
Relations between two relation managers
I've a bit of a struggle with table list/form. I've made a table list with customers, within the edit of the customer I've integrated two relation managers. One: With customer contact persons. Two: With notes of the customer. Now, I want to select the customer contact name in the form of Relation manager no 2. But I can't get it working, with only the contacts of this customer. I'm seeing all contacts of all customers. I've probably have to make an query select, but I'm complete out of ideas how to fix this. Who has any advice?
7 replies
TLCTuto's Laravel Corner
Created by Virgil on 8/20/2023 in #💡filament
Problem with relationmanager
I've a bit of a struggle with table list/form. I've made a table list with customers, within the edit of the customer I've integrated two relation managers. - One: With customer contact persons. - Two: With notes of the customer. Now, I want to select the customer contact name in the form of Relation manager no 2. But I can't get it working, with only the contacts of this customer. I'm seeing all contacts of all customers. I've probably have to make an query select, but I'm complete out of ideas how to fix this. Who has any advice?
6 replies