LancelotGamer
LancelotGamer
FFilament
Created by LancelotGamer on 12/23/2023 in #❓┊help
Pie widget bug
The issue still exist
12 replies
FFilament
Created by LancelotGamer on 12/23/2023 in #❓┊help
Pie widget bug
It was pie
12 replies
FFilament
Created by LancelotGamer on 12/23/2023 in #❓┊help
Pie widget bug
I changed it to bar
12 replies
FFilament
Created by LancelotGamer on 12/23/2023 in #❓┊help
Pie widget bug
ohh sorry
12 replies
FFilament
Created by LancelotGamer on 12/23/2023 in #❓┊help
Pie widget bug
The percentages and numbers, why do they appear?
12 replies
FFilament
Created by LancelotGamer on 12/23/2023 in #❓┊help
Pie widget bug
protected function getData(): array
{
$archivedTickets = Ticket::whereNotNull('deleted_at')->count();
$canceledTickets = Ticket::whereNotNull('canceled_at')->count();
$closedTickets = Ticket::where('status', TicketStatus::CLOSED->value)->count();
$escalatedToHighTechnicalSupport = Ticket::whereNotNull('escalated_to_high_technical_support_at')->count();
$escalatedToExternalTechnicalSupport = Ticket::whereNotNull('escalated_to_external_technical_support_at')->count();
$openedTickets = Ticket::whereNotNull('start_at')->count();
return [
'datasets' => [
[
'label' => 'Ticket Chart',
'data' => [
$openedTickets,
$closedTickets,
$archivedTickets,
$canceledTickets,
$escalatedToHighTechnicalSupport,
$escalatedToExternalTechnicalSupport,
],
'backgroundColor' => [
'rgb(54, 162, 235)',
'rgb(75, 192, 192)',
'rgb(255, 205, 86)',
'rgb(255, 99, 132)',
'rgb(153, 102, 255)',
'rgb(255, 159, 64)',
],
],
],
'labels' => [
'Opened Tickets',
'Closed Tickets',
'Archived Tickets',
'Canceled Tickets',
'Escalated To SL2',
'Escalated To SL3',
],
];
}
protected function getData(): array
{
$archivedTickets = Ticket::whereNotNull('deleted_at')->count();
$canceledTickets = Ticket::whereNotNull('canceled_at')->count();
$closedTickets = Ticket::where('status', TicketStatus::CLOSED->value)->count();
$escalatedToHighTechnicalSupport = Ticket::whereNotNull('escalated_to_high_technical_support_at')->count();
$escalatedToExternalTechnicalSupport = Ticket::whereNotNull('escalated_to_external_technical_support_at')->count();
$openedTickets = Ticket::whereNotNull('start_at')->count();
return [
'datasets' => [
[
'label' => 'Ticket Chart',
'data' => [
$openedTickets,
$closedTickets,
$archivedTickets,
$canceledTickets,
$escalatedToHighTechnicalSupport,
$escalatedToExternalTechnicalSupport,
],
'backgroundColor' => [
'rgb(54, 162, 235)',
'rgb(75, 192, 192)',
'rgb(255, 205, 86)',
'rgb(255, 99, 132)',
'rgb(153, 102, 255)',
'rgb(255, 159, 64)',
],
],
],
'labels' => [
'Opened Tickets',
'Closed Tickets',
'Archived Tickets',
'Canceled Tickets',
'Escalated To SL2',
'Escalated To SL3',
],
];
}
12 replies
FFilament
Created by LancelotGamer on 12/23/2023 in #❓┊help
Pie widget bug
<?php

namespace App\Filament\Widgets;

use App\Enums\TicketStatus;
use App\Models\Ticket;
use Filament\Widgets\ChartWidget;

class TicketTypeCountChart extends ChartWidget
{
protected int | string | array $columnSpan = 'half';

protected static ?int $sort = 1;

protected static ?string $pollingInterval = null;

protected static ?string $maxHeight = '300px';

protected static ?string $heading = 'Ticket Chart';

///// in the next message

protected function getType(): string
{
return 'bar';
}

public static function canView(): bool
{
return auth()->user()->can('widget_TicketTypeCountChart');
}
}
<?php

namespace App\Filament\Widgets;

use App\Enums\TicketStatus;
use App\Models\Ticket;
use Filament\Widgets\ChartWidget;

class TicketTypeCountChart extends ChartWidget
{
protected int | string | array $columnSpan = 'half';

protected static ?int $sort = 1;

protected static ?string $pollingInterval = null;

protected static ?string $maxHeight = '300px';

protected static ?string $heading = 'Ticket Chart';

///// in the next message

protected function getType(): string
{
return 'bar';
}

public static function canView(): bool
{
return auth()->user()->can('widget_TicketTypeCountChart');
}
}
12 replies
FFilament
Created by LancelotGamer on 11/1/2023 in #❓┊help
How can I throw an exception and send a notification in handleRecordCreation() method
protected function beforeCreate(): void
{
// Runs before the form fields are saved to the database.
}
protected function beforeCreate(): void
{
// Runs before the form fields are saved to the database.
}
I don't want to use Observers / beforeCreate() method because I have DB::transaction()
8 replies
FFilament
Created by LancelotGamer on 11/1/2023 in #❓┊help
How can I throw an exception and send a notification in handleRecordCreation() method
Yes I know that I want to send a notification that there was an error before creating the record
8 replies
FFilament
Created by LancelotGamer on 10/9/2023 in #❓┊help
Select Menu issue while in dark mode
that was the issue
27 replies
FFilament
Created by LancelotGamer on 10/9/2023 in #❓┊help
Select Menu issue while in dark mode
Thank you so much
27 replies
FFilament
Created by LancelotGamer on 10/9/2023 in #❓┊help
Select Menu issue while in dark mode
Why is my filament version still in v3.0.0.0
27 replies
FFilament
Created by LancelotGamer on 10/9/2023 in #❓┊help
Select Menu issue while in dark mode
Loading composer repositories with package information Updating dependencies Nothing to modify in lock file Installing dependencies from lock file (including require-dev) Nothing to install, update or remove Generating optimized autoload files nothing has been updated why 😦
27 replies
FFilament
Created by LancelotGamer on 10/9/2023 in #❓┊help
Select Menu issue while in dark mode
filament version still v3.0.0.0
27 replies
FFilament
Created by LancelotGamer on 10/9/2023 in #❓┊help
Select Menu issue while in dark mode
not*
27 replies
FFilament
Created by LancelotGamer on 10/9/2023 in #❓┊help
Select Menu issue while in dark mode
It did work
27 replies
FFilament
Created by LancelotGamer on 10/9/2023 in #❓┊help
Select Menu issue while in dark mode
How can I upgrade ?
27 replies
FFilament
Created by LancelotGamer on 10/9/2023 in #❓┊help
Select Menu issue while in dark mode
?
27 replies
FFilament
Created by LancelotGamer on 10/9/2023 in #❓┊help
Select Menu issue while in dark mode
>> composer upgrade
27 replies