harps
harps
FFilament
Created by harps on 7/4/2024 in #❓┊help
Query scoping
Thanks @Brian Kidd, I'll I look further into that and let you know. I have tried multiple ways to try and constrain the model but I'm either doing it wrong or Filament is doing it's own thing to allow the dot notation when accessing fields.
6 replies
FFilament
Created by harps on 7/4/2024 in #❓┊help
Query scoping
Basically I want to prevent the "select * from" queries on my resource lists pages
6 replies
FFilament
Created by harps on 1/8/2024 in #❓┊help
GetTabs actions
Thanks @Dennis Koch that was it.
12 replies
FFilament
Created by harps on 1/8/2024 in #❓┊help
GetTabs actions
For example there is no need to have the "Archive" action/button in the header of the inactive tab.
12 replies
FFilament
Created by harps on 1/8/2024 in #❓┊help
GetTabs actions
I want different bulk actions in each tab
12 replies
FFilament
Created by harps on 1/8/2024 in #❓┊help
GetTabs actions
Thanks for the tip @Spoof444 but that doesn't solve the issue I want to solve.
12 replies
FFilament
Created by harps on 1/8/2024 in #❓┊help
GetTabs actions
Thanks @Spoof444 but that creates the tab? I already have two tabs but the bulk action "Archive" appears on both tabs when it does nothing on the inactive tab because the items are already archived.
public function getTabs(): array
{
return [
'active' => Tab::make()
->modifyQueryUsing(fn (Builder $query) => $query->whereNull('deleted_at')),
'inactive' => Tab::make()
->modifyQueryUsing(fn (Builder $query) => $query->whereNotNull('deleted_at')),
];
}
public function getTabs(): array
{
return [
'active' => Tab::make()
->modifyQueryUsing(fn (Builder $query) => $query->whereNull('deleted_at')),
'inactive' => Tab::make()
->modifyQueryUsing(fn (Builder $query) => $query->whereNotNull('deleted_at')),
];
}
12 replies
FFilament
Created by harps on 12/18/2023 in #❓┊help
Where to override isActiveWhen()
The page is registered in the resource with getPages(); the page extends ListRecords but there is no getNavigationItems in that class. The getNavigationItems function is in the page class which ListRecords extends. Copying the function from the page class into my page class doesn't seem to do anything.
4 replies
FFilament
Created by harps on 11/29/2023 in #❓┊help
Relation manager ignored global scope
Can anyone confirm if this is expected behaviour? "The ownerRecord does not respect global scopes"
4 replies
FFilament
Created by harps on 11/29/2023 in #❓┊help
Relation manager ignored global scope
It looks like it's something to do with the $ownerRecord variable in the RelationManager component, this variables attributes are the full set of columns from the model rather than the scoped one.
4 replies
FFilament
Created by harps on 11/28/2023 in #❓┊help
Large json columns
In my case it was actually better to create a global scope as I only needed the json objects at very specific points in the application such as viewing a resource.
7 replies
FFilament
Created by harps on 11/28/2023 in #❓┊help
Large json columns
Hi @toeknee, These are the only fields I need in the table. Which form are you referring to?
7 replies
FFilament
Created by harps on 11/28/2023 in #❓┊help
Large json columns
I think I worked this out, rather than exclude I need to modify the table query to only include what aI want.
->modifyQueryUsing(fn (Builder $query) => $query->select(
'id',
'type',
'asset_label',
'start_point',
'status',
'batch_id',
'assigned_to_id',
'region',
'created_at',
'exported',
));
->modifyQueryUsing(fn (Builder $query) => $query->select(
'id',
'type',
'asset_label',
'start_point',
'status',
'batch_id',
'assigned_to_id',
'region',
'created_at',
'exported',
));
7 replies
FFilament
Created by harps on 10/25/2023 in #❓┊help
Tailwind colors in color()
So when I set the 'pressure' => Color::Yellow, that is an array of RGB values but then it's not possible to select which one to use when using the ->color('material') function on an infolist? How does it know which is the default for yellow? I can manually set the RGB value similar to @wyChoong suggests but I'm just trying to understand how it works 🙂
7 replies
FFilament
Created by harps on 10/25/2023 in #❓┊help
Inliine infolist entries
Hi @awcodes the first entry I have is a custom entry, I've just been outputting raw values. I was wondering if there was a way to not have the entry components not wrapped divs with grid classes but I guess not. I'll just output them manually. 👍
5 replies
FFilament
Created by harps on 10/23/2023 in #❓┊help
url error on relationship
This works. ->url(fn (PipeSurvey $record): string => $record->batch ? PipeBatchResource::getUrl('view', ['record' => $record->batch]) : ''),
9 replies
FFilament
Created by harps on 10/23/2023 in #❓┊help
url error on relationship
->url(fn (PipeSurvey $record): string => PipeBatchResource::getUrl('view', ['record' => $record->batch])), Batch doesn't exist on some records it's null 🤔
9 replies
FFilament
Created by harps on 10/23/2023 in #❓┊help
url error on relationship
That does seem a neater way although it hasn't resolved my issue. I need to avoid running the function when the relationship does not exist.
9 replies
FFilament
Created by harps on 10/19/2023 in #❓┊help
hasOne model relationship select list options
changing the model to belongsTo and using ->relationship() worked and seemed to make sense.
3 replies
FFilament
Created by harps on 10/17/2023 in #❓┊help
Changing password error "Email already exists"
I have got so far with extending the user profile page but I get a livewire error. Unable to find component: [app.filament.auth.pages.edit-profile] My code looks like this (Basically the basic page for testing)
<?php

namespace App\Filament\Auth\Pages;

use Filament\Forms\Form;
use Filament\Pages\Auth\EditProfile as BaseEditProfile;

class EditProfile extends BaseEditProfile
{

public function form(Form $form): Form
{
return $form
->schema([
$this->getNameFormComponent(),
$this->getEmailFormComponent(),
$this->getPasswordFormComponent(),
$this->getPasswordConfirmationFormComponent(),
]);
}
}
<?php

namespace App\Filament\Auth\Pages;

use Filament\Forms\Form;
use Filament\Pages\Auth\EditProfile as BaseEditProfile;

class EditProfile extends BaseEditProfile
{

public function form(Form $form): Form
{
return $form
->schema([
$this->getNameFormComponent(),
$this->getEmailFormComponent(),
$this->getPasswordFormComponent(),
$this->getPasswordConfirmationFormComponent(),
]);
}
}
The form loads but if you click save I get the error
13 replies