Pritbor
Pritbor
FFilament
Created by Pritbor on 6/20/2024 in #❓┊help
Using Filament Notification number in Frontpage notification icon
I just want to use the unread notification count to be used in bell icon present front end and when auth user clicks on it then is is routed dashbaord panel with notification sidebar open. Please help. I currently have filament dasbord with sliding bar notification panel in backend. How to proceed?
7 replies
FFilament
Created by Pritbor on 6/15/2024 in #❓┊help
How to use Grapejs in FilamentPHP
Has anyone tried Grapejs in FilamentPHP? I am aware of this plugin in Filament but it not enough documentation. https://filamentphp.com/plugins/dotswan-grapesjs .Any further help will be much appreaciated. I tried using this plugin in the field but I am getting all dump code. I
1 replies
FFilament
Created by Pritbor on 6/11/2024 in #❓┊help
Select form not retrieving data using getSearchResultsUsing()
I am using dependent selection using getSearchResultsUsing(). I am in Coupon record creation using handleRecordCreation(). And I am trying to select a user that belongs to a particular Member. In my implementation, A Member is a memberable either as an Individual user or a company. Here, I have to find all users belonging to a company memberable. My Company model has a method allUsers() that returns a collection. I am stuck in getting assigned to user.
3 replies
FFilament
Created by Pritbor on 5/28/2024 in #❓┊help
how to show a MorphOne table in filament Table?
I am struggling to access MorphOne relationship data in my table. I have Member model with MorphOne relationship with User and Company model. And I am trying display logo. But I am failing everytime. I use below code.
ImageColumn::make(function (Member $record) {
return $record->member_type === 'company' ? $record->memberable->profile->logo : $record->memberable->profile_photo_path;
})->size(200),
ImageColumn::make(function (Member $record) {
return $record->member_type === 'company' ? $record->memberable->profile->logo : $record->memberable->profile_photo_path;
})->size(200),
I get repeat error saying
Filament\Tables\Columns\Column::make(): Argument #1 ($name) must be of type string, Closure given, called in /var/www/html/app/Filament/Admin/Resources/MemberResource.php on line 103
Filament\Tables\Columns\Column::make(): Argument #1 ($name) must be of type string, Closure given, called in /var/www/html/app/Filament/Admin/Resources/MemberResource.php on line 103
.
16 replies
FFilament
Created by Pritbor on 5/17/2024 in #❓┊help
Adding Livewire in any Builder Block
How to add any livewire component in a Builder Block. I don't want to create blocks each livewire. This will be too much. So is hoping if i coult just copy paste my livewire in a TextArea field. But it is not working for me. I also tried using Livewire::make(Livewire::myclass) but it is again not working nd it hard coding the Liavewire every bock. How can i make it dynamic.
2 replies
FFilament
Created by Pritbor on 5/12/2024 in #❓┊help
Do we have any package for building navigation MenuManager
I am exploring any plugin for MenuManager. Please help. I dint find much. One plugin https://github.com/ryangjchandler/filament-navigation i found but that is not offically registerd in Filament latest version. And i tried beta version but I dint see any thing coming up in my panel. Like no navigation resource got created.
2 replies
FFilament
Created by Pritbor on 5/9/2024 in #❓┊help
How to use CreateAction while creating record
I want to use CreateAction using Modal for my record creation in resource manager. I dont want to use the existing form method in my main resource page. Unfortunately, I followed CreateAction document and applied in the CreateAction present in listing page. But it triggers the form present in the main resource page. Where I am missing?
5 replies
FFilament
Created by Pritbor on 5/9/2024 in #❓┊help
how to have Custom Select Layout during Create
No description
4 replies
FFilament
Created by Pritbor on 5/6/2024 in #❓┊help
Filament Shield not Generating Policy for Multi Guards
How to generate Policy using filament shield plugin if having multiple guards. I have two separate Authenticatble guards which i am using to login to two separate panels. Lets say Admin and User. Please help.
3 replies
FFilament
Created by Pritbor on 5/5/2024 in #❓┊help
Creating or Saving MorphTo relationship
I am aware of Form layout components supporting saving or creating relationship records from parent for MorphOne relationship. But I am specially facing difficulty. I have Member, User and Company models. Member has polymorphic 1:1 relationship with User and Company. I have morphable field ‘memberable’ in members table. Member can be either single user or a company. So I have a form in Member resource and I want to create member with User or Company creation from Member. How to go ahead. Below are my relationship methods.
In Member model
public function memberable():MorphTo
{
return $this->morphTo();
}


In User and Company Model

public function member():MorphOne
{
return $this->morphOne(Member::class, 'memberable');
}
In Member model
public function memberable():MorphTo
{
return $this->morphTo();
}


In User and Company Model

public function member():MorphOne
{
return $this->morphOne(Member::class, 'memberable');
}
2 replies
FFilament
Created by Pritbor on 5/5/2024 in #❓┊help
Can we add Additional field in Permission table in Shield
I would like to have permission with max_count field. I am using Filament Shield. I am wondering if I can add additional field in permission table generated by Shield plugin. My actual use case is to create Subscription plan attaching to each member. So subscription plan create or edit will let admin choose the resource and corresponding permissions with max_count for end user within each subscription. How to achive this? Is there a better way without touching generated Permission table. I dont want to miss the data if plugin upgrade is done.
3 replies
FFilament
Created by Pritbor on 4/22/2024 in #❓┊help
Adding different pivotData in N:N relationship
My Property and PropertyFeature has N:N relationship. And I have additional pivot table fields ( ‘number’, ‘max number’, and ‘selected_types’ as a json field).
PropertyFeature has feature 'name' and 'type' field as json. In my pivot table I want to multi-select the json data based on the available options from json 'type' field data in PropertyFeature. This i want to do while creating Property Record. I have so far below code in my Property resource file.
Forms\Components\Select::make('property_type_id')
->relationship(name: 'propertyType', titleAttribute: 'name', modifyQueryUsing: function (Builder $query, Get $get) {
$query->whereHas('propertyCategories', function ($q) use ($get) {
$q->where('property_category_id', $get('property_category_id'));
});
})
->searchable()
->preload()
->live()
->afterStateUpdated(function (Set $set) {
$set('propertyAmenities', null);
})
->required(),

Forms\Components\Select::make('propertyTypeFeatures')
->multiple()
->relationship(titleAttribute: 'name', modifyQueryUsing: function (Builder $query, Get $get) {
$query->whereHas('propertyTypes', function ($q) use ($get) {
$q->where('property_type_id', $get('property_type_id'));
});
})
->searchable()
->preload()
->required(),
Forms\Components\Select::make('property_type_id')
->relationship(name: 'propertyType', titleAttribute: 'name', modifyQueryUsing: function (Builder $query, Get $get) {
$query->whereHas('propertyCategories', function ($q) use ($get) {
$q->where('property_category_id', $get('property_category_id'));
});
})
->searchable()
->preload()
->live()
->afterStateUpdated(function (Set $set) {
$set('propertyAmenities', null);
})
->required(),

Forms\Components\Select::make('propertyTypeFeatures')
->multiple()
->relationship(titleAttribute: 'name', modifyQueryUsing: function (Builder $query, Get $get) {
$query->whereHas('propertyTypes', function ($q) use ($get) {
$q->where('property_type_id', $get('property_type_id'));
});
})
->searchable()
->preload()
->required(),
What approach I should take for making entry in pivot table for each selected PropertyTypeFeatures. And how?
4 replies
FFilament
Created by Pritbor on 4/14/2024 in #❓┊help
Using Placeholder giving error.
I am getting error "Call to a member function toFormattedDateString() on null" . This is fine because my form is not submitted to create record yet. But I am not very good in Filamentphp. How to use below then. Any specific code I can make an entry so i dont get this error.
Placeholder::make('created')
->content(fn (CompanyAvailableForSalesProfileModel $record): string => $record->created_at->toFormattedDateString())
Placeholder::make('created')
->content(fn (CompanyAvailableForSalesProfileModel $record): string => $record->created_at->toFormattedDateString())
5 replies
FFilament
Created by Pritbor on 3/28/2024 in #❓┊help
Building Alphabet pagination
I am trying to build Alphabet pagination like (All, A, B, C, D ....... Z). Has anyone tried in Filament table?
2 replies
FFilament
Created by Pritbor on 3/14/2024 in #❓┊help
ImportAction with relationship not resolving
I get validation error "The selected classifiedCategory is invalid." in my failed queue. I have ClassifiedCategory and ClassifiedSubcategory models with 1:N relationship. I have classifiedCategory() relationship method in ClassifiedSubcategory model. Instead of using ID in CSV I am trying to resolve using slug. Below is the code.

ImportColumn::make('classifiedCategory')
->relationship(resolveUsing: function (array $state): ?ClassifiedCategory{
return ClassifiedCategory::query()
->where('slug', $state)
->first();
})
->requiredMapping()
->exampleHeader('ClassifiedCategory Slug'),

ImportColumn::make('classifiedCategory')
->relationship(resolveUsing: function (array $state): ?ClassifiedCategory{
return ClassifiedCategory::query()
->where('slug', $state)
->first();
})
->requiredMapping()
->exampleHeader('ClassifiedCategory Slug'),

Resolving using ID in CSV with below code works though
ImportColumn::make('classifiedCategory')
->relationship()
->requiredMapping()
->exampleHeader('ClassifiedCategory ID'),
ImportColumn::make('classifiedCategory')
->relationship()
->requiredMapping()
->exampleHeader('ClassifiedCategory ID'),
3 replies
FFilament
Created by Pritbor on 3/7/2024 in #❓┊help
Filament Fabricator dynamic route challenge
How to create #filament-fabricator pages with dynamic routes like list pages, search pages where you use slugs or IDs in url parameter. How to find named routes for these pages, selective middleware etc.
2 replies
FFilament
Created by Pritbor on 2/23/2024 in #❓┊help
Adding Mobile OTP verification in Filament registration and login.
How to have Mobile OTP verification during Filament registration and Login. I wanted to achieve Email MustVerification and Mobile Phone must verification. It will be great if we have both on same page.
8 replies
FFilament
Created by Pritbor on 2/15/2024 in #❓┊help
Profile Picture in Panel Sidebar
I would like to display user profile picture with additional details like membership type or memberID in panel sidebar right above dashboard menu item. How to do this?
5 replies
FFilament
Created by Pritbor on 2/10/2024 in #❓┊help
Do we need Spatie Permission with Filament Shield?
I am new to the filament and came across the Filament shield package. Need your input on selecting the right stack for authentication and permission across the panel and multi-tenancy level including various modules. Filament Sheild documentation is confusing by saying "Shield is the easiest and most intuitive way to add access management to your Filament Panel's Resources, Pages & Widgets through spatie/laravel permission." Please recommend if I should use Jetstream, spatied permission and Fialment Shield all together. I have mutiple panels with multi-tenancy.
13 replies
FFilament
Created by Pritbor on 1/30/2024 in #❓┊help
Unable to create authenticated Form submit
I am using Filament Table in a Livewire component and using Table action which opens a Form. My challenge is to have this form submitted only when user is authenticated else it should redirect user to login page or register new accout and then form should appear again to submit. As an authenticated user, my action is working great. Please help. I have attached my code. Please check the requestQuoteAction() used. What do i need to do so that guest user is asked to login when then click this action button? I want to use everything Filament native if possible. This table is used in public view.
2 replies