Zetto
Zetto
FFilament
Created by Zetto on 11/30/2023 in #❓┊help
Deploying inside subdirectory
I am trying to deploy my app inside a site. The server team only gives me access docker instance at "example.com/exampleapp/" (so that's the root of the instance). I'm currently trying to solve the routing issue and asset registering. I see that the styles and scripts depends on the base url, but how can i change that? Currently the style and scripts are loaded from example.com/ . I'm looking for a way to change it to example.com/exampleapp/. Also i'm using nginx with the following site config
server {
listen 80;
server_name example.com;
root /var/www/exampleapp/public;

add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";

index index.php;

charset utf-8;

location / {
try_files $uri $uri/ @exampleapp;
}

location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_param REQUEST_URI /exampleapp$request_uri;
fastcgi_param SCRIPT_FILENAME /var/www/exampleapp/public/index.php;
include fastcgi_params;
}

location @exampleapp {
rewrite /(.*)$ /index.php?/$1 last;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

error_page 404 /index.php;

location ~ /\.(?!well-known).* {
deny all;
}
}
server {
listen 80;
server_name example.com;
root /var/www/exampleapp/public;

add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";

index index.php;

charset utf-8;

location / {
try_files $uri $uri/ @exampleapp;
}

location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_param REQUEST_URI /exampleapp$request_uri;
fastcgi_param SCRIPT_FILENAME /var/www/exampleapp/public/index.php;
include fastcgi_params;
}

location @exampleapp {
rewrite /(.*)$ /index.php?/$1 last;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

error_page 404 /index.php;

location ~ /\.(?!well-known).* {
deny all;
}
}
4 replies
FFilament
Created by Zetto on 11/6/2023 in #❓┊help
Array of custom colors (badge)
I'm confused on how to use colors() instead of color() for badge. The case is i want my badge color to be the same as the $record->color, i can usually do this for one instance. But now i 'm showing multiple badge (tags relationship), and i want each to be different. It can be done by returning default color pallette as array (success, warning, info, etc). But how should i do it using custom color? I cant use Color:: class cause the array key is the color.
2 replies
FFilament
Created by Zetto on 10/10/2023 in #❓┊help
Dynamic Default Chart Filter
How do i set the default filter for chart widget if it is dynamic or based on something? I tried setting
public static ?string $filter
public static ?string $filter
But it's not dynamic I also tried changing the value inside getData()
$this->filter = $myFilter
$this->filter = $myFilter
But it sets it constantly even when i tried to change filter Currently on my code i dynamicly create an array for the getFilter() so i want to know how can i also access it dynamically
2 replies
FFilament
Created by Zetto on 9/17/2023 in #❓┊help
Show full width and text of TextColumn that is using badge()
How do i always show full width of the text when using badge in TextColumn?
3 replies
FFilament
Created by Zetto on 9/6/2023 in #❓┊help
ImageColumn custom state (array/collection)
I want to customize ImageColumn state, i managed to customize for one image, however i don't know how to do it for multiple images chained with stacked() function. I tried returning collection for the state and it does not work.
4 replies
FFilament
Created by Zetto on 9/5/2023 in #❓┊help
AttachAction not working for custom select
I'm trying to customize the attach action select and add more forms for pivot table attributes, however it does not change (it still the search select) and there is no error or exception showing. I don't know if this is a bug or cache thing (clearing view and cache does notwork) example code for the pivot attribute,
->headerActions([
Tables\Actions\AttachAction::make()->form(fn (AttachAction $action): array => [
$action->getRecordSelect(),
Forms\Components\TextInput::make('role')
->required(),
]),
])
->headerActions([
Tables\Actions\AttachAction::make()->form(fn (AttachAction $action): array => [
$action->getRecordSelect(),
Forms\Components\TextInput::make('role')
->required(),
]),
])
3 replies
FFilament
Created by Zetto on 9/1/2023 in #❓┊help
Attach with relationship showing different search option label
I have table A with name that has one-to-one relationship with table B (has a_id and no name). and table C has many-to-many relationship with table B. How do i attach data from table B to table C by searching using name from table A? I know how to use a_id from table B but its weird to attach using id.
10 replies
FFilament
Created by Zetto on 8/30/2023 in #❓┊help
Array of ID to Other Values in a Table Column
I use multi select that returns an array of id in create/edit pages, how do i change it to other values when viewing it in the tables column ? Or better yet return the name instead of id in create/edit
13 replies
FFilament
Created by Zetto on 5/11/2023 in #❓┊help
Not allowing new value if certain value is selected as option (multiselect)
I am trying to use multiselect but when a certain value is selected, I want the user to not be able to add a new values unless they delete the previous one. Is this possible? For context, I am making a Post form that could make them with or without tags. I want to show them together in my homepage with Eager Loading, my solution is to add "No tags" as an actual tag (though it is not shown), so I can use "with" on my query. So in the Post form when selecting "No tags" as tag they should not be able to add another tags.
18 replies
FFilament
Created by Zetto on 3/31/2023 in #❓┊help
FileUpload with TextInput disabled.
7 replies