mile4841
mile4841
FFilament
Created by mile4841 on 9/18/2024 in #❓┊help
How to re render the table
Is it possible when i update the state of mine form to re render table mine code is
4 replies
FFilament
Created by mile4841 on 9/17/2024 in #❓┊help
live method is rendering mine table
Hi! I have a custom filament page where i have on the same page form and table and when i press button which is form action everythin works fine. mine problem happend after first submit button than i have case when i change state of component that has live mine table re renders how i can stop re rendering table on change state of component
11 replies
FFilament
Created by mile4841 on 9/17/2024 in #❓┊help
Live method is calling mine action
Hi everyone i have a case where when i change the value of the component that is live mine action is called like i press the button, how i can stop that. Mine form
6 replies
FFilament
Created by mile4841 on 9/16/2024 in #❓┊help
Validation for custom page
Hello everyone i have a case where when time is filled with value interval start_date and end_date must be filled how i can add validation for this case
14 replies
FFilament
Created by mile4841 on 9/16/2024 in #❓┊help
I am getting an error for the custom filament page
No description
10 replies
FFilament
Created by mile4841 on 9/16/2024 in #❓┊help
Is it possible that based on the value of the component other component is not visible
Hi everyone how i can make that when mine component radio value is interval then i show mine component when is something else do not show
9 replies
FFilament
Created by mile4841 on 9/12/2024 in #❓┊help
Tiptap editor hint to the link
Is it possible to add the hint at the link like down below on the image. I want to add link must be in format http....
3 replies
FFilament
Created by mile4841 on 9/12/2024 in #❓┊help
Why modalFooterActions can not register an third action
I would like to have three buttons on mine slide over how i can make it? i look but it does not render mine three buttons just two what i should do so i can make it i have three buttons
->actions([
Tables\Actions\EditAction::make()
->slideOver()
->modalHeading(function(Team $teamMember){
return "Edit " . $teamMember->name['en'];
})
->modalFooterActions(function($action){
return [
Actions\Action::make('cancel')
->extraAttributes(['class' => 'secondary-btn'])
->action(function () {
$this->validate();
$this->save();
}),
Actions\Action::make('save and keep editing')
->extraAttributes(['class' => 'secondary-btn'])
->action(function () {
$this->validate();
$this->save();
}),
Actions\Action::make('save changes')
->extraAttributes(['class' => 'secondary-btn'])
->action(function () {
$this->validate();
$this->save();
}),
];
}),
->actions([
Tables\Actions\EditAction::make()
->slideOver()
->modalHeading(function(Team $teamMember){
return "Edit " . $teamMember->name['en'];
})
->modalFooterActions(function($action){
return [
Actions\Action::make('cancel')
->extraAttributes(['class' => 'secondary-btn'])
->action(function () {
$this->validate();
$this->save();
}),
Actions\Action::make('save and keep editing')
->extraAttributes(['class' => 'secondary-btn'])
->action(function () {
$this->validate();
$this->save();
}),
Actions\Action::make('save changes')
->extraAttributes(['class' => 'secondary-btn'])
->action(function () {
$this->validate();
$this->save();
}),
];
}),
13 replies
FFilament
Created by mile4841 on 9/12/2024 in #❓┊help
Remove delete on record
Is it possible that i disable option of delete on the record, i tried with these
Tables\Actions\DeleteAction::make()
->hidden(fn ($record) => $record->name === 'admin')
Tables\Actions\DeleteAction::make()
->hidden(fn ($record) => $record->name === 'admin')
but when user go into edit user he can press the command ctrl + D and delete record is it possible to remove this shoertcut or to remove delete or something else
2 replies
FFilament
Created by mile4841 on 9/11/2024 in #❓┊help
How in tiptap editor to set maxLength
I am using the tiptap editor and somehow when i set the maxLength for the content i get the error that there is not a function maxLength, i search in docs but there is not a function for the limit of content so what i should do
8 replies
FFilament
Created by mile4841 on 9/3/2024 in #❓┊help
Disable text input
Hi i have a problem i have a text input that is price and it could not be change, user can see it but not change. MIne problem comes when i want to save data i get the sql error that i have no value for price. How to solve these i can not use mutateDataBeforeCreate because i am using the slideOver.
5 replies
FFilament
Created by mile4841 on 9/3/2024 in #❓┊help
Why wrap is not working on the textcolumn
Hi everyone i am using text column to show mine note but the problem when text is longer it breaks the table and somehow ->wrap(true) is not working. What is here a problem
Tables\Columns\TextColumn::make('notes')
->label(__('table.notes'))
->copyable()
->wrap(true),
Tables\Columns\TextColumn::make('notes')
->label(__('table.notes'))
->copyable()
->wrap(true),
2 replies
FFilament
Created by mile4841 on 8/29/2024 in #❓┊help
How in richeditor to add option open link in new tab or not
Hi everyone mine question is in the heading. Does anybody knows how i can do this
2 replies
FFilament
Created by mile4841 on 8/27/2024 in #❓┊help
How to order naviation groups
Hi everyone is there a way i can reorder navigation groups for now if i am using the navigationSort is not working
14 replies
FFilament
Created by mile4841 on 8/26/2024 in #❓┊help
How to modify global search
Hi i would like to modify global search i want when user type something i take user input call mine class and then return the user input. Is this possible. On this discord question i said why i need these.
3 replies
FFilament
Created by mile4841 on 8/23/2024 in #❓┊help
Why selectColumn is not working
Hi i am using the plugin Shield, and i want in mine resource User to be able to change role. I made custom Role model which extends Spatie model, and i added a relationship to the user. Mine problem is that select column is not recognize mine relationship or something like that also i can not add default value for the select column.


use Spatie\Permission\Models\Role as SpatieRole;
class Role extends SpatieRole
{
// relationships
public function user() :HasMany
{
return $this->hasMany(User::class);
}
}


use Spatie\Permission\Models\Role as SpatieRole;
class Role extends SpatieRole
{
// relationships
public function user() :HasMany
{
return $this->hasMany(User::class);
}
}
User model
public function role()
{
return $this->belongsTo(Role::class);
}
public function role()
{
return $this->belongsTo(Role::class);
}
User table
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name')
->searchable(),
Tables\Columns\TextColumn::make('email')
->searchable(),

Tables\Columns\SelectColumn::make('role')
->searchable(),

Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name')
->searchable(),
Tables\Columns\TextColumn::make('email')
->searchable(),

Tables\Columns\SelectColumn::make('role')
->searchable(),

Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
}
8 replies
FFilament
Created by mile4841 on 8/22/2024 in #❓┊help
Is it possible to disable to select a record in bulk action or somehow to disable delete bulk action
I have table with roles, roles can be edited but not all roles can be deleted i want to disable the option of deleting the role with name admin i did in table but i am not able to stop delete role with bulk action delete is it possible to disable the delete bulk action on some record or disable the select the record
11 replies
FFilament
Created by mile4841 on 8/22/2024 in #❓┊help
Why does TextInput does not want to save value
Hi everyone i have a problem where mine textinput does not want to save the value i enter. This is how i made the textinput

public static function form(Form $form): Form
{
return $form
->schema(Project::getForm())->columns(1);
}
// admin panel form
public static function getForm():array
{
return [
Tabs::make()->schema(Project::makeTabs()),

private static function makeTabs()
{
$tabs = [];
$languages = Languages::cases();
foreach($languages as $lang)
{
$tabs[] = Tab::make(Languages::getFullName($lang->name))
->schema([
TextInput::make("contents.{$lang->value}.title")
->required()
->maxLength(50)
->afterStateHydrated(function (TextInput $component, $state, $record) use ($lang) {
if($record){
$content = $record->contents()->language($lang->value)->first();
$component->state($content->title ?? null);
}
})

public static function form(Form $form): Form
{
return $form
->schema(Project::getForm())->columns(1);
}
// admin panel form
public static function getForm():array
{
return [
Tabs::make()->schema(Project::makeTabs()),

private static function makeTabs()
{
$tabs = [];
$languages = Languages::cases();
foreach($languages as $lang)
{
$tabs[] = Tab::make(Languages::getFullName($lang->name))
->schema([
TextInput::make("contents.{$lang->value}.title")
->required()
->maxLength(50)
->afterStateHydrated(function (TextInput $component, $state, $record) use ($lang) {
if($record){
$content = $record->contents()->language($lang->value)->first();
$component->state($content->title ?? null);
}
})
7 replies
FFilament
Created by mile4841 on 8/22/2024 in #❓┊help
How to set global search to search multilingual data
Hi i have a case where i want search multilingual website where in mine db for example column name values are in the form of json like
[
'en' => 'English name',
'gm' => 'German name',
'nl' => 'Dutch name',
]
[
'en' => 'English name',
'gm' => 'German name',
'nl' => 'Dutch name',
]
so how i can know search for german name etc... If i use dot notation in $recordTitleAttribute it will search for relationship and i will get the error is there a way i can do this. Mine problem is now that in mine db some letters are converted to the unicode values, so mine search is not working properly, i need to have something that will stop mine search(db query) and here i will make some logic. So i need to stop db query or to continue to search to see is this other language and convert it to the unicode values
2 replies
FFilament
Created by mile4841 on 8/21/2024 in #❓┊help
How to preload select
Hi i have a problem where i made mine select with down below code how i can now preload it? preload(true) is not working
Select::make('project_id')
->preload(true)
->label('Project')
->searchable()
->getSearchResultsUsing(function (string $search) use ($lang) {
return Project::with(['contents' => function ($query) use($lang) {
$query->where('language', $lang->value);
}])
->whereHas('contents', function ($query) use ($search, $lang) {
$query->where('title', 'like', "%{$search}%")->where('language', $lang->value);
})
->get()
->mapWithKeys(function ($project) use($lang) {
$firstTitle = $project->contents->where('language', $lang->value)->pluck('title')->first();
return [$project->id => $firstTitle];
});
})
->getOptionLabelUsing(function ($value) use($lang) {
$project = Project::with(['contents' => function ($query) use($lang) {
$query->where('language', $lang->value);
}])->find($value);
return $project ? $project->contents->pluck('title')->first() : '';
})
->required(),
Select::make('project_id')
->preload(true)
->label('Project')
->searchable()
->getSearchResultsUsing(function (string $search) use ($lang) {
return Project::with(['contents' => function ($query) use($lang) {
$query->where('language', $lang->value);
}])
->whereHas('contents', function ($query) use ($search, $lang) {
$query->where('title', 'like', "%{$search}%")->where('language', $lang->value);
})
->get()
->mapWithKeys(function ($project) use($lang) {
$firstTitle = $project->contents->where('language', $lang->value)->pluck('title')->first();
return [$project->id => $firstTitle];
});
})
->getOptionLabelUsing(function ($value) use($lang) {
$project = Project::with(['contents' => function ($query) use($lang) {
$query->where('language', $lang->value);
}])->find($value);
return $project ? $project->contents->pluck('title')->first() : '';
})
->required(),
8 replies