MRBUG
Download button for file's Inside Repeater.
how can we download the any type of file that is coming from s3.
More details:
Here is the model which i am using inside Repeater
i am using Action inside the MessageResource Like that
and i am getting the url but it it's saying file does'not exist and i this this approach is not good? ``` ->actions([ //other codes ->infolist([ RepeatableEntry::make('message.messageFiles') ->schema([ ImageEntry::make('fileurl')->height(80), TextEntry::make('size') ->suffixAction( Action::make('download') ->action(function (MessageFile $record, array $data) { if ($record->fileurl) { $dd = response()->download(storage_path($record->fileurl)); } else { Log::error('File not found: ' . $record->fileurl); Notification::make() ->title('File Not Found') ->danger() ->send();
and i am getting the url but it it's saying file does'not exist and i this this approach is not good? ``` ->actions([ //other codes ->infolist([ RepeatableEntry::make('message.messageFiles') ->schema([ ImageEntry::make('fileurl')->height(80), TextEntry::make('size') ->suffixAction( Action::make('download') ->action(function (MessageFile $record, array $data) { if ($record->fileurl) { $dd = response()->download(storage_path($record->fileurl)); } else { Log::error('File not found: ' . $record->fileurl); Notification::make() ->title('File Not Found') ->danger() ->send();
11 replies
Get Name Of Table Column?
I think this is used to get data on the Table Column. From documentation
But i want little bit diffrent functionallity this is the code
Where i have name of user and Profile photo field
so i want that if user has no profile photo he will get defaultImageUrl
and i want the name of user insted of USER NAME
How can i get user name there
thank you in advance ❤️.
11 replies
avatar from s3
How to get this avatar from s3?
This code is from the documentation.https://filamentphp.com/docs/3.x/panels/users#setting-up-user-avatars
10 replies
Custom filter forms (From - Until Filter)
i am creating a filter for checking the data from the selected date to until selected date.
And in documentation we have The custom filter It's cool.
but I have another condition the date I want to filter is coming from another relation.
OK my current resource name is Transaction.
so I have a relation named payment and I am showing it's one field in transaction resource named payment_date
so i can make a filter using documentation for transaction created_at column.
like that
but i have a relation named payment and i want to filter its field payment_date in Transaction resource
BTW i used this code
so how can i do that?
THANKS IN ADVANCE.
9 replies
how can we get data into select form, from 2 relations.
i have a select form,
where i want to show names of users of the current project members and the client can Comment/message or talk with each other.
so i want a data to select form where i want to show the current project members and client names
currently i am using this where i am able to get project members names but not client name how can i get both data into one Select form.
here i my current code
Forms\Components\Select::make('user_id') ->options(ProjectMember::where('project_id', '=', $this->ownerRecord->id)->pluck('freelancer_id', 'freelancer_id'))->searchable()->required() ->required()->columnSpanFull(),here freelancer is user/projectMember so how can i get client name there and as well as i want to show freelancer.user.name not freelancer_id. thank you in advance.
11 replies
Looping names of members in a table.
in given image there is the users names are looping because of the relation but i want to do not loop it i want to put this one by one names how can we overide the relations looping functionallity. here is the codes
this is the table code from where i am getting the data like given in image.
ProjectMemberResource column data
ImageColumn::make('project.members.user.profile_photo_path') ->circular() ->grow(false) ->label(''), TextColumn::make('project.members.user.name') ->weight(FontWeight::Bold) ->searchable() ->label('User')->url(static fn (Model $record): string => FreelancerResource::getUrl('edit', ['record' => $record->freelancer_id])),and here is the relation of projectMember model
class ProjectMember extends Model
{
use HasFactory;
protected $guarded = ['id'];
protected $touches = ['project'];
public $timestamps = false;
public function project(): BelongsTo
{
return $this->belongsTo(Project::class);
}
}
and here is the Project model where i have a relation members
public function members(): BelongsToMany { return $this->belongsToMany(Freelancer::class, 'project_members'); }because of that above relation it is looping how can i solve by using filamentphp. thank you in 💌
1 replies
how can i create a user clickable and send to the edit page of the user
hii I have a table Posts in filamentphp and in this table, i have a column where I am showing the user name who created a post so I want the user name clickable and when I click to the name of the user it will send/redirect me to the users edit page how can I get this functionality in filamentPHP version 3 . please help
4 replies