Tjiel
Tjiel
FFilament
Created by Tjiel on 11/26/2024 in #❓┊help
How can I create a checkbox filter that includes more records when active
Thanks for the help, I've implemented it the following way
Tables\Filters\Filter::make('show_inactive')
->form([
Checkbox::make('show_inactive'),
])->query(function (Builder $query, array $data) {
if (!$data['show_inactive']) {
$query->whereNotIn('status', [Status::Inactive]);
}
return $query;
})
Tables\Filters\Filter::make('show_inactive')
->form([
Checkbox::make('show_inactive'),
])->query(function (Builder $query, array $data) {
if (!$data['show_inactive']) {
$query->whereNotIn('status', [Status::Inactive]);
}
return $query;
})
5 replies
FFilament
Created by Tjiel on 10/25/2024 in #❓┊help
How can I change the width of individual statsoverview stats?
@paanblogger Thanks for the help! This is exactly what I was looking for
7 replies
FFilament
Created by Tjiel on 10/25/2024 in #❓┊help
How can I change the width of individual statsoverview stats?
I already tried doing something with getHeaderColumns but then the problem is that i can't change the individual size of the stats. So for example if I set the columns to 2 like this:
public function getHeaderWidgetsColumns(): int|string|array
{
return 2;
}
public function getHeaderWidgetsColumns(): int|string|array
{
return 2;
}
and then adjust the columnSpan in the stats widget like this:
protected int | string | array $columnSpan = 1;
protected int | string | array $columnSpan = 1;
Each stat will now only be 1/6 of the width. This is because the columnSpan variable is not for a single stat but instead for the whole widget. So it could work this way if there was a way to specify a columnspan for an individial stat. Which I can't seem to find.
7 replies
FFilament
Created by Tjiel on 9/26/2024 in #❓┊help
Spatie tag name text input field
Found the solution I was stupid and it was because of the unique, the name and tags should be the other way around.
Forms\Components\TextInput::make('name.nl')
->label('Name')
->translateLabel()
->required()
->unique('tags', 'name')
->maxLength(255),
Forms\Components\TextInput::make('name.nl')
->label('Name')
->translateLabel()
->required()
->unique('tags', 'name')
->maxLength(255),
6 replies
FFilament
Created by Tjiel on 9/26/2024 in #❓┊help
Spatie tag name text input field
@toeknee im using the original model
6 replies
FFilament
Created by Tjiel on 8/28/2024 in #❓┊help
Looking for a way to search table based on custom state
Yeah I found a different way, I forgot to post it here, anyway better late then never:
->searchable(query: function (Builder $query, string $search): Builder {
$objectIds = Object::where('name', 'like', "%{$search}%")->pluck('id');
return $query
->whereHas('mainObject', function (Builder $query) use ($search, $objectIds) {
->whereIn('object_id', $productIds);
});
})
->searchable(query: function (Builder $query, string $search): Builder {
$objectIds = Object::where('name', 'like', "%{$search}%")->pluck('id');
return $query
->whereHas('mainObject', function (Builder $query) use ($search, $objectIds) {
->whereIn('object_id', $productIds);
});
})
6 replies
FFilament
Created by Tjiel on 8/28/2024 in #❓┊help
Looking for a way to search table based on custom state
Ty for the response, based on your suggestion I have tried the following:
TextColumn::make('object')
->label('Rentable product')
->translateLabel()
->searchable(query: function (Builder $query, string $search): Builder {
return $query
->join('objects', 'resourceModels.object_id', '=', 'objects.id')
->where('objects.name', 'like', "%{$search}%");
});
})
TextColumn::make('object')
->label('Rentable product')
->translateLabel()
->searchable(query: function (Builder $query, string $search): Builder {
return $query
->join('objects', 'resourceModels.object_id', '=', 'objects.id')
->where('objects.name', 'like', "%{$search}%");
});
})
But whenever I try to search I get an unknown column 'objects.name' error. ResourceModels is a placeholder for the table name of the resource this column is for.
6 replies
FFilament
Created by Tjiel on 7/26/2024 in #❓┊help
Accessing the state of the repeater from inside the repeater
Thanks for suggesting although $get('../questions') did not work $get('../../questions') does, now I only need to find a way to exclude the current question.
4 replies
FFilament
Created by Tjiel on 7/15/2024 in #❓┊help
Removal of scrollbar in the sidebar
I want to make the scrollbar hidden (or try to change the style so it fits the rest of the pages styling better). But ill have a look at your recomended package, maybe I could use it to achieve my goal.
4 replies
FFilament
Created by Tjiel on 7/11/2024 in #❓┊help
Updating placeholder text afterStateUpdated
Ty for the help, I have implemented it the following way:
TextInput::make('name')
->label('Name')
->translateLabel()
->live()
->placeholder(fn (Get $get) => $get('product_id') ? Product::find($get('product_id'))->name : ''),
TextInput::make('name')
->label('Name')
->translateLabel()
->live()
->placeholder(fn (Get $get) => $get('product_id') ? Product::find($get('product_id'))->name : ''),
6 replies
FFilament
Created by Tjiel on 6/11/2024 in #❓┊help
Looking for a way to change the logo based on the tenant.
Thanks so much for the suggestion, although Filament::getPanel() did not work for my situation, Filament::getCurrentPanel() did work. I have added it the following way.
Filament::getCurrentPanel()->brandLogo($tenant->image);
Filament::getCurrentPanel()->brandLogo($tenant->image);
4 replies
FFilament
Created by Tjiel on 6/7/2024 in #❓┊help
Is there a way to use the filament colors in a custom theme
Ty both for the effort
17 replies
FFilament
Created by Tjiel on 6/7/2024 in #❓┊help
Is there a way to use the filament colors in a custom theme
Thanks, this is what I was looking for
17 replies
FFilament
Created by Tjiel on 6/7/2024 in #❓┊help
Is there a way to use the filament colors in a custom theme
When inspecting the page I can't find the --primaryColor variable, even if I change the color to just be blue (which does turn the background to blue)
17 replies
FFilament
Created by Tjiel on 6/7/2024 in #❓┊help
Is there a way to use the filament colors in a custom theme
In the panel provider the default primary collor is set the following way:
->colors([
'primary' => Color::Amber,
])
->colors([
'primary' => Color::Amber,
])
So I guess the white color means it probably didn't get any color from --primary at all
17 replies
FFilament
Created by Tjiel on 6/7/2024 in #❓┊help
Is there a way to use the filament colors in a custom theme
I have tried it like this now:
:root {
--primaryColor: --primary;
}

.fi-sidebar-header, .fi-topbar > nav {
background-color: var(--primaryColor);
}
:root {
--primaryColor: --primary;
}

.fi-sidebar-header, .fi-topbar > nav {
background-color: var(--primaryColor);
}
and the background color is just white, even though icons and other stuff in filament is using the correct primary color. Do you have any idea what im doing wrong here?
17 replies
FFilament
Created by Tjiel on 6/7/2024 in #❓┊help
Is there a way to use the filament colors in a custom theme
@Dennis Koch Could you maybe explain how I could use CSS Vars to use for example the primary filament color in the theme.css. I have looked it up and I only could find something like the following:
:root {
--blue: #1e90ff;
--white: #ffffff;
}

body { background-color: var(--blue); }
:root {
--blue: #1e90ff;
--white: #ffffff;
}

body { background-color: var(--blue); }
Which is indeed nice but doesn't help me get the filament primary color as a var
17 replies
FFilament
Created by Tjiel on 6/5/2024 in #❓┊help
Looking for a way to get a time range value input field
The project already has been deployed and I need the data to go with me to the filament version.
9 replies
FFilament
Created by Tjiel on 6/5/2024 in #❓┊help
Looking for a way to get a time range value input field
@toeknee Ty for the response, the table-repeater indeed is better for my intended purpose. The issue what im having is still kind of the same. Using a variations on the code you just send the opening hours saved is the following: {"monday":[{"start":"07:00","end":"23:00"},{"start":"08:30","end":"22:00"}]}. Which would fine, if I didn't need to keep the old data that has been created using the nova forms. Which is the following: {"monday":[],"tuesday":[],"wednesday":["12:00-14:00"],"thursday":[],"friday":[],"saturday":[],"sunday":[],"exceptions":[]}
9 replies
FFilament
Created by Tjiel on 5/27/2024 in #❓┊help
How to change capitalization on model label?
That must be it, Il give an update whenever I have time to upgrade it to a higher version. Thanks for helping me out.
13 replies