KiaBoluki
KiaBoluki
FFilament
Created by KiaBoluki on 1/13/2024 in #❓┊help
how to set max repeat for a repeater
Thank you this is actually what I was looking for. unfortunately it is not in the documentation. I couldn't find it there at least.
6 replies
FFilament
Created by KiaBoluki on 1/13/2024 in #❓┊help
how to set max repeat for a repeater
Thank you for your reply. the main reason is the images and the product models have a one-to-many relationship and the number of images is varied. at least one image is required and the other two images are optional so I decided to give the user the option the number of images they want to upload for their product . I think the repeater is a good tool for this .
6 replies
FFilament
Created by KiaBoluki on 12/15/2023 in #❓┊help
stripCharacters() method not found on TextInput
7 replies
FFilament
Created by KiaBoluki on 11/16/2023 in #❓┊help
where can I set the redirect url after user logout?
finally I solved by naming the login redirect route :
Route::get('/admin/login', function () {
return redirect()->to('login');
})->name('filament.admin.auth.login');
Route::get('/admin/login', function () {
return redirect()->to('login');
})->name('filament.admin.auth.login');
7 replies
FFilament
Created by KiaBoluki on 11/16/2023 in #❓┊help
where can I set the redirect url after user logout?
it works fine when I logout from home page but the problem is when I try to logout from /admin panel
7 replies
FFilament
Created by KiaBoluki on 11/16/2023 in #❓┊help
where can I set the redirect url after user logout?
Thank you for your reply. I tried it this way :
Route::get('/admin/login', function () {
return redirect()->to('login');
});
Route::get('/admin/login', function () {
return redirect()->to('login');
});
but it throws this error :
// Symfony\Component\Routing\Exception\RouteNotFoundException
// PHP 8.2.4
// Laravel 10.30.1
Route [filament.admin.auth.login] not defined.
// Symfony\Component\Routing\Exception\RouteNotFoundException
// PHP 8.2.4
// Laravel 10.30.1
Route [filament.admin.auth.login] not defined.
I also tried to create a view in this path: resources/views/filament/admin/auth/login.blade.php and this path : resources/views/filament/pages/admin/auth/login.blade.php but it does'nt work too.
7 replies
FFilament
Created by KiaBoluki on 8/24/2023 in #❓┊help
is it possible to make a filament resource based on scope ?
oh my god 😲 the slug was the solution. thank you so much . 💐
6 replies
FFilament
Created by KiaBoluki on 8/20/2023 in #❓┊help
use avatar and user menu component in home page nav bar
Thank you , it was silly question. I found it :
<x-filament::layouts.app.topbar.user-menu />
<x-filament::layouts.app.topbar.user-menu />
4 replies
FFilament
Created by KiaBoluki on 7/26/2023 in #❓┊help
is it possible to disable form while image is uploading?
@Leandro Ferreira Your hint was helpful. I solved it this way:
namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Filament\Forms\Components\Component;

class FilamentProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
//
}

/**
* Bootstrap services.
*/
public function boot(): void
{
Component::configureUsing(function (Component $component){
if ( method_exists($component::class , 'extraAlpineAttributes' ) )

$component->extraAlpineAttributes([':disabled' => 'isUploadingFile']);

});
}
}
namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Filament\Forms\Components\Component;

class FilamentProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
//
}

/**
* Bootstrap services.
*/
public function boot(): void
{
Component::configureUsing(function (Component $component){
if ( method_exists($component::class , 'extraAlpineAttributes' ) )

$component->extraAlpineAttributes([':disabled' => 'isUploadingFile']);

});
}
}
I am not sure if it is the best practice . but it seems works. thank you.
8 replies
FFilament
Created by KiaBoluki on 7/26/2023 in #❓┊help
is it possible to disable form while image is uploading?
Yeah, it works by field. However, I'm curious to find a way to disable the form while the form is uploading file. Perhaps a trait for all models would be nice to achieve this. You know, I have a lot of forms and fields in the app.
8 replies
FFilament
Created by KiaBoluki on 7/26/2023 in #❓┊help
is it possible to disable form while image is uploading?
@Leandro Ferreira Thanks for reply. but the form doesn't have this method. I need to add this method to all fields in the form.
Call to undefined method Filament\Resources\Form::extraAlpineAttributes()
8 replies
FFilament
Created by DianaMujoiu on 6/23/2023 in #❓┊help
CheckboxList group options
@dianamujoiu try this:
...
->options( fn () => // add a closure
RealEstateAmenity::all()
->groupBy('is_searchable')
->map(function ($amenitiesGroup) {
return $amenitiesGroup->pluck('name', 'id');
})->toArray())
...
->options( fn () => // add a closure
RealEstateAmenity::all()
->groupBy('is_searchable')
->map(function ($amenitiesGroup) {
return $amenitiesGroup->pluck('name', 'id');
})->toArray())
21 replies
FFilament
Created by KiaBoluki on 7/11/2023 in #❓┊help
Add action buttons to custom page with HasForms
Thank you so much! Your hint was really helpful, and I managed to solve it using the following approach:
public function getCachedFormAction(string $name): ?\Filament\pages\Actions\Action
{
if ($name === 'submit') {
return \Filament\pages\Actions\Action::make('create')
->label('Save')
->action(fn () => true )
->extraAttributes([
'wire:click' => 'submit',
])
->icon('heroicon-s-upload');
}
}
public function getCachedFormAction(string $name): ?\Filament\pages\Actions\Action
{
if ($name === 'submit') {
return \Filament\pages\Actions\Action::make('create')
->label('Save')
->action(fn () => true )
->extraAttributes([
'wire:click' => 'submit',
])
->icon('heroicon-s-upload');
}
}
and I added this line to the view
{{ $this->getCachedFormAction('submit') }}
{{ $this->getCachedFormAction('submit') }}
and it works .
8 replies
FFilament
Created by KiaBoluki on 7/11/2023 in #❓┊help
Add action buttons to custom page with HasForms
8 replies
FFilament
Created by KiaBoluki on 7/11/2023 in #❓┊help
Add action buttons to custom page with HasForms
Thank you for response, but this code will add a button to the page. I want to add the action button at bottom of the form . I can make it with a
<x-filament::button icon="heroicon-o-upload" type="submit">Save</x-filament::button>
<x-filament::button icon="heroicon-o-upload" type="submit">Save</x-filament::button>
but this button does'nt act like a defult action.
8 replies