ocram82
ocram82
FFilament
Created by pgferro on 9/17/2024 in #❓┊help
Persistent search selections on table
any solutions to this? I've the same problem
4 replies
FFilament
Created by ocram82 on 10/1/2024 in #❓┊help
Wizard Get $get select multiple value based on filed
Little update: i notice that if i remove ->relationship('users') from
Wizard\Step::make('Empoyes')
->schema([
Forms\Components\Select::make('users')
->relationship('users')
->label('Empoyes')
Wizard\Step::make('Empoyes')
->schema([
Forms\Components\Select::make('users')
->relationship('users')
->label('Empoyes')
it works on create but not in view or edit
4 replies
FFilament
Created by ocram82 on 10/1/2024 in #❓┊help
Wizard Get $get select multiple value based on filed
# continue from previous message


Wizard\Step::make('Coordinator')
->schema([
Forms\Components\Select::make('coordinator_id')
->label('Coordinator')
->options(function (Get $get) {

$companyIds = $get('companies');

if (empty($companyIds)) {
return [];
}

return User::whereIn('company_id', $companyIds)
->selectRaw("CONCAT(first_name, ' ', last_name) as full_name, id")
->pluck('full_name', 'id')
->toArray();
})
->required(),
]),
Wizard\Step::make('Empoyes')
->schema([
Forms\Components\Select::make('users')
->relationship('users')
->label('Empoyes')
->multiple()
->options(function (Get $get) {

$companyIds = $get('companies');

return User::whereIn('company_id', $companyIds)
->selectRaw("CONCAT(first_name, ' ', last_name) as full_name, id")
->pluck('full_name', 'id')
->toArray();
}),
]),
# continue from previous message


Wizard\Step::make('Coordinator')
->schema([
Forms\Components\Select::make('coordinator_id')
->label('Coordinator')
->options(function (Get $get) {

$companyIds = $get('companies');

if (empty($companyIds)) {
return [];
}

return User::whereIn('company_id', $companyIds)
->selectRaw("CONCAT(first_name, ' ', last_name) as full_name, id")
->pluck('full_name', 'id')
->toArray();
})
->required(),
]),
Wizard\Step::make('Empoyes')
->schema([
Forms\Components\Select::make('users')
->relationship('users')
->label('Empoyes')
->multiple()
->options(function (Get $get) {

$companyIds = $get('companies');

return User::whereIn('company_id', $companyIds)
->selectRaw("CONCAT(first_name, ' ', last_name) as full_name, id")
->pluck('full_name', 'id')
->toArray();
}),
]),
I don't know why inside Empoyes Wizard step the list of companies is not loaded and in the Coordinator wizard step yes
4 replies
FFilament
Created by ocram82 on 9/20/2024 in #❓┊help
Disable view action when click on row
it solve the case
11 replies
FFilament
Created by ocram82 on 9/20/2024 in #❓┊help
Disable view action when click on row
good! thnks a lot
11 replies
FFilament
Created by ocram82 on 9/20/2024 in #❓┊help
Disable view action when click on row
Ok, try to explain better: in my table when i click on a row, i mean not in a particular column but in every part of the single row, it causes the open of the modal view record. It's clear this? Ok i want to disable this behavior, I want when I click on the row the modal window not to open. It's more clear now?
11 replies
FFilament
Created by ocram82 on 9/20/2024 in #❓┊help
Disable view action when click on row
Thanks, but i 'd want the opposite behaviour: i want to disable "rows to be completely clickable"
11 replies
FFilament
Created by ocram82 on 9/18/2024 in #❓┊help
Database notification error Broadcasting [database-notifications.sent] on channels
note that i can see the notification and can download the pdf but always this error is logged
3 replies
FFilament
Created by ocram82 on 9/9/2024 in #❓┊help
Long text table
thanks a lot. I should try...can you guide me please for the structure: is this the correct way? thanks
public function table(Table $table): Table
{
return $table->columns([
Split::make([
ImageColumn::make('avatar')
->circular(),
TextColumn::make('name')
->weight(FontWeight::Bold)
->searchable()
->sortable(),
]),
Panel::make([
Stack::make([
TextColumn::make('phone')
->icon('heroicon-m-phone'),
TextColumn::make('email')
->icon('heroicon-m-envelope'),
]),
])->collapsible(),
]);
}
public function table(Table $table): Table
{
return $table->columns([
Split::make([
ImageColumn::make('avatar')
->circular(),
TextColumn::make('name')
->weight(FontWeight::Bold)
->searchable()
->sortable(),
]),
Panel::make([
Stack::make([
TextColumn::make('phone')
->icon('heroicon-m-phone'),
TextColumn::make('email')
->icon('heroicon-m-envelope'),
]),
])->collapsible(),
]);
}
7 replies
FFilament
Created by ocram82 on 8/7/2024 in #❓┊help
auth()->user() is null after login
sorry.....but this doesn't work:
<?php

namespace App\Filament\Shared\Resources\WorksiteResource\Pages;

use App\Filament\Shared\Resources\WorksiteResource;
use Filament\Resources\Pages\CreateRecord;

class CreateWorksite extends CreateRecord
{
protected static string $resource = WorksiteResource::class;

protected static bool $canCreateAnother = false;

protected function getHeaderActions(): array
{
return [

];
}



// THIS DON'T WORK

public static function canAccess(): bool
{
return auth()->user()->isAdmin();
}
}
<?php

namespace App\Filament\Shared\Resources\WorksiteResource\Pages;

use App\Filament\Shared\Resources\WorksiteResource;
use Filament\Resources\Pages\CreateRecord;

class CreateWorksite extends CreateRecord
{
protected static string $resource = WorksiteResource::class;

protected static bool $canCreateAnother = false;

protected function getHeaderActions(): array
{
return [

];
}



// THIS DON'T WORK

public static function canAccess(): bool
{
return auth()->user()->isAdmin();
}
}
12 replies
FFilament
Created by ocram82 on 8/7/2024 in #❓┊help
auth()->user() is null after login
good approach! i'll try this and give a feedback! thanks a lot
12 replies
FFilament
Created by ocram82 on 8/7/2024 in #❓┊help
auth()->user() is null after login
this:
public static function getPages(): array
{
$pages = [
'index' => Pages\ListWorksites::route('/'),
'edit' => Pages\EditWorksite::route('/{record}/edit'),
];

// this DON'T WORK

if (auth()->user()->hasRole('admin')) {
$pages['create'] = Pages\CreateWorksite::route('/create');
}

return $pages;

}
public static function getPages(): array
{
$pages = [
'index' => Pages\ListWorksites::route('/'),
'edit' => Pages\EditWorksite::route('/{record}/edit'),
];

// this DON'T WORK

if (auth()->user()->hasRole('admin')) {
$pages['create'] = Pages\CreateWorksite::route('/create');
}

return $pages;

}
12 replies
FFilament
Created by ocram82 on 8/7/2024 in #❓┊help
auth()->user() is null after login
any idea on that?
12 replies
FFilament
Created by ocram82 on 8/7/2024 in #❓┊help
auth()->user() is null after login
in the others method i can dd it properly
12 replies
FFilament
Created by ocram82 on 8/7/2024 in #❓┊help
auth()->user() is null after login
inside public static function getPages(): array function
12 replies
FFilament
Created by ocram82 on 6/26/2024 in #❓┊help
Export pdf with custom layout
ok thanks a lot! i will try and get you back some feedback
18 replies
FFilament
Created by ocram82 on 6/26/2024 in #❓┊help
Export pdf with custom layout
one pdf with user data for different users
18 replies
FFilament
Created by ocram82 on 6/26/2024 in #❓┊help
Export pdf with custom layout
what code i have to use? i just use an export action to export csv and i make this:
->headerActions([
ExportAction::make()
->exporter(UserExporter::class)
->formats([
ExportFormat::Csv,
])
->fileDisk('local')
->label('Export')
->icon('heroicon-o-document-text')
->color('primary')
->before(function (ModelsResource $resource) {
$resource->deleteOldExports();
}),

]);
->headerActions([
ExportAction::make()
->exporter(UserExporter::class)
->formats([
ExportFormat::Csv,
])
->fileDisk('local')
->label('Export')
->icon('heroicon-o-document-text')
->color('primary')
->before(function (ModelsResource $resource) {
$resource->deleteOldExports();
}),

]);
Do you mean this?
18 replies
FFilament
Created by ocram82 on 6/26/2024 in #❓┊help
Export pdf with custom layout
no ok, this is for a single user, but the nice to have is a bulk action
18 replies
FFilament
Created by ocram82 on 6/26/2024 in #❓┊help
Export pdf with custom layout
No description
18 replies