SoraKeyheart
SoraKeyheart
FFilament
Created by toeknee on 7/12/2024 in #❓┊help
Form to PDF
I use Typeset.sh
10 replies
FFilament
Created by SoraKeyheart on 8/28/2024 in #❓┊help
Tenancy - 3 levels: Super Admin, company, client
Yes, I thought about 3 panels. Thank you. Is stancl a good option for this? Or is there a better fit for filament?
6 replies
FFilament
Created by SoraKeyheart on 1/21/2024 in #❓┊help
Widget blade, white screen
Your answer seems logical. It works when I comment out the $view. But this way, the blade won't execute. Also works when I comment out the @livewire in the blade. Any ideas how I can customize the widgets?
11 replies
FFilament
Created by SoraKeyheart on 1/21/2024 in #❓┊help
Widget blade, white screen
No description
11 replies
FFilament
Created by serLar on 9/20/2023 in #❓┊help
Help... the /admin dashboard gives me a 404
Then what?
3 replies
FFilament
Created by SoraKeyheart on 8/24/2023 in #❓┊help
Is it possible to share resources, pages and widgets across panels?
by extend you mean I can add ->discoverResources() more than once?
23 replies
FFilament
Created by shissaaa on 8/24/2023 in #❓┊help
database notification
Just to Review: - did you do composer require filament/notifications:"^3.0-stable" -W? - and php artisan filament:install --scaffold --notifications - and php artisan filament:install --notifications ?
37 replies
FFilament
Created by SoraKeyheart on 8/24/2023 in #❓┊help
Is it possible to share resources, pages and widgets across panels?
Is there any doc or code example you may kindly share?
23 replies
FFilament
Created by shissaaa on 8/24/2023 in #❓┊help
database notification
here is my real code as an example:
// Web notification
$recipientsForNotification = User::where('accident_notification_enabled', true)->get();

foreach ($recipientsForNotification as $recipient) {
$recipient->notify(
Notification::make()
->title('New Accident Created')
->icon('heroicon-o-document-text')
->body(
"**New Accident: " .
__($record->ac_number->prefix ?? 'MVA#' . str_pad($record->ac_number, 4, '0', STR_PAD_LEFT)) .
" at location {$record->locationRelationship->name} was created by " . auth()->user()->name
)
->actions([
Action::make('View')
->url(AccidentResource::getUrl('view', ['record' => $record])),
])
->toDatabase(),
);
}
// Web notification
$recipientsForNotification = User::where('accident_notification_enabled', true)->get();

foreach ($recipientsForNotification as $recipient) {
$recipient->notify(
Notification::make()
->title('New Accident Created')
->icon('heroicon-o-document-text')
->body(
"**New Accident: " .
__($record->ac_number->prefix ?? 'MVA#' . str_pad($record->ac_number, 4, '0', STR_PAD_LEFT)) .
" at location {$record->locationRelationship->name} was created by " . auth()->user()->name
)
->actions([
Action::make('View')
->url(AccidentResource::getUrl('view', ['record' => $record])),
])
->toDatabase(),
);
}
37 replies
FFilament
Created by shissaaa on 8/24/2023 in #❓┊help
database notification
->sendToDatabse in version 3 is changed to ->toDatabase()
37 replies
FFilament
Created by Vp on 8/24/2023 in #❓┊help
Multiple panel login
I did it like this:
protected $emailList = [
'kaec.net',
'hsse.co'
];

public function getEmailDomain($email){
$array = explode('@', $email);
return $array[1];
}

public function canAccessPanel(Panel $panel): bool
{
// Access to Admin panel
if ($panel->getId() === 'admin' && auth()->user()->hasAnyRole('super_admin', 'admin')) {
return in_array($this->getEmailDomain($this->email),$this->emailList);
}
}
protected $emailList = [
'kaec.net',
'hsse.co'
];

public function getEmailDomain($email){
$array = explode('@', $email);
return $array[1];
}

public function canAccessPanel(Panel $panel): bool
{
// Access to Admin panel
if ($panel->getId() === 'admin' && auth()->user()->hasAnyRole('super_admin', 'admin')) {
return in_array($this->getEmailDomain($this->email),$this->emailList);
}
}
15 replies
FFilament
Created by Vp on 8/24/2023 in #❓┊help
Multiple panel login
May you kindly share a code example of this?
15 replies
FFilament
Created by bernhard on 8/23/2023 in #❓┊help
Old colors for dark mode
Nice, I will try this. Because I created a custom css and used .fi hooks to change all possible classes.
14 replies
FFilament
Created by tidiani12 on 8/18/2023 in #❓┊help
How to get record of select relationship automatically
If you want to get the name of the id, you should have a relationship in your model. Did you add a belongsTo in your model?
7 replies
FFilament
Created by Roshan_k on 8/17/2023 in #❓┊help
Pdf export
Of course you can. There isn't a plug in for this (yet) but you can create a custom Action for your table and use libraries like: Typeset.sh TCPDF DomPdf MPDF
5 replies
FFilament
Created by Pasteko on 8/16/2023 in #❓┊help
Enum with form->select
OK a final review before we debug this: 1- is the enum class included in the resource file? use App\Enums\TitreEnum 2- is the enum class included in the model file? 3- is it setup in protected $casts?
12 replies
FFilament
Created by Pasteko on 8/16/2023 in #❓┊help
Enum with form->select
Sorry I miss read the code, try removing relationship
12 replies
FFilament
Created by Pasteko on 8/16/2023 in #❓┊help
Enum with form->select
Try moving your select outside of relationship schema. I don't believe relationships have schemas.
12 replies
FFilament
Created by Pasteko on 8/16/2023 in #❓┊help
Enum with form->select
Please show the Select code block
12 replies
FFilament
Created by Pasteko on 8/16/2023 in #❓┊help
Enum with form->select
In your model, make sure it's like this: protected $casts = [ 'column_name' => TitreEnum::class, ]
12 replies