core
core
FFilament
Created by core on 6/2/2024 in #❓┊help
How to manage the order of the models in the GlobalSearch Results?
how does one order the resources results in the GlobalSearch?
2 replies
FFilament
Created by core on 5/8/2024 in #❓┊help
->maxLength() not working on textinput
Forms\Components\TextInput::make('note')->maxLength(2)
Forms\Components\TextInput::make('note')->maxLength(2)
this is not validating
9 replies
FFilament
Created by core on 4/10/2024 in #❓┊help
Modify Create Another Functions in a Modal Relationsmanager
I have a StepsRelationsManager, the step is incremented per title, it works fine when I use create . how do I add this functionality to create another button?
protected static string $relationship = 'steps';

public function form(Form $form): Form
{

return $form
->schema([
Forms\Components\TextInput::make('title')
->default(
Step::where('recipe_id', $this->ownerRecord->id)
->orderBy('id', 'desc')
->value('title')
)
->required()
->maxLength(255),
Forms\Components\TextInput::make('step_number')
->default(
Step::where('recipe_id', $this->ownerRecord->id)
->max('step_number') + 1
)
->numeric()
->required(),
protected static string $relationship = 'steps';

public function form(Form $form): Form
{

return $form
->schema([
Forms\Components\TextInput::make('title')
->default(
Step::where('recipe_id', $this->ownerRecord->id)
->orderBy('id', 'desc')
->value('title')
)
->required()
->maxLength(255),
Forms\Components\TextInput::make('step_number')
->default(
Step::where('recipe_id', $this->ownerRecord->id)
->max('step_number') + 1
)
->numeric()
->required(),
2 replies
FFilament
Created by core on 3/14/2024 in #❓┊help
How can customize the ImageColumn to get Cloudfront instead of S3?
can you customize the image source on the ImageColumn ? images are uploaded to the S3 but I want to consume them via the Cloudfront distribution?
4 replies
FFilament
Created by core on 3/10/2024 in #❓┊help
help with S3 and filament and Larvel Vapor
so I have this weird status: I have 2 environments staging and testing deployed on vapor. both have the same storage s3 in the vapor.yml. on staging it uploads and on testing it is stuck on the uploading of the FileUpload form component. anyone experience with this?
2 replies
FFilament
Created by core on 3/6/2024 in #❓┊help
file uploading to S3 on vapor stuck on uploading
I have set a new server on Laravel Vapor, the S3 was generated by vapor with full public access, the image upload is stuck on uploading. Any advise?
3 replies
FFilament
Created by core on 2/22/2024 in #❓┊help
Search by lowercase in Table not working with Spatie Translate json column
How can I configure the TableSearchQuery to be case-insensitve in a Filament Resource?
Tables\Columns\TextColumn::make('name')->searchable(),
Tables\Columns\TextColumn::make('name')->searchable(),
12 replies
FFilament
Created by core on 2/15/2024 in #❓┊help
globalsearch - custom query - returns result but no URL to edit page
i have tweaked the getGlobalSearchResults, i get the results but it not clickable
protected static ?string $recordTitleAttribute = 'translations.title';
public static function getGlobalSearchResults(string $search): Collection
{
return static::getModel()::query()
->whereHas('translations', function ($query) use ($search) {
$query->where('title', 'like', '%'.$search.'%');
})
->get();

}

public static function getRecordUrl(Model $record): ?string
{
return static::getUrl('edit', ['record' => $record]);
}
protected static ?string $recordTitleAttribute = 'translations.title';
public static function getGlobalSearchResults(string $search): Collection
{
return static::getModel()::query()
->whereHas('translations', function ($query) use ($search) {
$query->where('title', 'like', '%'.$search.'%');
})
->get();

}

public static function getRecordUrl(Model $record): ?string
{
return static::getUrl('edit', ['record' => $record]);
}
3 replies
FFilament
Created by core on 2/8/2024 in #❓┊help
regex format lowercase validation on Spatie Tags Input not working on input
I want to accept only lowercase entries as this package saves in a json column the entries are not unique so I can get multiple entries for the same tag
use Filament\Forms\Components\SpatieTagsInput;

Forms\Components\Section::make('Recipe Tags')
->schema([
SpatieTagsInput::make('tags')
->regex('/^[a-z0-9_\-]+$/')
->validationMessages([
'regex' => 'The :attribute format should be lowercase, numbers, underscores, and hyphens only.',
])
->type('recipe'),
]),
use Filament\Forms\Components\SpatieTagsInput;

Forms\Components\Section::make('Recipe Tags')
->schema([
SpatieTagsInput::make('tags')
->regex('/^[a-z0-9_\-]+$/')
->validationMessages([
'regex' => 'The :attribute format should be lowercase, numbers, underscores, and hyphens only.',
])
->type('recipe'),
]),
inside the RecipeResource , i get the message on lowercase inputs because it's json, so I need to take care of it after the saved method
2 replies
FFilament
Created by core on 1/22/2024 in #❓┊help
How to place Action Button on Resource Form by the Delete Button?
I have the following Action in side a form, how can I add the button along side the Delete button?
return $form->schema([
Forms\Components\Group::make()
->schema([

Forms\Components\Section::make('Recipe Info')
->schema([
Forms\Components\Actions::make([
Forms\Components\Actions\Action::make('export PDF')
->label('PDF')
->color('success')
->url(fn (Recipe $record) => route('pdf', $record))
->openUrlInNewTab(),
]),
return $form->schema([
Forms\Components\Group::make()
->schema([

Forms\Components\Section::make('Recipe Info')
->schema([
Forms\Components\Actions::make([
Forms\Components\Actions\Action::make('export PDF')
->label('PDF')
->color('success')
->url(fn (Recipe $record) => route('pdf', $record))
->openUrlInNewTab(),
]),
5 replies
FFilament
Created by core on 1/9/2024 in #❓┊help
Is there an Edit option for : createOptionForm()
This is a neat trick but what if you do not want an extra resource or you have a typo? How do you edit it?
4 replies
FFilament
Created by core on 1/1/2024 in #❓┊help
Issue after update to 3.1
i did a composer update and I am getting this error on the createpage of all the resources:
trim(): Argument #1 ($string) must be of type string, array given
trim(): Argument #1 ($string) must be of type string, array given
54 replies
FFilament
Created by core on 12/21/2023 in #❓┊help
How to use Table sortable() with Translatable?
I have a json column Translatable Model, how do set the order by/sortable()'
Tables\Columns\TextColumn::make('name')
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('name')
->sortable()
->searchable(),
sortable() doesn't play nice with it, I am using :Spatie Translatable
3 replies
FFilament
Created by core on 12/10/2023 in #❓┊help
Forms\Components\Select: relationship with json column list?
No description
5 replies
FFilament
Created by core on 12/4/2023 in #❓┊help
spatie tags translate and get by locale
I have a resource that saves inputs by the locale correctly, I have a '''SpatieTagsInput::make('tags') ->type('recipe'),''', what do I need to config for it to store, switch by locale?
5 replies
FFilament
Created by core on 12/4/2023 in #❓┊help
Pros and Cons for Translations DB schema: json vs dedicated tables
I need to decide on my DB schema, I have a DB with multiple pivots and a lot of eager loading using with(), I know json can complicate the queries and add performance overhead. How significant is it? Looking into spatie/laravel-translatable and astrotomic/laravel-translatable. And is there a a package for the latter?
22 replies
FFilament
Created by core on 11/21/2023 in #❓┊help
select not getting live() input
I am trying to use reactive (live() inputs inside a wizard form and in it I have a repeater , for some reason I get null for
Select::make('cuisine_id')
->required()
->relationship('cuisines', 'name')
->live(),
Select::make('cuisine_id')
->required()
->relationship('cuisines', 'name')
->live(),
Wizard\Step::make('Group Recipes')
->schema([
Repeater::make('recipes')
->relationship('recipes')
->schema([
Select::make('recipe_id')
->searchable()
->options(function (Get $get): Collection {
$cuisineId = $get('cuisine_id');
\Log::info('Cuisine ID:', [$get('cuisine_id')]);
if ($cuisineId) {
return Recipe::query()
->where('cuisine_id', $cuisineId)
->pluck('title', 'id');
}
}),
Wizard\Step::make('Group Recipes')
->schema([
Repeater::make('recipes')
->relationship('recipes')
->schema([
Select::make('recipe_id')
->searchable()
->options(function (Get $get): Collection {
$cuisineId = $get('cuisine_id');
\Log::info('Cuisine ID:', [$get('cuisine_id')]);
if ($cuisineId) {
return Recipe::query()
->where('cuisine_id', $cuisineId)
->pluck('title', 'id');
}
}),
3 replies
FFilament
Created by core on 11/19/2023 in #❓┊help
observer not triggered from EditAction
I have this editaction in a relationsmanager it's updating correctly the pivot attributes but not triggering an updating() observer
->using(function (Model $record, array $data): Model {

$record->pivot->update($data);

return $record;
}),
->using(function (Model $record, array $data): Model {

$record->pivot->update($data);

return $record;
}),
21 replies
FFilament
Created by core on 11/13/2023 in #❓┊help
Pass Param to livewire component via action to modal
I am having an issue passing a param to a livewire component inside a modal , the modal itself works and plays the video when hard coded: https://gist.github.com/devcbash/a2f99d4c46fbe5a6515bd02fbc7d12dc
4 replies
FFilament
Created by core on 11/7/2023 in #❓┊help
New Trait on model blocking ProductResource Index Page
Strange behaviour: I added the :use BinaryCats\Sku\HasSku;, into my Product Model. http://example.test/admin/products I get connection timed out with no errors in the browser or logs. http://example.test/admin/products/create works with the trait and generates the sku field correctly
4 replies