DianaMujoiu
DianaMujoiu
FFilament
Created by DianaMujoiu on 4/11/2024 in #❓┊help
Spatie media library in livewire component
Hello, everyone. I am using Spatie Media Library upload. I have this component
SpatieMediaLibraryFileUpload::make('energy_invoice')
->label(__('app.resources.work_points.energy_invoices'))
->collection('energy_invoices')
->maxSize(5000)
->downloadable(),
SpatieMediaLibraryFileUpload::make('energy_invoice')
->label(__('app.resources.work_points.energy_invoices'))
->collection('energy_invoices')
->maxSize(5000)
->downloadable(),
I have this in my model
*/
class CompanyConsumption extends Model implements HasMedia
{
use HasCompany, HasFactory ,InteractsWithMedia;
*/
class CompanyConsumption extends Model implements HasMedia
{
use HasCompany, HasFactory ,InteractsWithMedia;
and the form in livewire component has this model
])->model($this->companyConsumption);
])->model($this->companyConsumption);
With all of this it seems that the upload doesn't work. It doesn't do anything. Can you assist me with this?
4 replies
FFilament
Created by DianaMujoiu on 4/10/2024 in #❓┊help
Disable months
Hello, everyone I have this TextInput and I am using it as a month calendar
TextInput::make('fuel_month_from')
->requiredIf('fuel_consumption_type', 'monthly')

->reactive()
>label(__('app.resources.work_points.from'))
->type('month')
->visible(fn (Get $get) => $get('fuel_consumption_type') === 'monthly'),
TextInput::make('fuel_month_from')
->requiredIf('fuel_consumption_type', 'monthly')

->reactive()
>label(__('app.resources.work_points.from'))
->type('month')
->visible(fn (Get $get) => $get('fuel_consumption_type') === 'monthly'),
How can I disable all months from now until over 5 years?
3 replies
FFilament
Created by DianaMujoiu on 3/26/2024 in #❓┊help
Same repeater , different extra actions
Hello everyone. I'm using the same repeater in two resources that also use the same model. The difference is in the fields they contain. The second one has more fields. Both have an extra action, but in the second repeater, it doesn't work. Do I need to add a differentiator for the second repeater? I should also mention that there's a many-to-many relationship involved.
3 replies
FFilament
Created by DianaMujoiu on 3/22/2024 in #❓┊help
Wizard on mobile
No description
2 replies
FFilament
Created by DianaMujoiu on 3/22/2024 in #❓┊help
Display only checked options
Hello everyone. I have two questions. 1. Is there a way to display only the checked options on the ViewPage instead of all available options? 2. I have a checkbox list for categories and another for fields of activities. When a category is selected, I need to display its corresponding options in the second checkbox list. This list should contain the fields of activities, grouped by the selected category, and include a placeholder that displays the category name. Is there a way to achieve this?
2 replies
FFilament
Created by DianaMujoiu on 2/29/2024 in #❓┊help
Wizard step validation
Hello, everyone. In a wizard, how can I validate only the fields from the first step? I have some required fields in the second step, and afterValidation isn't working because it tries to validate all the fields. One thing to mention: on afterValidation I want to save the data in db
2 replies
FFilament
Created by DianaMujoiu on 2/26/2024 in #❓┊help
Select in repeater
Hello everyone I have this select component in a repeater
Select::make('work_point_id')
->reactive()
->afterStateUpdated(function ($state, Set $set){
$workPoint = WorkPoint::find((int) $state);

if ($workPoint) {
$set('alias',$workPoint->alias);
$set('name',$workPoint->name);
$set('county',$workPoint->county);
$set('city',$workPoint->city);
$set('street',$workPoint->street);
$set('number',$workPoint->number);

}
})
->options(function (Get $get, $state) {
return WorkPoint::where('company_id', $get('../../company_id'))
->pluck('name', 'id');
})
->label(__('app.resources.work_points.selected_work_point')),
Select::make('work_point_id')
->reactive()
->afterStateUpdated(function ($state, Set $set){
$workPoint = WorkPoint::find((int) $state);

if ($workPoint) {
$set('alias',$workPoint->alias);
$set('name',$workPoint->name);
$set('county',$workPoint->county);
$set('city',$workPoint->city);
$set('street',$workPoint->street);
$set('number',$workPoint->number);

}
})
->options(function (Get $get, $state) {
return WorkPoint::where('company_id', $get('../../company_id'))
->pluck('name', 'id');
})
->label(__('app.resources.work_points.selected_work_point')),
When I add a new item to a repeater, I need the options in the select to exclude those already selected in other items. How can I do this?
5 replies
FFilament
Created by DianaMujoiu on 2/24/2024 in #❓┊help
Wizard height
Hello, everyone. How can I set the wizard height using hook classes. In the video I present you the wizard behavior. I want it to fit in page
22 replies
FFilament
Created by DianaMujoiu on 2/24/2024 in #❓┊help
Exclude assets from publish
Hello everyone. I'm using the Flatpickr package and encountering an issue with the monthSelect() style. I discovered that removing certain classes from the public CSS file fixes the styling, but after running php artisan filament:assets, the CSS file reverts to its original version. How can I permanently overwrite or exclude these changes?
2 replies
FFilament
Created by DianaMujoiu on 2/22/2024 in #❓┊help
Wizard "nextAction" save
Hello everyone. Is there a way to save the state of the current step when press "next" button from wizard?
38 replies
FFilament
Created by DianaMujoiu on 2/21/2024 in #❓┊help
Delete confirmation repeater
Hello, everyone. Is there a way to add a delete confirmation when the user wants to delete a repeater item?
4 replies
FFilament
Created by DianaMujoiu on 2/19/2024 in #❓┊help
Custom style for component
No description
4 replies
FFilament
Created by DianaMujoiu on 2/18/2024 in #❓┊help
Repeater issue
Hello, everyone. I am using two repeaters. When I click on the buttons to add more items, the repeater either closes or does nothing. I've attached a screen recording to show the behavior. I am using this repeater in a Livewire component
2 replies
FFilament
Created by DianaMujoiu on 2/18/2024 in #❓┊help
Custom component load form with dark theme
Hi, everyone. I've created a new Livewire component and added a form to it, but the problem is that the form is displayed in dark mode (according to the device settings), and I want it to always be in light mode
7 replies
FFilament
Created by DianaMujoiu on 2/16/2024 in #❓┊help
Tenancy or alternative?
Hello, everyone. In my app, I need to implement the following flow: people need to log in/register through the admin panel. After logging in, they will be redirected to a form that they need to fill out in the admin panel. Each user should only see their own form. Would it be advisable to do this with tenancy, or is there a quicker and easier way to achieve this?
7 replies
FFilament
Created by DianaMujoiu on 2/8/2024 in #❓┊help
A panel has been registered without an `id()`.
Hello, everyone. I have this AdminPanelProivder
<?php
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
- >viteTheme('resources/css/filament/admin/theme.css')
->plugins([
SpotlightPlugin::make(),
FilamentMediaLibrary::make()->conversionResponsive(false)
->conversionMedium(false)
->conversionSmall(false),
ThemesPlugin::make(),
FilamentFullCalendarPlugin::make()
->selectable(true)
->editable(true)
->config([
'validRange' => ['start' => Carbon::now()->toDateString()],
'eventOverlap' => false
]),
])
->default()
->id('admin')
->path('admin')
->login(Login::class)
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->colors([
'danger' => Color::Rose,
'gray' => Color::Gray,
'info' => Color::Blue,
'primary' => Color::Indigo,
'success' => Color::Emerald,
'warning' => Color::Orange,
])
->authMiddleware([
Authenticate::class,
]);
}
}
<?php
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
- >viteTheme('resources/css/filament/admin/theme.css')
->plugins([
SpotlightPlugin::make(),
FilamentMediaLibrary::make()->conversionResponsive(false)
->conversionMedium(false)
->conversionSmall(false),
ThemesPlugin::make(),
FilamentFullCalendarPlugin::make()
->selectable(true)
->editable(true)
->config([
'validRange' => ['start' => Carbon::now()->toDateString()],
'eventOverlap' => false
]),
])
->default()
->id('admin')
->path('admin')
->login(Login::class)
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->colors([
'danger' => Color::Rose,
'gray' => Color::Gray,
'info' => Color::Blue,
'primary' => Color::Indigo,
'success' => Color::Emerald,
'warning' => Color::Orange,
])
->authMiddleware([
Authenticate::class,
]);
}
}
Everything seems to be alright, but I'm still receiving the error 'A panel has been registered without an id().
5 replies
FFilament
Created by DianaMujoiu on 11/21/2023 in #❓┊help
Render modals inside custom page
I've created a custom "Calendar" page and a custom CreateReservation livewire component. This is my create-reservation blade
<div>
<form wire:submit="create">
{{ $this->form }}

<button type="submit">
Submit
</button>
</form>

<x-filament-actions::modals/>
</div>
<div>
<form wire:submit="create">
{{ $this->form }}

<button type="submit">
Submit
</button>
</form>

<x-filament-actions::modals/>
</div>
and I don't understand how can I open the form as a modal when click on a FullCalendar cell
7 replies
FFilament
Created by DianaMujoiu on 11/20/2023 in #❓┊help
Copy to clipboard on TextInput
Hello, everyone! Is there a way to add a "copy to clipboard button" to a TextInput component in a custom page?
3 replies
FFilament
Created by DianaMujoiu on 10/25/2023 in #❓┊help
Repeater with hasMany
I have this tab with french translations in a repeater. Similar with it, I have a tab for Dutch translations, the difference between them being the relationship.
->relationship('translations', function ($query) {
$query->where('language_code', 'nl')->get()->toArray();
})
->relationship('translations', function ($query) {
$query->where('language_code', 'nl')->get()->toArray();
})
The two tabs display only the Dutch translation, not the French and the Dutch one. Have you any idea how can I display the corresponding translation from relationship?
2 replies
FFilament
Created by DianaMujoiu on 10/24/2023 in #❓┊help
HasMany relationship
No description
3 replies