DrByte
DrByte
FFilament
Created by taz on 8/29/2024 in #❓┊help
unique rule from filament is case sensitive ?
That is probably related to your database's character-set and that field's collation. For example if your collation is utf8_mb4_general_ci, the _ci part means case-insensitive, and in that scenario the database does internal pattern-matching to treat uppercase and lowercase "the same". In majority of situations this is desired. But if you have a certain field in your database that needs to be case-sensitive, you could explore using the _cs version of the same collation. Be sure to test from every angle though, as mixed-collations can cause problems with query-joins where both sides of the joining field use different collations (granted, most joins are on integer fields, not text). Worth exploring whether some database-specific factors are causing the problem you reported.
3 replies
FFilament
Created by Hik on 8/30/2024 in #❓┊help
Don't allow user to delete notifications
Yes, CSS would be much simpler! 😄
5 replies
FFilament
Created by Hik on 8/30/2024 in #❓┊help
Don't allow user to delete notifications
You probably have to override the notification.blade.php and remove <x-filament-notifications::close-button /> But, by doing that you make it harder to upgrade, because any future updates to that blade file will have to be manually applied by you every time you update to the latest Filament.
5 replies
FFilament
Created by morty on 9/4/2024 in #❓┊help
What does `->evaluate()` do?
Dan did a video series on Laracasts where he explains in detail how evaluate() came about and how it works. https://laracasts.com/series/build-advanced-components-for-filament
5 replies
FFilament
Created by mushtaqrahim on 1/14/2024 in #❓┊help
creating new resource show error
[Route: filament.admin.resource.applications.edit][URI:admin/application/{record{/edit]
You have two { and no }.
4 replies
FFilament
Created by DrByte on 1/13/2024 in #❓┊help
Tracking Read/Unread or Viewed/NotViewed
Sure, I always like seeing the solutions others come up with for related problems!
9 replies
FFilament
Created by DrByte on 1/13/2024 in #❓┊help
Tracking Read/Unread or Viewed/NotViewed
The code above doesn't show how to mark it as "unread"/"unviewed", but you could toggle it from another action.
9 replies
FFilament
Created by Jocka on 1/13/2024 in #❓┊help
Change a resource attribute/property from an action.
13 replies
FFilament
Created by DrByte on 1/13/2024 in #❓┊help
Tracking Read/Unread or Viewed/NotViewed
@Jocka ^
9 replies
FFilament
Created by DrByte on 1/13/2024 in #❓┊help
Tracking Read/Unread or Viewed/NotViewed
So, for example combining both of these view indicators and tracking open-clicks on a Table that uses a Split/Grid (to show Cards instead of rows), define the $table with
->recordClasses(fn (Post $record): string => $record->isViewed ? 'normalBorder' : 'unreadBorder')
->action([
Tables\Actions\ViewAction::make()
//..
->mountUsing(function (Post $record) {
$record->trackView(Auth::user());
})
])
->recordClasses(fn (Post $record): string => $record->isViewed ? 'normalBorder' : 'unreadBorder')
->action([
Tables\Actions\ViewAction::make()
//..
->mountUsing(function (Post $record) {
$record->trackView(Auth::user());
})
])
And to register the css: AppServiceProvider.php
FilamentView::registerRenderHook(
'panels::styles.after',
static fn (): View => view('custom-css'),
);
FilamentView::registerRenderHook(
'panels::styles.after',
static fn (): View => view('custom-css'),
);
/resources/views/custom-css.blade.php:
.unreadBorder {
border-color: rgba(var(--info-200),var(--tw-bg-opacity));
border-width: 4px;
}
.unreadBorder {
border-color: rgba(var(--info-200),var(--tw-bg-opacity));
border-width: 4px;
}
9 replies
FFilament
Created by D2RTECH on 1/9/2024 in #❓┊help
file upload error 422 on local machine
No description
6 replies
FFilament
Created by Charly / Toufloux on 1/10/2024 in #❓┊help
Login issue after deploying
I think the command you're referring to is php artisan filament:assets ... which basically copies the assets from Filament's vendor directory into your app's public/js and public/css directories. You can do that on your local PC and then upload those directories to your server, and not have to run the command on the server.
31 replies
FFilament
Created by MajistraFila on 1/9/2024 in #❓┊help
token_get_all() Error in production
Instead of making people go there for context, perhaps you can re-post here, below, what the current state of the problem is, along with what you've tried for fixing it, and what those results were.
6 replies
FFilament
Created by MajistraFila on 1/9/2024 in #❓┊help
token_get_all() Error in production
6 replies
FFilament
Created by D2RTECH on 1/9/2024 in #❓┊help
file upload error 422 on local machine
What's the file type you're uploading? If you're uploading a file of correct extension that matches the file header, but the rest of the file isn't correct for that type (like JSON but has invalid JSON, or XML but invalid XML due to missing braces/etc) then 422 or 415 will trigger. So a corrupt file may trigger it. I suppose if your browser and your server have different compression algorithms set in them then any compression could corrupt the file. So: test on a production server, not just local. Test on an actual webserver engine like Nginx not just "php serve".
6 replies
FFilament
Created by Ali Abbas on 1/4/2024 in #❓┊help
I have a OrderResource i want to have different forms for each create and edit order page?
in Resource:
public static function form(Form $form): Form
{
return $form
->schema([
Section::make('Project Details')
->description('Project Info')
->columns(2)
->schema([
static::getCategorySelectField(),
Forms\Components\Select::make('status')
->selectablePlaceholder(false)
->options(SubmissionStatusEnum::class)
->visible(auth()->user()->hasRole('Super-Admin')),
static::getProjectNameField(),
static::getLocationCityStateField(),
Forms\Components\Placeholder::make('formats')->columnSpanFull()
->label('Nomination Format')
->content(new HtmlString(Content::where('view', 'submissions.nomination-formats')->first()->content)),
static::getProjectDescriptionField(),
Forms\Components\Placeholder::make('tips')->columnSpanFull()
->label('Tip – .... blah blah.')
->content(new HtmlString(Content::where('view', 'submissions.tips')->first()->content)),
]),

static::getNominatorSection(),

static::getContractorDetailsSection(),

...
public static function form(Form $form): Form
{
return $form
->schema([
Section::make('Project Details')
->description('Project Info')
->columns(2)
->schema([
static::getCategorySelectField(),
Forms\Components\Select::make('status')
->selectablePlaceholder(false)
->options(SubmissionStatusEnum::class)
->visible(auth()->user()->hasRole('Super-Admin')),
static::getProjectNameField(),
static::getLocationCityStateField(),
Forms\Components\Placeholder::make('formats')->columnSpanFull()
->label('Nomination Format')
->content(new HtmlString(Content::where('view', 'submissions.nomination-formats')->first()->content)),
static::getProjectDescriptionField(),
Forms\Components\Placeholder::make('tips')->columnSpanFull()
->label('Tip – .... blah blah.')
->content(new HtmlString(Content::where('view', 'submissions.tips')->first()->content)),
]),

static::getNominatorSection(),

static::getContractorDetailsSection(),

...
and in the Trait that's imported into various Resources:
public static function getProjectNameField()
{
return TextInput::make('project_name')
->maxLength(150)
->label('Project Name')
->autofocus()
->required()
->debounce(400)
->afterStateUpdated(function (Forms\Contracts\HasForms $livewire, Forms\Components\TextInput $component) {
$livewire->validateOnly($component->getStatePath());
})
->helperText('(blah blah)')
->columnSpanFull();
}
public static function getCategorySelectField()
{
return Select::make('category_id')
->label('Category')
->options(Category::all()->pluck('name', 'id'))
->columns(2)
->helperText('something helpful here')
->required();
}
// etc
public static function getProjectNameField()
{
return TextInput::make('project_name')
->maxLength(150)
->label('Project Name')
->autofocus()
->required()
->debounce(400)
->afterStateUpdated(function (Forms\Contracts\HasForms $livewire, Forms\Components\TextInput $component) {
$livewire->validateOnly($component->getStatePath());
})
->helperText('(blah blah)')
->columnSpanFull();
}
public static function getCategorySelectField()
{
return Select::make('category_id')
->label('Category')
->options(Category::all()->pluck('name', 'id'))
->columns(2)
->helperText('something helpful here')
->required();
}
// etc
9 replies
FFilament
Created by binaryfire on 1/5/2024 in #❓┊help
Remove "Active filters" bar from table
Thanks for submitting the PR to add this!
14 replies
FFilament
Created by Numine on 1/8/2024 in #❓┊help
If you need to remove the 'x'/cancel /remove option from a Filter Indicator
If it's missing from the docs, then a PR to add it to the docs is a valuable contribution.
5 replies
FFilament
Created by David | Fortune Validator on 1/8/2024 in #❓┊help
Custom Column In Table
Or even ->formatStateUsing()?
6 replies
FFilament
Created by David | Fortune Validator on 1/8/2024 in #❓┊help
Custom Column In Table
Does ->getStateUsing() work?
6 replies