ahmant
ahmant
Explore posts from servers
FFilament
Created by ahmant on 5/15/2024 in #❓┊help
Collapse list page widgets
Ok then, I will create a custom one, and let you know the results
7 replies
FFilament
Created by ahmant on 5/15/2024 in #❓┊help
Collapse list page widgets
I want to collapse them in group. Can you tell me which view should I update? Or if I need to create a custom widget, can we create a widget that will contains other widgets? I read these pages: - https://filamentphp.com/docs/3.x/panels/resources/widgets#creating-a-resource-widget - https://filamentphp.com/docs/3.x/support/plugins/build-a-panel-plugin#step-4-create-the-widget But I didn't find a way to da that
7 replies
FFilament
Created by ahmant on 5/15/2024 in #❓┊help
Collapse list page widgets
Any one can help?
7 replies
FFilament
Created by Algorithm on 1/17/2024 in #❓┊help
Custom page and spatie translatable
Setting custom page app\Filament\Resources\SettingResource\Pages\Setting.php
7 replies
FFilament
Created by Algorithm on 1/17/2024 in #❓┊help
Custom page and spatie translatable
SettingResource.php
<?php

namespace App\Filament\Resources;

use App\Filament\Resources\SettingResource\Pages;
use App\Models\Setting;
use Filament\Resources\Concerns\Translatable;
use Filament\Forms\Form;
use Filament\Resources\Resource;

class SettingResource extends Resource
{
use Translatable;

protected static ?string $model = Setting::class;

protected static ?string $navigationIcon = 'heroicon-o-cog';

public static $sectionKeySeparator = '--';

public static function form(Form $form): Form
{
return $form->schema([]);
}

public static function getTranslatableAttributes(): array
{
$sectionKeySeparator = static::$sectionKeySeparator;
return [
"general{$sectionKeySeparator}website_name",
];
}

public static function getPages(): array
{
return [
'index' => Pages\Setting::route('/'),
];
}
}
<?php

namespace App\Filament\Resources;

use App\Filament\Resources\SettingResource\Pages;
use App\Models\Setting;
use Filament\Resources\Concerns\Translatable;
use Filament\Forms\Form;
use Filament\Resources\Resource;

class SettingResource extends Resource
{
use Translatable;

protected static ?string $model = Setting::class;

protected static ?string $navigationIcon = 'heroicon-o-cog';

public static $sectionKeySeparator = '--';

public static function form(Form $form): Form
{
return $form->schema([]);
}

public static function getTranslatableAttributes(): array
{
$sectionKeySeparator = static::$sectionKeySeparator;
return [
"general{$sectionKeySeparator}website_name",
];
}

public static function getPages(): array
{
return [
'index' => Pages\Setting::route('/'),
];
}
}
7 replies
FFilament
Created by Algorithm on 1/17/2024 in #❓┊help
Custom page and spatie translatable
Hello all, I am using "Spatie Translatable" on my custom "Setting" page, you can take a look on my code and get some idea on how you can set your own, for your custom page. And I am verry sorry for sending all the code, and not a direct answer 🙈, but I really didn't know to answer it other than that. And if you have any question, I am ready to help. Settings Table Schema

- id
- section
- key
- value

- id
- section
- key
- value
Setting Model

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\Translatable\HasTranslations;

class Setting extends Model
{
use HasFactory, HasTranslations;

protected $translatable = ['value'];

protected $guarded = [];
}

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\Translatable\HasTranslations;

class Setting extends Model
{
use HasFactory, HasTranslations;

protected $translatable = ['value'];

protected $guarded = [];
}
7 replies
FFilament
Created by FlorianW on 11/8/2023 in #❓┊help
FileUpload RemoveFile Event/Action
Hello, I think this is similar to this bug https://github.com/filamentphp/filament/issues/9791 as "afterStateUpdated" is called after switching the locale
2 replies
FFilament
Created by ahmant on 11/20/2023 in #❓┊help
FileUpload reset after locale switch
8 replies
FFilament
Created by ahmant on 11/20/2023 in #❓┊help
FileUpload reset after locale switch
Ah ok, I see I will do it
8 replies
FFilament
Created by ahmant on 11/20/2023 in #❓┊help
FileUpload reset after locale switch
No description
8 replies
FFilament
Created by M on 11/19/2023 in #❓┊help
Problem with table filters
Are you sure that it's from the filter? Because the error you shared says that it's from the relation manager "RelationManagers\PetHasMedicineRelationManager"
12 replies
FFilament
Created by buzkall on 10/22/2023 in #❓┊help
Wrong indicator in SelectFilter with multiple and translatable
Try this:
->filters([
SelectFilter::make('majors')->relationship('majors', 'title')
->getOptionLabelFromRecordUsing(fn ($record) => $record->title) // 👈
])
->filters([
SelectFilter::make('majors')->relationship('majors', 'title')
->getOptionLabelFromRecordUsing(fn ($record) => $record->title) // 👈
])
6 replies
FFilament
Created by Gorg on 7/17/2023 in #❓┊help
Settings page with translations
Hello, Did you figure out something?
2 replies
FFilament
Created by buzkall on 10/22/2023 in #❓┊help
Wrong indicator in SelectFilter with multiple and translatable
Same issue here. Did you solve it?
6 replies
FFilament
Created by ahmant on 10/12/2023 in #❓┊help
Video Uploader for Vimeo
I used this package https://github.com/vimeo/laravel And in the code:
FileUpload::make('video')
->saveUploadedFileUsing(static fn (BaseFileUpload $component, TemporaryUploadedFile $file): ?string => Vimeo::upload($file->getRealPath()))
FileUpload::make('video')
->saveUploadedFileUsing(static fn (BaseFileUpload $component, TemporaryUploadedFile $file): ?string => Vimeo::upload($file->getRealPath()))
2 replies
FFilament
Created by ahmant on 10/12/2023 in #❓┊help
FileUpload disable view/load for large file
And I'm afraid to update now to version 3, so that no bugs appear to the client at this final stage of the project.
4 replies
FFilament
Created by ahmant on 10/12/2023 in #❓┊help
FileUpload disable view/load for large file
This is only available in version 3, is there something similar for version 2?
4 replies
FFilament
Created by ahmant on 4/27/2023 in #❓┊help
FileUpload to a separated database table
4 replies
FFilament
Created by Atena.D on 3/30/2023 in #❓┊help
How to create custom list page?
I found it, but reading the code, not the doc 1. Extend your custom page from ListRecords 2. Use this view
protected static string $view = 'filament::resources.pages.list-records';
protected static string $view = 'filament::resources.pages.list-records';
3. Add table function
protected function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('course')->formatStateUsing(fn (Course|null $state): string|null => $state?->name)->searchable()->hidden(request()->course > 0),
TextColumn::make('date_from')->searchable(),
TextColumn::make('date_to')->searchable(),
ToggleColumn::make('status'),
TextColumn::make('attachments')->formatStateUsing(fn (string $state): int => $state ? count(explode(',', $state)) : 0)->searchable(),
]);
->filters([
//
])
->actions([
Tables\Actions\EditAction::make()->authorize(fn (Session $record): bool => static::canEdit($record) || static::can('updateAttachments', $record)),
//
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]);
}
protected function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('course')->formatStateUsing(fn (Course|null $state): string|null => $state?->name)->searchable()->hidden(request()->course > 0),
TextColumn::make('date_from')->searchable(),
TextColumn::make('date_to')->searchable(),
ToggleColumn::make('status'),
TextColumn::make('attachments')->formatStateUsing(fn (string $state): int => $state ? count(explode(',', $state)) : 0)->searchable(),
]);
->filters([
//
])
->actions([
Tables\Actions\EditAction::make()->authorize(fn (Session $record): bool => static::canEdit($record) || static::can('updateAttachments', $record)),
//
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]);
}
4. Add getTableQuery function
protected function getTableQuery(): Builder
{
return static::getResource()::getModel()::query();
}
protected function getTableQuery(): Builder
{
return static::getResource()::getModel()::query();
}
10 replies
FFilament
Created by Atena.D on 3/30/2023 in #❓┊help
How to create custom list page?
I really search in the Docs, but didn't find Can you please give me the link where I can find it in the doc?
10 replies