Tonkawuck
Tonkawuck
FFilament
Created by TegarJK on 10/11/2024 in #❓┊help
Auto naming based on 3 select input fields
Make your select inputs ->live() Then use something like this
->afterStateHydrated(fn(Forms\Get $get, Forms\Set $set) => self::setProgramName($get, $set))
->afterStateHydrated(fn(Forms\Get $get, Forms\Set $set) => self::setProgramName($get, $set))
public static function setProgramName($get, $set)
{
// Check if you have values in selects
// Using $get('field')
// Construct and set the program name using $set
}
public static function setProgramName($get, $set)
{
// Check if you have values in selects
// Using $get('field')
// Construct and set the program name using $set
}
4 replies
FFilament
Created by Stricks on 10/6/2024 in #❓┊help
Clicking on a child record in a table to take you to that record - not edit
Yes, that function will return the route that you are currently constructing manually
13 replies
FFilament
Created by yohanan on 10/6/2024 in #❓┊help
deploying laravel filament app on local machine issues
Actually no, it appears that your local environment entry point is htdocs, and your project folder is within. Your entry point should be set to htdocs/my-app-name/public/index.php
47 replies
FFilament
Created by yohanan on 10/6/2024 in #❓┊help
deploying laravel filament app on local machine issues
Your webserver should be setting the entry point of your application as public/index.php. Right now it looks like your entry point is the application root (folder level with app, storage, routes folders)
47 replies
FFilament
Created by Bryan on 10/6/2024 in #❓┊help
redirect after registration on blade file admin panel
Use a middleware, add your middleware into the AdminPanelProvider.php
5 replies
FFilament
Created by Stricks on 10/6/2024 in #❓┊help
Clicking on a child record in a table to take you to that record - not edit
Your closure will work in combination with the above code
13 replies
FFilament
Created by Stricks on 10/6/2024 in #❓┊help
Clicking on a child record in a table to take you to that record - not edit
Also, don't use routes like that. Use PersonResource::getUrl('edit', ['record' => $record])
13 replies
FFilament
Created by Stricks on 10/6/2024 in #❓┊help
Clicking on a child record in a table to take you to that record - not edit
Generally if the child resource has an edit page the EditAction will direct to the page and not open a modal.
13 replies
FFilament
Created by D2RTECH on 10/5/2024 in #❓┊help
Trying to call a view of another resource from a table
If you want to create that resource while referencing this record you can maybe provide a query parameter record ID to the create route.
5 replies
FFilament
Created by D2RTECH on 10/5/2024 in #❓┊help
Trying to call a view of another resource from a table
The create route doesn't accept a record parameter. Also if you do your routes like LaptopAssignmentsResource::getUrl('create', ['record_id' => $record->id]) you are less dependent on the actual route
5 replies
FFilament
Created by johny7 on 9/27/2024 in #❓┊help
Filament favicon is not embedded via https
Try modifying the ASSET_URL env var. If that doesn't work try adding a force HTTPS in a service provider depending on your apps environment. https://stackoverflow.com/a/51819095
8 replies
FFilament
Created by Asmit Nepali on 9/20/2024 in #❓┊help
How to registerAction on table selectColumn ?
You can add an action on the table row like this:
Tables\Actions\Action::make('change_subject')
->fillForm(function(array($data) {}), // Populate this closure to set inital state
->form(fn(Form $form) =>
$form->schema([
Forms\Components\Select::make('subject')
->options([
//
])
])
)
->requiresConfirmation()
->action(function(Model $record, array $data) {
$record->update(['subject' => $data['subject']]);
}),
Tables\Actions\Action::make('change_subject')
->fillForm(function(array($data) {}), // Populate this closure to set inital state
->form(fn(Form $form) =>
$form->schema([
Forms\Components\Select::make('subject')
->options([
//
])
])
)
->requiresConfirmation()
->action(function(Model $record, array $data) {
$record->update(['subject' => $data['subject']]);
}),
e
11 replies
FFilament
Created by Asmit Nepali on 9/20/2024 in #❓┊help
How to registerAction on table selectColumn ?
I looked into this briefly and you'll be fighting with the SelectColumn to do this. I recommend adding a table row Action with a ->form() and ->requiresConfirmation() to do this.
11 replies
FFilament
Created by ddoddsr on 9/19/2024 in #❓┊help
modifyQueryUsing ->join changes $record->id
How about this? Basically flipped the logic, and used a whereHas instead of the join to do some of the logic.
return $table
->query(Persona::query())
->modifyQueryUsing(function(Builder $query) {
$query
->where('am_notes','!=','');

if ( $client_id ) {
$query->where('client_id', $client_id);
}

if ($csm_id) {
$query->whereHas('users', fn(Builder $query) => $query->where('customer_support_manager_id', $csm_id));
}

if ($am_id) {
$query->whereHas('users', fn(Builder $query) => $query->where('account_manager_id', $am_id));
}
})
->columns([
Tables\Columns\TextColumn::make('client.name')->sortable()
//changes with join
->url(fn ($record): string => "/clients/$record->client_id/edit"),
Tables\Columns\TextColumn::make('li_email')
//changes with join
->url(fn (Persona $record): string => "/personas/$record->id/edit")
->openUrlInNewTab(),
Tables\Columns\TextColumn::make('am_notes')
->label('Instructions'),
]);
return $table
->query(Persona::query())
->modifyQueryUsing(function(Builder $query) {
$query
->where('am_notes','!=','');

if ( $client_id ) {
$query->where('client_id', $client_id);
}

if ($csm_id) {
$query->whereHas('users', fn(Builder $query) => $query->where('customer_support_manager_id', $csm_id));
}

if ($am_id) {
$query->whereHas('users', fn(Builder $query) => $query->where('account_manager_id', $am_id));
}
})
->columns([
Tables\Columns\TextColumn::make('client.name')->sortable()
//changes with join
->url(fn ($record): string => "/clients/$record->client_id/edit"),
Tables\Columns\TextColumn::make('li_email')
//changes with join
->url(fn (Persona $record): string => "/personas/$record->id/edit")
->openUrlInNewTab(),
Tables\Columns\TextColumn::make('am_notes')
->label('Instructions'),
]);
6 replies
FFilament
Created by Neamix on 9/14/2024 in #❓┊help
Pass params to a custom page
Does your chatroom have a database record and laravel model? If so you can create a filament resource with a view page to do this. Generally the model is loaded into the record property on filament classes
12 replies
FFilament
Created by negro on 9/14/2024 in #❓┊help
how to generate slug from title with filament version 1 ??
Str::slug() ? From Illuminate\Support\Str
5 replies
FFilament
Created by Patie on 9/7/2024 in #❓┊help
OpenSearch/ElasticSearch
There is a modifyQueryUsing function have you tried that?
8 replies
FFilament
Created by Raziul Islam on 9/1/2024 in #❓┊help
Adding demo mode in filament application
You could also set your models to extend from a base model which has this functionality. There are a few ways to do this
12 replies
FFilament
Created by Raziul Islam on 9/1/2024 in #❓┊help
Adding demo mode in filament application
You could create a trait to easily port this code to either all your models or resource pages depending on how you do it.
12 replies
FFilament
Created by Raziul Islam on 9/1/2024 in #❓┊help
Adding demo mode in filament application
You could also override the functions that perform record creation/updating/deleting on your resource to prevent database interaction. I believe the create function is called "handleRecordCreate" and there will be a similar one for edit. For delete you can make the buttons action do nothing
12 replies