Added chart js plugin package and sets static label
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Models\Line;
|
||||
use App\Models\ProductionQuantity;
|
||||
use App\Models\QualityValidation;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Filament\Support\RawJs;
|
||||
|
||||
class CumulativeChart extends ChartWidget
|
||||
{
|
||||
@@ -163,6 +164,15 @@ class CumulativeChart extends ChartWidget
|
||||
}
|
||||
}
|
||||
|
||||
$nonFgData = array_map(function ($value) {
|
||||
return ($value == 0 || is_null($value)) ? null : $value;
|
||||
}, $nonFgData);
|
||||
|
||||
$fgData = array_map(function ($value) {
|
||||
return ($value == 0 || is_null($value)) ? null : $value;
|
||||
}, $fgData);
|
||||
|
||||
|
||||
return [
|
||||
'labels' => $labels,
|
||||
'datasets' => array_filter([
|
||||
@@ -186,8 +196,11 @@ class CumulativeChart extends ChartWidget
|
||||
'data' => $fgData,
|
||||
// 'backgroundColor' => '#ef4444', // Red for FG
|
||||
],
|
||||
|
||||
]),
|
||||
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
protected function getType(): string
|
||||
@@ -208,6 +221,23 @@ class CumulativeChart extends ChartWidget
|
||||
protected function getOptions(): array
|
||||
{
|
||||
return [
|
||||
// 'plugins' => [
|
||||
// 'datalabels' => false,
|
||||
// ],
|
||||
'plugins' => [
|
||||
'datalabels' => [
|
||||
'anchor' => 'start',
|
||||
'align' => 'start',
|
||||
'offset' => 4,
|
||||
'color' => '#000',
|
||||
'font' => [
|
||||
'weight' => 'bold',
|
||||
],
|
||||
'formatter' => RawJs::make('function(value) {
|
||||
return value;
|
||||
}'),
|
||||
],
|
||||
],
|
||||
'scales' => [
|
||||
'y' => [
|
||||
'beginAtZero' => true, //Start Y-axis from 0
|
||||
@@ -219,4 +249,12 @@ class CumulativeChart extends ChartWidget
|
||||
];
|
||||
}
|
||||
|
||||
// public static function canView(): bool
|
||||
// {
|
||||
// return request()->routeIs([
|
||||
// 'filament.pages.hourly-production',
|
||||
// 'filament.admin.resources.production-quantities.create',
|
||||
// ]);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Models\GuardPatrolEntry;
|
||||
use Carbon\Carbon;
|
||||
use DB;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Filament\Support\RawJs;
|
||||
|
||||
class GuardPatrolDayChart extends ChartWidget
|
||||
{
|
||||
@@ -42,7 +43,6 @@ class GuardPatrolDayChart extends ChartWidget
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$uniqueGuardNames = GuardPatrolEntry::join('guard_names', 'guard_patrol_entries.guard_name_id', '=', 'guard_names.id')
|
||||
->where('guard_patrol_entries.plant_id', $selectedPlant)
|
||||
->select('guard_names.id', 'guard_names.name')
|
||||
@@ -99,6 +99,10 @@ class GuardPatrolDayChart extends ChartWidget
|
||||
}
|
||||
}
|
||||
|
||||
$chartData = array_map(function ($value) {
|
||||
return ($value == 0 || is_null($value)) ? null : $value;
|
||||
}, $chartData);
|
||||
|
||||
return [
|
||||
'labels' => array_values($uniqueGuardNames),
|
||||
'datasets' => [
|
||||
@@ -143,27 +147,21 @@ class GuardPatrolDayChart extends ChartWidget
|
||||
],
|
||||
],
|
||||
],
|
||||
'plugins' => [
|
||||
'datalabels' => [
|
||||
'anchor' => 'start',
|
||||
'align' => 'start',
|
||||
'offset' => 4,
|
||||
'color' => '#000',
|
||||
'font' => [
|
||||
'weight' => 'bold',
|
||||
],
|
||||
'formatter' => RawJs::make('function(value) {
|
||||
return value;
|
||||
}'),
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
// protected function getOptions(): array
|
||||
// {
|
||||
// return [
|
||||
// 'scales' => [
|
||||
// 'y' => [
|
||||
// 'beginAtZero' => true, // Start Y-axis from 0
|
||||
// 'ticks' => [
|
||||
// 'stepSize' => 5,
|
||||
// ],
|
||||
// ],
|
||||
// ],
|
||||
// 'plugins' => [
|
||||
// 'tooltip' => [
|
||||
// 'callbacks' => [
|
||||
// 'label' => "function(context) { return context.parsed.y + ' (min)'; }",
|
||||
// ],
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ use App\Models\GuardPatrolEntry;
|
||||
use Carbon\Carbon;
|
||||
use DB;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Js;
|
||||
|
||||
class GuardPatrolHourlyChart extends ChartWidget
|
||||
{
|
||||
@@ -19,493 +19,6 @@ class GuardPatrolHourlyChart extends ChartWidget
|
||||
protected int|string|array $columnSpan = 12;
|
||||
|
||||
|
||||
// protected function getData(): array
|
||||
// {
|
||||
// $selectedPlant = session('selected_plant');
|
||||
// $selectedDate = session('selected_date');
|
||||
// $selectedGuardName = session('selected_name');
|
||||
// $selectedTime = session('selected_time');
|
||||
// $validSessions = session('valid_sessions', []);
|
||||
|
||||
// // if (empty($selectedTime) || !isset($validSessions[$selectedTime]) || !$validSessions[$selectedTime]) {
|
||||
// // return [];
|
||||
// // }
|
||||
|
||||
// if (!$selectedPlant || !$selectedDate || !$selectedGuardName || empty($selectedTime)) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// if (empty($selectedTime) || !isset($validSessions[$selectedTime]) || !$validSessions[$selectedTime])
|
||||
// {
|
||||
// return $this->getInvalidSessionChartData();
|
||||
// }
|
||||
|
||||
|
||||
// $query = GuardPatrolEntry::where('plant_id', $selectedPlant)
|
||||
// ->where('guard_name_id', $selectedGuardName)
|
||||
// ->whereDate('patrol_time', $selectedDate);
|
||||
|
||||
|
||||
// if (!empty($selectedTime)) {
|
||||
// [$startTime, $endTime] = explode(' - ', $selectedTime);
|
||||
// $startDateTime = Carbon::parse($selectedDate . ' ' . $startTime);
|
||||
// $endDateTime = Carbon::parse($selectedDate . ' ' . $endTime);
|
||||
// $query->whereBetween('guard_patrol_entries.patrol_time', [$startDateTime, $endDateTime]);
|
||||
// }
|
||||
|
||||
// // $patrols = $query->orderBy('guard_patrol_entries.patrol_time')->get();
|
||||
// $patrols = $query->orderBy('patrol_time')->get();
|
||||
|
||||
// if ($patrols->count() < 2) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// // Get all CheckPointTime records for the plant
|
||||
// $cushioningData = CheckPointTime::where('plant_id', $selectedPlant)
|
||||
// ->orderBy('sequence_number')
|
||||
// ->get(['sequence_number', 'min_cushioning', 'max_cushioning', 'check_point1_id', 'check_point2_id'])
|
||||
// ->keyBy('sequence_number');
|
||||
|
||||
// // Get all unique checkpoint IDs from CheckPointTime
|
||||
// $checkPointIds = collect($cushioningData)
|
||||
// ->flatMap(function ($item) {
|
||||
// return [$item->check_point1_id, $item->check_point2_id];
|
||||
// })
|
||||
// ->unique();
|
||||
|
||||
|
||||
// $checkPointNames = CheckPointName::whereIn('id', $checkPointIds)
|
||||
// ->pluck('name', 'id');
|
||||
|
||||
// $sequenceToName = [];
|
||||
// //$sequenceNumbers = [];
|
||||
// foreach ($cushioningData as $sequenceNumber => $data)
|
||||
// {
|
||||
// $lastNameId = $data->check_point2_id;
|
||||
// $name = $checkPointNames[$lastNameId] ?? null;
|
||||
// if ($name)
|
||||
// {
|
||||
// $sequenceToName[$sequenceNumber] = $name;
|
||||
// //$sequenceNumbers[] = $sequenceNumber;
|
||||
// }
|
||||
// }
|
||||
|
||||
// $numSequences = count($sequenceToName);
|
||||
|
||||
// // Prepare chart data
|
||||
// $intervals = [];
|
||||
// $labels = [];
|
||||
// $colors = [];
|
||||
|
||||
// for ($i = 0; $i < $patrols->count() - 1; $i++)
|
||||
// {
|
||||
// $current = Carbon::parse($patrols[$i]->patrol_time);
|
||||
// $next = Carbon::parse($patrols[$i+1]->patrol_time);
|
||||
// $interval = $next->diffInMinutes($current, true);
|
||||
// $intervals[] = $interval;
|
||||
|
||||
// // if ($next < $current)
|
||||
// // {
|
||||
// // $colors[] = '#ff4c4c'; // Red for out-of-order
|
||||
// // // $intervals[] = $interval;
|
||||
// // $intervals[] = 0;
|
||||
// // $labels[] = "Seq " . ($i + 1);
|
||||
// // continue;
|
||||
// // }
|
||||
|
||||
// $sequenceNumber = ($i % $numSequences) + 1;
|
||||
// $labels[] = "Seq " . ($i + 1);
|
||||
|
||||
// $cushioning = $cushioningData[$sequenceNumber] ?? null;
|
||||
// if (!$cushioning) {
|
||||
// $colors[] = '#cccccc';
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// $min = $cushioning->min_cushioning;
|
||||
// $max = $cushioning->max_cushioning;
|
||||
|
||||
// if ($interval < $min) {
|
||||
// $colors[] = '#ffd700';
|
||||
// } elseif ($interval <= $max) {
|
||||
// $colors[] = '#4caf50';
|
||||
// } else {
|
||||
// $colors[] = '#ff4c4c';
|
||||
// }
|
||||
// }
|
||||
|
||||
// return [
|
||||
// 'labels' => $labels,
|
||||
// 'datasets' => [
|
||||
// [
|
||||
// 'label' => 'Interval (minutes)',
|
||||
// 'data' => $intervals,
|
||||
// 'backgroundColor' => $colors,
|
||||
// 'borderColor' => '#333',
|
||||
// 'borderWidth' => 1,
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
|
||||
// protected function getData(): array
|
||||
// {
|
||||
// $selectedPlant = session('selected_plant');
|
||||
// $selectedDate = session('selected_date');
|
||||
// $selectedGuardName = session('selected_name');
|
||||
// $selectedTime = session('selected_time');
|
||||
|
||||
|
||||
// if (!$selectedPlant || !$selectedDate || !$selectedGuardName || empty($selectedTime)) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// $query = GuardPatrolEntry::where('plant_id', $selectedPlant)
|
||||
// ->where('guard_name_id', $selectedGuardName)
|
||||
// ->whereDate('patrol_time', $selectedDate);
|
||||
|
||||
// if (!empty($selectedTime)) {
|
||||
// [$startTime, $endTime] = explode(' - ', $selectedTime);
|
||||
// $startDateTime = Carbon::parse($selectedDate . ' ' . $startTime);
|
||||
// $endDateTime = Carbon::parse($selectedDate . ' ' . $endTime);
|
||||
// $query->whereBetween('guard_patrol_entries.patrol_time', [$startDateTime, $endDateTime]);
|
||||
// }
|
||||
|
||||
// $patrols = $query->orderBy('patrol_time')->get();
|
||||
|
||||
// if ($patrols->count() < 2) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// // Get all CheckPointTime records for the plant
|
||||
// $checkPointTimes = CheckPointTime::where('plant_id', $selectedPlant)
|
||||
// ->orderBy('sequence_number')
|
||||
// ->get(['sequence_number', 'min_cushioning', 'max_cushioning', 'check_point1_id', 'check_point2_id']);
|
||||
|
||||
// // Build the expected sequence
|
||||
// $expectedSequence = [];
|
||||
// foreach ($checkPointTimes as $row) {
|
||||
// $expectedSequence[] = $row->check_point1_id;
|
||||
// }
|
||||
// if ($checkPointTimes->isNotEmpty()) {
|
||||
// $expectedSequence[] = $checkPointTimes->last()->check_point2_id;
|
||||
// }
|
||||
|
||||
// $intervals = [];
|
||||
// $labels = [];
|
||||
// $colors = [];
|
||||
|
||||
// $cushioningData = $checkPointTimes->keyBy('sequence_number');
|
||||
|
||||
// for ($i = 0; $i < $patrols->count() - 1; $i++) {
|
||||
// $current = Carbon::parse($patrols[$i]->patrol_time);
|
||||
// $next = Carbon::parse($patrols[$i+1]->patrol_time);
|
||||
// $interval = $next->diffInMinutes($current, true);
|
||||
// $intervals[] = $interval;
|
||||
|
||||
// $labels[] = "Seq " . ($i + 1);
|
||||
|
||||
// if ($i < count($expectedSequence)) {
|
||||
// $expectedCheckpoint = $expectedSequence[$i];
|
||||
// $actualCheckpoint = $patrols[$i]->check_point_name_id;
|
||||
// if ($expectedCheckpoint != $actualCheckpoint) {
|
||||
// $colors[] = '#ff4c4c';
|
||||
// continue;
|
||||
// }
|
||||
// } else {
|
||||
// $colors[] = '#ff4c4c';
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// $sequenceNumber = ($i % $checkPointTimes->count()) + 1;
|
||||
// $cushioning = $cushioningData[$sequenceNumber] ?? null;
|
||||
// if (!$cushioning) {
|
||||
// $colors[] = '#cccccc';
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// $min = $cushioning->min_cushioning;
|
||||
// $max = $cushioning->max_cushioning;
|
||||
|
||||
// if ($interval < $min) {
|
||||
// $colors[] = '#ffd700'; // Yellow for too fast
|
||||
// } elseif ($interval <= $max) {
|
||||
// $colors[] = '#4caf50'; // Green for good
|
||||
// } else {
|
||||
// $colors[] = '#ff4c4c'; // Red for too slow
|
||||
// }
|
||||
// }
|
||||
|
||||
// return [
|
||||
// 'labels' => $labels,
|
||||
// 'datasets' => [
|
||||
// [
|
||||
// 'label' => 'Interval (minutes)',
|
||||
// 'data' => $intervals,
|
||||
// 'backgroundColor' => $colors,
|
||||
// 'borderColor' => '#333',
|
||||
// 'borderWidth' => 1,
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
|
||||
// protected function getData(): array
|
||||
// {
|
||||
// $selectedPlant = session('selected_plant'); // Or get from request/argument
|
||||
// $selectedDate = session('selected_date'); // Or get from request/argument
|
||||
// $selectedGuardName = session('selected_name'); // Or get from request/argument
|
||||
// $selectedTime = session('selected_time'); // Or get from request/argument
|
||||
|
||||
// // Optional: If you want to avoid sessions entirely, pass these as arguments to the function.
|
||||
// // For now, we'll keep them as session for minimal change.
|
||||
|
||||
// if (!$selectedPlant || !$selectedDate || !$selectedGuardName || empty($selectedTime)) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// $query = GuardPatrolEntry::where('plant_id', $selectedPlant)
|
||||
// ->where('guard_name_id', $selectedGuardName)
|
||||
// ->whereDate('patrol_time', $selectedDate);
|
||||
|
||||
// if (!empty($selectedTime)) {
|
||||
// [$startTime, $endTime] = explode(' - ', $selectedTime);
|
||||
// $startDateTime = Carbon::parse($selectedDate . ' ' . $startTime);
|
||||
// $endDateTime = Carbon::parse($selectedDate . ' ' . $endTime);
|
||||
// $query->whereBetween('guard_patrol_entries.patrol_time', [$startDateTime, $endDateTime]);
|
||||
// }
|
||||
|
||||
// $patrols = $query->orderBy('patrol_time')->get();
|
||||
|
||||
// if ($patrols->count() < 2) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// // Get all CheckPointTime records for the plant
|
||||
// $checkPointTimes = CheckPointTime::where('plant_id', $selectedPlant)
|
||||
// ->orderBy('sequence_number')
|
||||
// ->get(['sequence_number', 'min_cushioning', 'max_cushioning', 'check_point1_id', 'check_point2_id']);
|
||||
|
||||
// // Build the expected sequence
|
||||
// $expectedSequence = [];
|
||||
// foreach ($checkPointTimes as $row) {
|
||||
// $expectedSequence[] = $row->check_point1_id;
|
||||
// }
|
||||
// if ($checkPointTimes->isNotEmpty()) {
|
||||
// $expectedSequence[] = $checkPointTimes->last()->check_point2_id;
|
||||
// }
|
||||
|
||||
// // Prepare chart data
|
||||
// $intervals = [];
|
||||
// $labels = [];
|
||||
// $colors = [];
|
||||
|
||||
// // Key cushioning data by sequence_number
|
||||
// $cushioningData = $checkPointTimes->keyBy('sequence_number');
|
||||
|
||||
// // Track if any sequence matches
|
||||
// $anySequenceMatches = false;
|
||||
|
||||
// // For each interval (between patrols)
|
||||
// for ($i = 0; $i < $patrols->count() - 1; $i++) {
|
||||
// // Check if the current checkpoint matches the expected sequence
|
||||
// if ($i < count($expectedSequence)) {
|
||||
// $expectedCheckpoint = $expectedSequence[$i];
|
||||
// $actualCheckpoint = $patrols[$i]->check_point_name_id;
|
||||
// if ($expectedCheckpoint == $actualCheckpoint) {
|
||||
// $anySequenceMatches = true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// // If no sequence matches at all, show only "X"
|
||||
// if (!$anySequenceMatches) {
|
||||
// return [
|
||||
// 'labels' => ['X'],
|
||||
// 'datasets' => [
|
||||
// [
|
||||
// 'label' => 'Interval (minutes)',
|
||||
// 'data' => [0],
|
||||
// 'backgroundColor' => ['#ff4c4c'],
|
||||
// 'borderColor' => '#333',
|
||||
// 'borderWidth' => 1,
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
|
||||
// // Otherwise, show the intervals as before
|
||||
// for ($i = 0; $i < $patrols->count() - 1; $i++) {
|
||||
// $current = Carbon::parse($patrols[$i]->patrol_time);
|
||||
// $next = Carbon::parse($patrols[$i+1]->patrol_time);
|
||||
// $interval = $next->diffInMinutes($current, true);
|
||||
// $intervals[] = $interval;
|
||||
|
||||
// $labels[] = "Seq " . ($i + 1);
|
||||
|
||||
// // Check if the current checkpoint matches the expected sequence
|
||||
// if ($i < count($expectedSequence)) {
|
||||
// $expectedCheckpoint = $expectedSequence[$i];
|
||||
// $actualCheckpoint = $patrols[$i]->check_point_name_id;
|
||||
// if ($expectedCheckpoint != $actualCheckpoint) {
|
||||
// $colors[] = '#ff4c4c';
|
||||
// continue;
|
||||
// }
|
||||
// } else {
|
||||
// $colors[] = '#ff4c4c';
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// // If sequence is correct, apply cushioning logic
|
||||
// $sequenceNumber = ($i % $checkPointTimes->count()) + 1;
|
||||
// $cushioning = $cushioningData[$sequenceNumber] ?? null;
|
||||
// if (!$cushioning) {
|
||||
// $colors[] = '#cccccc';
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// $min = $cushioning->min_cushioning;
|
||||
// $max = $cushioning->max_cushioning;
|
||||
|
||||
// if ($interval < $min) {
|
||||
// $colors[] = '#ffd700';
|
||||
// } elseif ($interval <= $max) {
|
||||
// $colors[] = '#4caf50';
|
||||
// } else {
|
||||
// $colors[] = '#ff4c4c';
|
||||
// }
|
||||
// }
|
||||
|
||||
// return [
|
||||
// 'labels' => $labels,
|
||||
// 'datasets' => [
|
||||
// [
|
||||
// 'label' => 'Interval (minutes)',
|
||||
// 'data' => $intervals,
|
||||
// 'backgroundColor' => $colors,
|
||||
// 'borderColor' => '#333',
|
||||
// 'borderWidth' => 1,
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
|
||||
// protected function getData(): array
|
||||
// {
|
||||
// $selectedPlant = session('selected_plant');
|
||||
// $selectedDate = session('selected_date');
|
||||
// $selectedGuardName = session('selected_name');
|
||||
// $selectedTime = session('selected_time');
|
||||
|
||||
// if (!$selectedPlant || !$selectedDate || !$selectedGuardName || empty($selectedTime)) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// $query = GuardPatrolEntry::where('plant_id', $selectedPlant)
|
||||
// ->where('guard_name_id', $selectedGuardName)
|
||||
// ->whereDate('patrol_time', $selectedDate);
|
||||
|
||||
// if (!empty($selectedTime)) {
|
||||
// [$startTime, $endTime] = explode(' - ', $selectedTime);
|
||||
// $startDateTime = Carbon::parse($selectedDate . ' ' . $startTime);
|
||||
// $endDateTime = Carbon::parse($selectedDate . ' ' . $endTime);
|
||||
// $query->whereBetween('guard_patrol_entries.patrol_time', [$startDateTime, $endDateTime]);
|
||||
// }
|
||||
|
||||
// $patrols = $query->orderBy('patrol_time')->get();
|
||||
|
||||
// if ($patrols->count() < 2) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// // Get all CheckPointTime records for the plant
|
||||
// $checkPointTimes = CheckPointTime::where('plant_id', $selectedPlant)
|
||||
// ->orderBy('sequence_number')
|
||||
// ->get(['sequence_number', 'min_cushioning', 'max_cushioning', 'check_point1_id', 'check_point2_id']);
|
||||
|
||||
// // Build the expected sequence
|
||||
// $expectedSequence = [];
|
||||
// foreach ($checkPointTimes as $row) {
|
||||
// $expectedSequence[] = $row->check_point1_id;
|
||||
// }
|
||||
// if ($checkPointTimes->isNotEmpty()) {
|
||||
// $expectedSequence[] = $checkPointTimes->last()->check_point2_id;
|
||||
// }
|
||||
|
||||
// // Prepare chart data
|
||||
// $intervals = [];
|
||||
// $labels = [];
|
||||
// $colors = [];
|
||||
// $cushioningData = $checkPointTimes->keyBy('sequence_number');
|
||||
|
||||
// // Track the current position in the expected sequence
|
||||
// $currentSeqIndex = 0;
|
||||
// $anySequenceMatches = false;
|
||||
|
||||
// for ($i = 0; $i < $patrols->count() - 1; $i++) {
|
||||
// $current = Carbon::parse($patrols[$i]->patrol_time);
|
||||
// $next = Carbon::parse($patrols[$i+1]->patrol_time);
|
||||
// $interval = $next->diffInMinutes($current, true);
|
||||
// $intervals[] = $interval;
|
||||
|
||||
// $labels[] = "Seq " . ($i + 1);
|
||||
|
||||
// // Check if current patrol's checkpoint matches the next expected
|
||||
// if ($currentSeqIndex < count($expectedSequence) && $patrols[$i]->check_point_name_id == $expectedSequence[$currentSeqIndex]) {
|
||||
// $currentSeqIndex++;
|
||||
// $anySequenceMatches = true;
|
||||
// // Apply cushioning logic for valid sequence
|
||||
// $sequenceNumber = ($currentSeqIndex - 1) % $checkPointTimes->count() + 1;
|
||||
// $cushioning = $cushioningData[$sequenceNumber] ?? null;
|
||||
// if (!$cushioning) {
|
||||
// $colors[] = '#cccccc';
|
||||
// continue;
|
||||
// }
|
||||
// $min = $cushioning->min_cushioning;
|
||||
// $max = $cushioning->max_cushioning;
|
||||
// if ($interval < $min) {
|
||||
// $colors[] = '#ffd700';
|
||||
// } elseif ($interval <= $max) {
|
||||
// $colors[] = '#4caf50';
|
||||
// } else {
|
||||
// $colors[] = '#ff4c4c';
|
||||
// }
|
||||
// } else {
|
||||
// // Out of order: mark as red
|
||||
// $colors[] = '#ff4c4c';
|
||||
// }
|
||||
// }
|
||||
|
||||
// // If no sequence matches at all, show only "X"
|
||||
// if (!$anySequenceMatches) {
|
||||
// return [
|
||||
// 'labels' => ['X'],
|
||||
// 'datasets' => [
|
||||
// [
|
||||
// 'label' => 'Interval (minutes)',
|
||||
// 'data' => [0],
|
||||
// 'backgroundColor' => ['#ff4c4c'],
|
||||
// 'borderColor' => '#333',
|
||||
// 'borderWidth' => 1,
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
|
||||
// return [
|
||||
// 'labels' => $labels,
|
||||
// 'datasets' => [
|
||||
// [
|
||||
// 'label' => 'Interval (minutes)',
|
||||
// 'data' => $intervals,
|
||||
// 'backgroundColor' => $colors,
|
||||
// 'borderColor' => '#333',
|
||||
// 'borderWidth' => 1,
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
|
||||
protected function getData(): array
|
||||
{
|
||||
$selectedPlant = session('selected_plant');
|
||||
@@ -567,7 +80,9 @@ class GuardPatrolHourlyChart extends ChartWidget
|
||||
for ($i = 0; $i < $patrols->count() - 1; $i++) {
|
||||
$current = Carbon::parse($patrols[$i]->patrol_time);
|
||||
$next = Carbon::parse($patrols[$i+1]->patrol_time);
|
||||
$interval = $next->diffInMinutes($current, true);
|
||||
// $interval = $next->diffInMinutes($current, true);
|
||||
$diffInSeconds = $next->floatDiffInRealSeconds($current, true); // get float seconds
|
||||
$interval = round($diffInSeconds / 60, 2);
|
||||
$intervals[] = $interval;
|
||||
|
||||
$labels[] = "Seq " . ($i + 1);
|
||||
@@ -630,6 +145,7 @@ class GuardPatrolHourlyChart extends ChartWidget
|
||||
protected function getOptions(): array
|
||||
{
|
||||
return [
|
||||
|
||||
'scales' => [
|
||||
'y' => [
|
||||
'beginAtZero' => true, //Start Y-axis from 0
|
||||
@@ -638,25 +154,46 @@ class GuardPatrolHourlyChart extends ChartWidget
|
||||
],
|
||||
],
|
||||
],
|
||||
'plugins' => [
|
||||
'datalabels' => [
|
||||
'anchor' => 'start',
|
||||
'align' => 'end',
|
||||
'color' => '#000',
|
||||
'font' => [
|
||||
'weight' => 'bold',
|
||||
],
|
||||
//'formatter' => Js::raw('function(value) { return Number(value).toFixed(2) + " min"; }'),
|
||||
//'formatter' => 'function(value) { return Number(value).toFixed(2) + " min"; }',
|
||||
'formatter' => Js::from("function(value) { return Number(value).toFixed(2) + ' min'; }"),
|
||||
//'formatter' => Js::from(new \Illuminate\Support\Stringable('function(value) { return Number(value).toFixed(2) + " min"; }')),
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
// protected function getOptions(): array
|
||||
// {
|
||||
// return [
|
||||
// 'plugins' => [
|
||||
// 'datalabels' => [
|
||||
// 'anchor' => 'end',
|
||||
// 'align' => 'top',
|
||||
// 'color' => '#000',
|
||||
// 'font' => [
|
||||
// 'weight' => 'bold',
|
||||
// ],
|
||||
// 'formatter' => \Illuminate\Support\Js::from("function(value) { return value + ' min'; }"),
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
// protected function getOptions(): array
|
||||
// {
|
||||
// return json_decode(json_encode([
|
||||
// 'plugins' => [
|
||||
// 'datalabels' => [
|
||||
// 'anchor' => 'end',
|
||||
// 'align' => 'start',
|
||||
// 'offset' => 4,
|
||||
// 'color' => '#000',
|
||||
// 'font' => [
|
||||
// 'weight' => 'bold',
|
||||
// ],
|
||||
// 'formatter' => null, // temporarily set null
|
||||
// ],
|
||||
// ],
|
||||
// 'scales' => [
|
||||
// 'y' => [
|
||||
// 'beginAtZero' => true,
|
||||
// ],
|
||||
// ],
|
||||
// ]), true);
|
||||
// }
|
||||
|
||||
|
||||
protected function getType(): string
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ use App\Models\Line;
|
||||
use App\Models\Plant;
|
||||
use DB;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\Js;
|
||||
|
||||
class InvoiceChart extends ChartWidget
|
||||
{
|
||||
@@ -356,12 +357,43 @@ class InvoiceChart extends ChartWidget
|
||||
return 'invoice-chart';
|
||||
}
|
||||
|
||||
// protected function getOptions(): array
|
||||
// {
|
||||
// return [
|
||||
// 'scales' => [
|
||||
// 'y' => [
|
||||
// 'beginAtZero' => true, //Start Y-axis from 0
|
||||
// 'ticks' => [
|
||||
// 'stepSize' => 1,
|
||||
// ],
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
protected function getOptions(): array
|
||||
{
|
||||
return [
|
||||
// 'plugins' => [
|
||||
// 'datalabels' => [
|
||||
// // 'anchor' => 'start',
|
||||
// // 'align' => 'start',
|
||||
// // 'offset' => 1,
|
||||
// 'anchor' => 'start',
|
||||
// 'align' => 'start',
|
||||
// 'offset' => 8,
|
||||
// 'color' => '#000',
|
||||
// 'font' => [
|
||||
// 'weight' => 'bold',
|
||||
// ],
|
||||
// 'formatter' => Js::from("function(value) { return Number(value); }"),
|
||||
// ],
|
||||
// ],
|
||||
'plugins' => [
|
||||
'datalabels' => false, // Disable datalabels plugin properly
|
||||
],
|
||||
'scales' => [
|
||||
'y' => [
|
||||
'beginAtZero' => true, //Start Y-axis from 0
|
||||
'beginAtZero' => true,
|
||||
'ticks' => [
|
||||
'stepSize' => 1,
|
||||
],
|
||||
|
||||
@@ -14,7 +14,7 @@ class ItemOverview extends ChartWidget
|
||||
|
||||
protected int|string|array $columnSpan = '12';
|
||||
|
||||
protected static ?string $maxHeight = '350px';
|
||||
protected static ?string $maxHeight = '400px';
|
||||
|
||||
protected $listeners = ['filtersUpdated' => '$refresh'];
|
||||
|
||||
@@ -116,6 +116,10 @@ class ItemOverview extends ChartWidget
|
||||
$labels = array_map(fn ($hour) => date("g A", strtotime("$hour:00")), $shiftedKeys);
|
||||
}
|
||||
|
||||
// $orderedData = array_map(function ($value) {
|
||||
// return ($value == 0 || is_null($value)) ? null : $value;
|
||||
// }, $orderedData);
|
||||
|
||||
return [
|
||||
'datasets' => [
|
||||
[
|
||||
@@ -126,11 +130,11 @@ class ItemOverview extends ChartWidget
|
||||
default => $isFgLine ? "Today's FG Count" : "Today's Hourly Production",
|
||||
},
|
||||
'data' => $orderedData,
|
||||
'interaction' => [
|
||||
'mode' => 'nearest',
|
||||
'axis' => 'x',
|
||||
'intersect' => false,
|
||||
],
|
||||
// 'interaction' => [
|
||||
// 'mode' => 'nearest',
|
||||
// 'axis' => 'x',
|
||||
// 'intersect' => false,
|
||||
// ],
|
||||
'borderColor' => 'rgba(75, 192, 192, 1)',
|
||||
'backgroundColor' => 'rgba(75, 192, 192, 0.2)',
|
||||
'fill' => false,
|
||||
@@ -146,10 +150,34 @@ class ItemOverview extends ChartWidget
|
||||
return 'line';
|
||||
}
|
||||
|
||||
// protected function getOptions(): array
|
||||
// {
|
||||
// return [
|
||||
|
||||
// 'scales' => [
|
||||
// 'y' => [
|
||||
// 'beginAtZero' => true,
|
||||
// 'ticks' => [
|
||||
// 'stepSize' => 0.5,
|
||||
// ],
|
||||
// ],
|
||||
// ],
|
||||
|
||||
// ];
|
||||
// }
|
||||
protected function getOptions(): array
|
||||
{
|
||||
return [
|
||||
|
||||
'plugins' => [
|
||||
'datalabels' => [
|
||||
'anchor' => 'start',
|
||||
'color' => '#000',
|
||||
'font' => [
|
||||
'weight' => 'bold',
|
||||
],
|
||||
'formatter' => 'function(value) { return Number(value); }',
|
||||
],
|
||||
],
|
||||
'scales' => [
|
||||
'y' => [
|
||||
'beginAtZero' => true,
|
||||
@@ -162,6 +190,7 @@ class ItemOverview extends ChartWidget
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected function getFilters(): ?array
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -158,14 +158,17 @@ class ProductionLineStopChart extends ChartWidget
|
||||
protected function getOptions(): array
|
||||
{
|
||||
return [
|
||||
'responsive' => true,
|
||||
'plugins' => [
|
||||
'legend' => [
|
||||
'position' => 'bottom',
|
||||
],
|
||||
'tooltip' => [
|
||||
'enabled' => true, // Tooltips enabled on hover
|
||||
],
|
||||
// 'responsive' => true,
|
||||
// 'plugins' => [
|
||||
// 'legend' => [
|
||||
// 'position' => 'bottom',
|
||||
// ],
|
||||
// 'tooltip' => [
|
||||
// 'enabled' => true, // Tooltips enabled on hover
|
||||
// ],
|
||||
// ],
|
||||
'plugins' => [
|
||||
'datalabels' => false,
|
||||
],
|
||||
'scales' => [
|
||||
'x' => [
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Models\Line;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\Js;
|
||||
use Filament\Support\RawJs;
|
||||
use Illuminate\Support\Stringable;
|
||||
|
||||
class ProductionOrderChart extends ChartWidget
|
||||
{
|
||||
@@ -10,70 +14,93 @@ class ProductionOrderChart extends ChartWidget
|
||||
|
||||
protected int|string|array $columnSpan = 12;
|
||||
|
||||
protected static ?string $maxHeight = '330px';
|
||||
|
||||
protected $listeners = ['productionOrderChart'];
|
||||
|
||||
|
||||
protected function getData(): array
|
||||
{
|
||||
$activeFilter = $this->filter;
|
||||
|
||||
$selectedPlant = session('selected_plant');
|
||||
$selectedLine = session('selected_line');
|
||||
$productionOrder = session('production_order');
|
||||
|
||||
if (!$selectedPlant || !$selectedLine || !$productionOrder)
|
||||
{
|
||||
return [
|
||||
'datasets' => [],
|
||||
'labels' => [],
|
||||
];
|
||||
}
|
||||
$activeFilter = $this->filter;
|
||||
|
||||
if ($activeFilter === 'yesterday') {
|
||||
$startDate = now()->subDay()->setTime(8, 0, 0); // yesterday 8:00 AM
|
||||
$endDate = now()->setTime(8, 0, 0); // today 8:00 AM
|
||||
$groupBy = 'EXTRACT(HOUR FROM production_quantities.created_at)';
|
||||
}
|
||||
else if ($activeFilter === 'this_week') {
|
||||
// Monday 8:00 AM of the current week
|
||||
$startDate = now()->startOfWeek()->setTime(8, 0, 0);
|
||||
$selectedPlant = session('selected_plant');
|
||||
$selectedLine = session('selected_line');
|
||||
$productionOrder = session('production_order');
|
||||
|
||||
// Next Monday 8:00 AM (end of Sunday + 8 hrs)
|
||||
$endDate = now()->endOfWeek()->addDay()->setTime(8, 0, 0);
|
||||
if (!$selectedPlant || !$selectedLine || !$productionOrder) {
|
||||
return [
|
||||
'datasets' => [],
|
||||
'labels' => [],
|
||||
];
|
||||
}
|
||||
|
||||
$groupBy = 'EXTRACT(DOW FROM production_quantities.created_at)'; // Group by day of week
|
||||
}
|
||||
// 1. Check line type
|
||||
$lineType = Line::where('id', $selectedLine)->value('type');
|
||||
|
||||
else if ($activeFilter === 'this_month') {
|
||||
$startDate = now()->startOfMonth();
|
||||
$endDate = now()->endOfMonth();
|
||||
$groupBy = "FLOOR((EXTRACT(DAY FROM production_quantities.created_at) - 1) / 7) + 1";
|
||||
}
|
||||
else
|
||||
{
|
||||
$startDate = now()->setTime(8, 0, 0); // today at 8:00 AM
|
||||
$endDate = now()->copy()->addDay()->setTime(8, 0, 0); // tomorrow at 8:00 AM
|
||||
$groupBy = 'EXTRACT(HOUR FROM production_quantities.created_at)';
|
||||
}
|
||||
// 2. Set base table and columns depending on line type
|
||||
if ($lineType == 'FG Line')
|
||||
{
|
||||
$table = 'quality_validations';
|
||||
$dateColumn = 'created_at'; // adjust if your date column is named differently
|
||||
$plantColumn = 'plant_id';
|
||||
$lineColumn = 'line_id';
|
||||
$orderColumn = 'production_order';
|
||||
}
|
||||
else
|
||||
{
|
||||
$table = 'production_quantities';
|
||||
$dateColumn = 'created_at';
|
||||
$plantColumn = 'plant_id';
|
||||
$lineColumn = 'line_id';
|
||||
$orderColumn = 'production_order';
|
||||
}
|
||||
|
||||
// 3. Set filter logic as before
|
||||
if ($activeFilter == 'yesterday')
|
||||
{
|
||||
$startDate = now()->subDay()->setTime(8, 0, 0);
|
||||
$endDate = now()->setTime(8, 0, 0);
|
||||
$groupBy = "EXTRACT(HOUR FROM $table.$dateColumn)";
|
||||
}
|
||||
else if ($activeFilter == 'this_week')
|
||||
{
|
||||
$startDate = now()->startOfWeek()->setTime(8, 0, 0);
|
||||
$endDate = now()->endOfWeek()->addDay()->setTime(8, 0, 0);
|
||||
$groupBy = "EXTRACT(DOW FROM $table.$dateColumn)";
|
||||
}
|
||||
else if ($activeFilter == 'this_month')
|
||||
{
|
||||
$startDate = now()->startOfMonth();
|
||||
$endDate = now()->endOfMonth();
|
||||
$groupBy = "FLOOR((EXTRACT(DAY FROM $table.$dateColumn) - 1) / 7) + 1";
|
||||
}
|
||||
else
|
||||
{
|
||||
$startDate = now()->setTime(8, 0, 0);
|
||||
$endDate = now()->copy()->addDay()->setTime(8, 0, 0);
|
||||
$groupBy = "EXTRACT(HOUR FROM $table.$dateColumn)";
|
||||
}
|
||||
|
||||
$query = \DB::table('production_quantities')
|
||||
->join('plants', 'production_quantities.plant_id', '=', 'plants.id')
|
||||
->join('lines', 'production_quantities.line_id', '=', 'lines.id')
|
||||
->selectRaw("$groupBy AS time_unit, count(*) AS total_quantity")
|
||||
->whereBetween('production_quantities.created_at', [$startDate, $endDate])
|
||||
->where('plants.id', $selectedPlant)
|
||||
->where('lines.id', $selectedLine)
|
||||
->when($productionOrder, fn($q) => $q->where('production_quantities.production_order', $productionOrder))
|
||||
->groupByRaw($groupBy)
|
||||
->orderByRaw($groupBy)
|
||||
->pluck('total_quantity', 'time_unit')
|
||||
->toArray();
|
||||
if ($activeFilter === 'this_month') {
|
||||
$weeksCount = ceil($endDate->day / 7); // Calculate total weeks dynamically
|
||||
$allWeeks = array_fill(1, $weeksCount, 0); // Initialize all weeks with 0
|
||||
$data = array_replace($allWeeks, $query); // Fill missing weeks with 0
|
||||
// 4. Build the query dynamically
|
||||
$query = \DB::table($table)
|
||||
->join('plants', "$table.$plantColumn", '=', 'plants.id')
|
||||
->join('lines', "$table.$lineColumn", '=', 'lines.id')
|
||||
->selectRaw("$groupBy AS time_unit, count(*) AS total_quantity")
|
||||
->whereBetween("$table.$dateColumn", [$startDate, $endDate])
|
||||
->where('plants.id', $selectedPlant)
|
||||
->where('lines.id', $selectedLine)
|
||||
->when($productionOrder, fn($q) => $q->where("$table.$orderColumn", $productionOrder))
|
||||
->groupByRaw($groupBy)
|
||||
->orderByRaw($groupBy)
|
||||
->pluck('total_quantity', 'time_unit')
|
||||
->toArray();
|
||||
|
||||
if ($activeFilter == 'this_month')
|
||||
{
|
||||
$weeksCount = ceil($endDate->day / 7);
|
||||
$allWeeks = array_fill(1, $weeksCount, 0);
|
||||
$data = array_replace($allWeeks, $query);
|
||||
|
||||
// Generate dynamic week labels
|
||||
$labels = [];
|
||||
for ($i = 1; $i <= $weeksCount; $i++) {
|
||||
$weekStart = $startDate->copy()->addDays(($i - 1) * 7)->format('d M');
|
||||
@@ -83,19 +110,13 @@ class ProductionOrderChart extends ChartWidget
|
||||
|
||||
$orderedData = array_values($data);
|
||||
}
|
||||
else if ($activeFilter === 'this_week') {
|
||||
// Correct week labels: ['Mon', 'Tue', ..., 'Sun']
|
||||
else if ($activeFilter == 'this_week')
|
||||
{
|
||||
$labels = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
|
||||
|
||||
// Initialize default data for all 7 days
|
||||
$data = array_fill(0, 7, 0);
|
||||
|
||||
// Fill in data from query results
|
||||
foreach ($query as $dow => $count) {
|
||||
$data[$dow] = $count;
|
||||
}
|
||||
|
||||
// Ensure days are ordered from Monday to Sunday
|
||||
$orderedData = [
|
||||
$data[1] ?? 0, // Monday
|
||||
$data[2] ?? 0, // Tuesday
|
||||
@@ -103,42 +124,55 @@ class ProductionOrderChart extends ChartWidget
|
||||
$data[4] ?? 0, // Thursday
|
||||
$data[5] ?? 0, // Friday
|
||||
$data[6] ?? 0, // Saturday
|
||||
$data[0] ?? 0, // Sunday (move to last)
|
||||
$data[0] ?? 0, // Sunday
|
||||
];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Hourly data (same as before)
|
||||
$allHours = array_fill(0, 24, 0);
|
||||
$data = array_replace($allHours, $query);
|
||||
$allHours = array_fill(0, 24, 0);
|
||||
$data = array_replace($allHours, $query);
|
||||
|
||||
// Shift hours for proper display (8 AM to 7 AM)
|
||||
$shiftedKeys = array_merge(range(8, 23), range(0, 8));
|
||||
$orderedData = array_map(fn($hour) => $data[$hour], $shiftedKeys);
|
||||
$shiftedKeys = array_merge(range(8, 23), range(0, 8));
|
||||
$orderedData = array_map(fn($hour) => $data[$hour], $shiftedKeys);
|
||||
|
||||
// Labels: ["8 AM", "9 AM", ..., "7 AM"]
|
||||
$labels = array_map(fn ($hour) => date("g A", strtotime("$hour:00")), $shiftedKeys);
|
||||
$labels = array_map(fn ($hour) => date("g A", strtotime("$hour:00")), $shiftedKeys);
|
||||
}
|
||||
|
||||
$orderedData = array_map(function ($value) {
|
||||
return ($value == 0 || is_null($value)) ? null : $value;
|
||||
}, $orderedData);
|
||||
|
||||
|
||||
return [
|
||||
'datasets' => [
|
||||
[
|
||||
'label' => match ($activeFilter)
|
||||
{
|
||||
'this_week' => $lineType == 'FG Line'
|
||||
? "Daily Fg Production Order Count This Week"
|
||||
: "Daily Production Order Count This Week",
|
||||
'this_month' => $lineType == 'FG Line'
|
||||
? "Weekly Fg Production Order Count This Month"
|
||||
: "Weekly Production Order Count This Month",
|
||||
'yesterday' => $lineType == 'FG Line'
|
||||
? "Yesterday's Hourly Fg Order Count Production"
|
||||
: "Yesterday's Hourly Order Count Production",
|
||||
default => $lineType == 'FG Line'
|
||||
? "Today's Hourly Fg Production Order Count"
|
||||
: "Today's Hourly Production Order Count",
|
||||
},
|
||||
|
||||
'data' => $orderedData,
|
||||
'borderColor' => 'rgba(75, 192, 192, 1)',
|
||||
'backgroundColor' => 'rgba(75, 192, 192, 0.2)',
|
||||
'fill' => false,
|
||||
'tension' => 0.3,
|
||||
],
|
||||
],
|
||||
'labels' => $labels,
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'datasets' => [
|
||||
[
|
||||
'label' => match ($activeFilter) {
|
||||
'this_week' => "Daily Production Order Count This Week",
|
||||
'this_month' => "Weekly Production Order Count This Month", // Updated Label
|
||||
'yesterday' => "Yesterday's Hourly Order Count Production",
|
||||
default => "Today's Hourly Production Order Count",
|
||||
},
|
||||
'data' => $orderedData,
|
||||
'borderColor' => 'rgba(75, 192, 192, 1)',
|
||||
'backgroundColor' => 'rgba(75, 192, 192, 0.2)',
|
||||
'fill' => false,
|
||||
'tension' => 0.3,
|
||||
],
|
||||
],
|
||||
'labels' => $labels,
|
||||
];
|
||||
}
|
||||
protected function getType(): string
|
||||
{
|
||||
return 'bar';
|
||||
@@ -147,7 +181,21 @@ class ProductionOrderChart extends ChartWidget
|
||||
protected function getOptions(): array
|
||||
{
|
||||
return [
|
||||
|
||||
'plugins' => [
|
||||
'datalabels' => [
|
||||
// 'anchor' => 'start',
|
||||
// 'align' => 'start',
|
||||
// 'offset' => 1,
|
||||
'anchor' => 'start',
|
||||
'align' => 'start',
|
||||
'offset' => 8,
|
||||
'color' => '#000',
|
||||
'font' => [
|
||||
'weight' => 'bold',
|
||||
],
|
||||
'formatter' => Js::from("function(value) { return Number(value); }"),
|
||||
],
|
||||
],
|
||||
'scales' => [
|
||||
'y' => [
|
||||
'beginAtZero' => true,
|
||||
|
||||
@@ -41,6 +41,9 @@ class AppServiceProvider extends ServiceProvider
|
||||
// FilamentAsset::register([
|
||||
// Js::make('chart-js-plugins', Vite::asset('resources/js/filament-chart-js-plugins.js'))->module(),
|
||||
// ]);
|
||||
FilamentAsset::register([
|
||||
Js::make('chart-js-plugins', Vite::asset('resources/js/filament-chart-js-plugins.js'))->module(),
|
||||
]);
|
||||
|
||||
// URL::forceScheme('https');
|
||||
|
||||
|
||||
@@ -11,14 +11,19 @@
|
||||
"althinect/filament-spatie-roles-permissions": "^2.3",
|
||||
"filament/filament": "^3.3",
|
||||
"laravel/framework": "^11.31",
|
||||
"laravel/sanctum": "^4.0",
|
||||
"laravel/tinker": "^2.9",
|
||||
"livewire/livewire": "^3.6",
|
||||
"maatwebsite/excel": "^3.1",
|
||||
"mike42/escpos-php": "^4.0",
|
||||
"mpdf/mpdf": "^8.2",
|
||||
"simplesoftwareio/simple-qrcode": "^4.2",
|
||||
"tpetry/laravel-postgresql-enhanced": "^2.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3.15",
|
||||
"barryvdh/laravel-ide-helper": "^3.5",
|
||||
"beyondcode/laravel-dump-server": "^2.1",
|
||||
"fakerphp/faker": "^1.23",
|
||||
"laravel/pail": "^1.1",
|
||||
"laravel/pint": "^1.13",
|
||||
|
||||
827
composer.lock
generated
827
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "cb43ec04264890f09fbcd10ab0cb790c",
|
||||
"content-hash": "c5fa984c6dd37d7e9f5b541c7f54a754",
|
||||
"packages": [
|
||||
{
|
||||
"name": "alperenersoy/filament-export",
|
||||
@@ -191,6 +191,60 @@
|
||||
},
|
||||
"time": "2025-03-22T08:49:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "bacon/bacon-qr-code",
|
||||
"version": "2.0.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Bacon/BaconQrCode.git",
|
||||
"reference": "8674e51bb65af933a5ffaf1c308a660387c35c22"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/8674e51bb65af933a5ffaf1c308a660387c35c22",
|
||||
"reference": "8674e51bb65af933a5ffaf1c308a660387c35c22",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"dasprid/enum": "^1.0.3",
|
||||
"ext-iconv": "*",
|
||||
"php": "^7.1 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phly/keep-a-changelog": "^2.1",
|
||||
"phpunit/phpunit": "^7 | ^8 | ^9",
|
||||
"spatie/phpunit-snapshot-assertions": "^4.2.9",
|
||||
"squizlabs/php_codesniffer": "^3.4"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-imagick": "to generate QR code images"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"BaconQrCode\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-2-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ben Scholzen 'DASPRiD'",
|
||||
"email": "mail@dasprids.de",
|
||||
"homepage": "https://dasprids.de/",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "BaconQrCode is a QR code generator for PHP.",
|
||||
"homepage": "https://github.com/Bacon/BaconQrCode",
|
||||
"support": {
|
||||
"issues": "https://github.com/Bacon/BaconQrCode/issues",
|
||||
"source": "https://github.com/Bacon/BaconQrCode/tree/2.0.8"
|
||||
},
|
||||
"time": "2022-12-07T17:46:57+00:00"
|
||||
},
|
||||
{
|
||||
"name": "barryvdh/laravel-dompdf",
|
||||
"version": "v3.1.1",
|
||||
@@ -812,6 +866,56 @@
|
||||
],
|
||||
"time": "2025-02-21T08:52:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "dasprid/enum",
|
||||
"version": "1.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DASPRiD/Enum.git",
|
||||
"reference": "8dfd07c6d2cf31c8da90c53b83c026c7696dda90"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/DASPRiD/Enum/zipball/8dfd07c6d2cf31c8da90c53b83c026c7696dda90",
|
||||
"reference": "8dfd07c6d2cf31c8da90c53b83c026c7696dda90",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1 <9.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^7 || ^8 || ^9 || ^10 || ^11",
|
||||
"squizlabs/php_codesniffer": "*"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"DASPRiD\\Enum\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-2-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ben Scholzen 'DASPRiD'",
|
||||
"email": "mail@dasprids.de",
|
||||
"homepage": "https://dasprids.de/",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "PHP 7.1 enum implementation",
|
||||
"keywords": [
|
||||
"enum",
|
||||
"map"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/DASPRiD/Enum/issues",
|
||||
"source": "https://github.com/DASPRiD/Enum/tree/1.0.6"
|
||||
},
|
||||
"time": "2024-08-09T14:30:48+00:00"
|
||||
},
|
||||
{
|
||||
"name": "dflydev/dot-access-data",
|
||||
"version": "v3.0.3",
|
||||
@@ -2867,6 +2971,70 @@
|
||||
},
|
||||
"time": "2025-02-11T13:34:40+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/sanctum",
|
||||
"version": "v4.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/sanctum.git",
|
||||
"reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/sanctum/zipball/a360a6a1fd2400ead4eb9b6a9c1bb272939194f5",
|
||||
"reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"illuminate/console": "^11.0|^12.0",
|
||||
"illuminate/contracts": "^11.0|^12.0",
|
||||
"illuminate/database": "^11.0|^12.0",
|
||||
"illuminate/support": "^11.0|^12.0",
|
||||
"php": "^8.2",
|
||||
"symfony/console": "^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "^1.6",
|
||||
"orchestra/testbench": "^9.0|^10.0",
|
||||
"phpstan/phpstan": "^1.10",
|
||||
"phpunit/phpunit": "^11.3"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Laravel\\Sanctum\\SanctumServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Laravel\\Sanctum\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Taylor Otwell",
|
||||
"email": "taylor@laravel.com"
|
||||
}
|
||||
],
|
||||
"description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.",
|
||||
"keywords": [
|
||||
"auth",
|
||||
"laravel",
|
||||
"sanctum"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/laravel/sanctum/issues",
|
||||
"source": "https://github.com/laravel/sanctum"
|
||||
},
|
||||
"time": "2025-04-23T13:03:38+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/serializable-closure",
|
||||
"version": "v2.0.3",
|
||||
@@ -4045,6 +4213,112 @@
|
||||
},
|
||||
"time": "2024-03-31T07:05:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mike42/escpos-php",
|
||||
"version": "v4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mike42/escpos-php.git",
|
||||
"reference": "74fd89a3384135c90a8c6dc4b724e03df7c0e4f9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/mike42/escpos-php/zipball/74fd89a3384135c90a8c6dc4b724e03df7c0e4f9",
|
||||
"reference": "74fd89a3384135c90a8c6dc4b724e03df7c0e4f9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-intl": "*",
|
||||
"ext-json": "*",
|
||||
"ext-zlib": "*",
|
||||
"mike42/gfx-php": "^0.6",
|
||||
"php": ">=7.3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9",
|
||||
"squizlabs/php_codesniffer": "^3.3"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-gd": "Used for image printing if present.",
|
||||
"ext-imagick": "Will be used for image printing if present. Required for PDF printing or use of custom fonts."
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Mike42\\": "src/Mike42"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Michael Billington",
|
||||
"email": "michael.billington@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "PHP receipt printer library for use with ESC/POS-compatible thermal and impact printers",
|
||||
"homepage": "https://github.com/mike42/escpos-php",
|
||||
"keywords": [
|
||||
"Epson",
|
||||
"barcode",
|
||||
"escpos",
|
||||
"printer",
|
||||
"receipt-printer"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/mike42/escpos-php/issues",
|
||||
"source": "https://github.com/mike42/escpos-php/tree/v4.0"
|
||||
},
|
||||
"time": "2022-05-23T11:05:09+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mike42/gfx-php",
|
||||
"version": "v0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mike42/gfx-php.git",
|
||||
"reference": "ed9ded2a9298e4084a9c557ab74a89b71e43dbdb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/mike42/gfx-php/zipball/ed9ded2a9298e4084a9c557ab74a89b71e43dbdb",
|
||||
"reference": "ed9ded2a9298e4084a9c557ab74a89b71e43dbdb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpbench/phpbench": "@dev",
|
||||
"phpunit/phpunit": "^6.5",
|
||||
"squizlabs/php_codesniffer": "^3.3.1"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Mike42\\": "src/Mike42"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-2.1-or-later"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Michael Billington",
|
||||
"email": "michael.billington@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "The pure PHP graphics library",
|
||||
"homepage": "https://github.com/mike42/gfx-php",
|
||||
"support": {
|
||||
"issues": "https://github.com/mike42/gfx-php/issues",
|
||||
"source": "https://github.com/mike42/gfx-php/tree/v0.6"
|
||||
},
|
||||
"time": "2019-10-05T02:44:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "3.9.0",
|
||||
@@ -4148,6 +4422,239 @@
|
||||
],
|
||||
"time": "2025-03-24T10:02:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mpdf/mpdf",
|
||||
"version": "v8.2.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mpdf/mpdf.git",
|
||||
"reference": "e175b05e3e00977b85feb96a8cccb174ac63621f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/mpdf/mpdf/zipball/e175b05e3e00977b85feb96a8cccb174ac63621f",
|
||||
"reference": "e175b05e3e00977b85feb96a8cccb174ac63621f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-gd": "*",
|
||||
"ext-mbstring": "*",
|
||||
"mpdf/psr-http-message-shim": "^1.0 || ^2.0",
|
||||
"mpdf/psr-log-aware-trait": "^2.0 || ^3.0",
|
||||
"myclabs/deep-copy": "^1.7",
|
||||
"paragonie/random_compat": "^1.4|^2.0|^9.99.99",
|
||||
"php": "^5.6 || ^7.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
|
||||
"psr/http-message": "^1.0 || ^2.0",
|
||||
"psr/log": "^1.0 || ^2.0 || ^3.0",
|
||||
"setasign/fpdi": "^2.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "^1.3.0",
|
||||
"mpdf/qrcode": "^1.1.0",
|
||||
"squizlabs/php_codesniffer": "^3.5.0",
|
||||
"tracy/tracy": "~2.5",
|
||||
"yoast/phpunit-polyfills": "^1.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-bcmath": "Needed for generation of some types of barcodes",
|
||||
"ext-xml": "Needed mainly for SVG manipulation",
|
||||
"ext-zlib": "Needed for compression of embedded resources, such as fonts"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Mpdf\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"GPL-2.0-only"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Matěj Humpál",
|
||||
"role": "Developer, maintainer"
|
||||
},
|
||||
{
|
||||
"name": "Ian Back",
|
||||
"role": "Developer (retired)"
|
||||
}
|
||||
],
|
||||
"description": "PHP library generating PDF files from UTF-8 encoded HTML",
|
||||
"homepage": "https://mpdf.github.io",
|
||||
"keywords": [
|
||||
"pdf",
|
||||
"php",
|
||||
"utf-8"
|
||||
],
|
||||
"support": {
|
||||
"docs": "https://mpdf.github.io",
|
||||
"issues": "https://github.com/mpdf/mpdf/issues",
|
||||
"source": "https://github.com/mpdf/mpdf"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://www.paypal.me/mpdf",
|
||||
"type": "custom"
|
||||
}
|
||||
],
|
||||
"time": "2024-11-18T15:30:42+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mpdf/psr-http-message-shim",
|
||||
"version": "v2.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mpdf/psr-http-message-shim.git",
|
||||
"reference": "f25a0153d645e234f9db42e5433b16d9b113920f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/mpdf/psr-http-message-shim/zipball/f25a0153d645e234f9db42e5433b16d9b113920f",
|
||||
"reference": "f25a0153d645e234f9db42e5433b16d9b113920f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"psr/http-message": "^2.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Mpdf\\PsrHttpMessageShim\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Mark Dorison",
|
||||
"email": "mark@chromatichq.com"
|
||||
},
|
||||
{
|
||||
"name": "Kristofer Widholm",
|
||||
"email": "kristofer@chromatichq.com"
|
||||
},
|
||||
{
|
||||
"name": "Nigel Cunningham",
|
||||
"email": "nigel.cunningham@technocrat.com.au"
|
||||
}
|
||||
],
|
||||
"description": "Shim to allow support of different psr/message versions.",
|
||||
"support": {
|
||||
"issues": "https://github.com/mpdf/psr-http-message-shim/issues",
|
||||
"source": "https://github.com/mpdf/psr-http-message-shim/tree/v2.0.1"
|
||||
},
|
||||
"time": "2023-10-02T14:34:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mpdf/psr-log-aware-trait",
|
||||
"version": "v3.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mpdf/psr-log-aware-trait.git",
|
||||
"reference": "a633da6065e946cc491e1c962850344bb0bf3e78"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/mpdf/psr-log-aware-trait/zipball/a633da6065e946cc491e1c962850344bb0bf3e78",
|
||||
"reference": "a633da6065e946cc491e1c962850344bb0bf3e78",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"psr/log": "^3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Mpdf\\PsrLogAwareTrait\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Mark Dorison",
|
||||
"email": "mark@chromatichq.com"
|
||||
},
|
||||
{
|
||||
"name": "Kristofer Widholm",
|
||||
"email": "kristofer@chromatichq.com"
|
||||
}
|
||||
],
|
||||
"description": "Trait to allow support of different psr/log versions.",
|
||||
"support": {
|
||||
"issues": "https://github.com/mpdf/psr-log-aware-trait/issues",
|
||||
"source": "https://github.com/mpdf/psr-log-aware-trait/tree/v3.0.0"
|
||||
},
|
||||
"time": "2023-05-03T06:19:36+00:00"
|
||||
},
|
||||
{
|
||||
"name": "myclabs/deep-copy",
|
||||
"version": "1.13.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/myclabs/DeepCopy.git",
|
||||
"reference": "024473a478be9df5fdaca2c793f2232fe788e414"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414",
|
||||
"reference": "024473a478be9df5fdaca2c793f2232fe788e414",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1 || ^8.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/collections": "<1.6.8",
|
||||
"doctrine/common": "<2.13.3 || >=3 <3.2.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/collections": "^1.6.8",
|
||||
"doctrine/common": "^2.13.3 || ^3.2.2",
|
||||
"phpspec/prophecy": "^1.10",
|
||||
"phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/DeepCopy/deep_copy.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"DeepCopy\\": "src/DeepCopy/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "Create deep copies (clones) of your objects",
|
||||
"keywords": [
|
||||
"clone",
|
||||
"copy",
|
||||
"duplicate",
|
||||
"object",
|
||||
"object graph"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/myclabs/DeepCopy/issues",
|
||||
"source": "https://github.com/myclabs/DeepCopy/tree/1.13.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-02-12T12:17:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nesbot/carbon",
|
||||
"version": "3.8.6",
|
||||
@@ -4640,6 +5147,56 @@
|
||||
],
|
||||
"time": "2025-03-11T14:40:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "paragonie/random_compat",
|
||||
"version": "v9.99.100",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/paragonie/random_compat.git",
|
||||
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a",
|
||||
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">= 7"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.*|5.*",
|
||||
"vimeo/psalm": "^1"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
|
||||
},
|
||||
"type": "library",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Paragon Initiative Enterprises",
|
||||
"email": "security@paragonie.com",
|
||||
"homepage": "https://paragonie.com"
|
||||
}
|
||||
],
|
||||
"description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
|
||||
"keywords": [
|
||||
"csprng",
|
||||
"polyfill",
|
||||
"pseudorandom",
|
||||
"random"
|
||||
],
|
||||
"support": {
|
||||
"email": "info@paragonie.com",
|
||||
"issues": "https://github.com/paragonie/random_compat/issues",
|
||||
"source": "https://github.com/paragonie/random_compat"
|
||||
},
|
||||
"time": "2020-10-15T08:29:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpoffice/phpspreadsheet",
|
||||
"version": "1.29.10",
|
||||
@@ -5716,6 +6273,146 @@
|
||||
},
|
||||
"time": "2025-03-23T17:59:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "setasign/fpdi",
|
||||
"version": "v2.6.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Setasign/FPDI.git",
|
||||
"reference": "67c31f5e50c93c20579ca9e23035d8c540b51941"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Setasign/FPDI/zipball/67c31f5e50c93c20579ca9e23035d8c540b51941",
|
||||
"reference": "67c31f5e50c93c20579ca9e23035d8c540b51941",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-zlib": "*",
|
||||
"php": "^7.1 || ^8.0"
|
||||
},
|
||||
"conflict": {
|
||||
"setasign/tfpdf": "<1.31"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^7",
|
||||
"setasign/fpdf": "~1.8.6",
|
||||
"setasign/tfpdf": "~1.33",
|
||||
"squizlabs/php_codesniffer": "^3.5",
|
||||
"tecnickcom/tcpdf": "^6.2"
|
||||
},
|
||||
"suggest": {
|
||||
"setasign/fpdf": "FPDI will extend this class but as it is also possible to use TCPDF or tFPDF as an alternative. There's no fixed dependency configured."
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"setasign\\Fpdi\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jan Slabon",
|
||||
"email": "jan.slabon@setasign.com",
|
||||
"homepage": "https://www.setasign.com"
|
||||
},
|
||||
{
|
||||
"name": "Maximilian Kresse",
|
||||
"email": "maximilian.kresse@setasign.com",
|
||||
"homepage": "https://www.setasign.com"
|
||||
}
|
||||
],
|
||||
"description": "FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.",
|
||||
"homepage": "https://www.setasign.com/fpdi",
|
||||
"keywords": [
|
||||
"fpdf",
|
||||
"fpdi",
|
||||
"pdf"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/Setasign/FPDI/issues",
|
||||
"source": "https://github.com/Setasign/FPDI/tree/v2.6.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/setasign/fpdi",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-02-05T13:22:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "simplesoftwareio/simple-qrcode",
|
||||
"version": "4.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/SimpleSoftwareIO/simple-qrcode.git",
|
||||
"reference": "916db7948ca6772d54bb617259c768c9cdc8d537"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/SimpleSoftwareIO/simple-qrcode/zipball/916db7948ca6772d54bb617259c768c9cdc8d537",
|
||||
"reference": "916db7948ca6772d54bb617259c768c9cdc8d537",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"bacon/bacon-qr-code": "^2.0",
|
||||
"ext-gd": "*",
|
||||
"php": ">=7.2|^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "~1",
|
||||
"phpunit/phpunit": "~9"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-imagick": "Allows the generation of PNG QrCodes.",
|
||||
"illuminate/support": "Allows for use within Laravel."
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"aliases": {
|
||||
"QrCode": "SimpleSoftwareIO\\QrCode\\Facades\\QrCode"
|
||||
},
|
||||
"providers": [
|
||||
"SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"SimpleSoftwareIO\\QrCode\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Simple Software LLC",
|
||||
"email": "support@simplesoftware.io"
|
||||
}
|
||||
],
|
||||
"description": "Simple QrCode is a QR code generator made for Laravel.",
|
||||
"homepage": "https://www.simplesoftware.io/#/docs/simple-qrcode",
|
||||
"keywords": [
|
||||
"Simple",
|
||||
"generator",
|
||||
"laravel",
|
||||
"qrcode",
|
||||
"wrapper"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/SimpleSoftwareIO/simple-qrcode/issues",
|
||||
"source": "https://github.com/SimpleSoftwareIO/simple-qrcode/tree/4.2.0"
|
||||
},
|
||||
"time": "2021-02-08T20:43:55+00:00"
|
||||
},
|
||||
{
|
||||
"name": "spatie/color",
|
||||
"version": "1.8.0",
|
||||
@@ -8976,6 +9673,74 @@
|
||||
},
|
||||
"time": "2025-01-18T19:26:32+00:00"
|
||||
},
|
||||
{
|
||||
"name": "beyondcode/laravel-dump-server",
|
||||
"version": "2.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/beyondcode/laravel-dump-server.git",
|
||||
"reference": "8e9af58a02a59d6a028167e2afc5b5b1e58eb822"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/beyondcode/laravel-dump-server/zipball/8e9af58a02a59d6a028167e2afc5b5b1e58eb822",
|
||||
"reference": "8e9af58a02a59d6a028167e2afc5b5b1e58eb822",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/console": "5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
|
||||
"illuminate/http": "5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
|
||||
"illuminate/support": "5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
|
||||
"php": ">=7.2.5",
|
||||
"symfony/var-dumper": "^5.0|^6.0|^7.0"
|
||||
},
|
||||
"conflict": {
|
||||
"spatie/laravel-ray": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"larapack/dd": "^1.0",
|
||||
"phpunit/phpunit": "^7.0|^9.3|^10.5"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"BeyondCode\\DumpServer\\DumpServerServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"helpers.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"BeyondCode\\DumpServer\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Marcel Pociot",
|
||||
"email": "marcel@beyondco.de",
|
||||
"homepage": "https://beyondco.de",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "Symfony Var-Dump Server for Laravel",
|
||||
"homepage": "https://github.com/beyondcode/laravel-dump-server",
|
||||
"keywords": [
|
||||
"beyondcode",
|
||||
"laravel-dump-server"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/beyondcode/laravel-dump-server/issues",
|
||||
"source": "https://github.com/beyondcode/laravel-dump-server/tree/2.1.0"
|
||||
},
|
||||
"time": "2025-02-26T08:27:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "composer/class-map-generator",
|
||||
"version": "1.6.1",
|
||||
@@ -9524,66 +10289,6 @@
|
||||
},
|
||||
"time": "2024-05-16T03:13:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "myclabs/deep-copy",
|
||||
"version": "1.13.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/myclabs/DeepCopy.git",
|
||||
"reference": "024473a478be9df5fdaca2c793f2232fe788e414"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414",
|
||||
"reference": "024473a478be9df5fdaca2c793f2232fe788e414",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1 || ^8.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/collections": "<1.6.8",
|
||||
"doctrine/common": "<2.13.3 || >=3 <3.2.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/collections": "^1.6.8",
|
||||
"doctrine/common": "^2.13.3 || ^3.2.2",
|
||||
"phpspec/prophecy": "^1.10",
|
||||
"phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/DeepCopy/deep_copy.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"DeepCopy\\": "src/DeepCopy/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "Create deep copies (clones) of your objects",
|
||||
"keywords": [
|
||||
"clone",
|
||||
"copy",
|
||||
"duplicate",
|
||||
"object",
|
||||
"object graph"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/myclabs/DeepCopy/issues",
|
||||
"source": "https://github.com/myclabs/DeepCopy/tree/1.13.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-02-12T12:17:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nunomaduro/collision",
|
||||
"version": "v8.7.0",
|
||||
|
||||
4925
package-lock.json
generated
Normal file
4925
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,7 @@
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^10.4.20",
|
||||
"axios": "^1.7.4",
|
||||
"chartjs-plugin-datalabels": "^2.2.0",
|
||||
"concurrently": "^9.0.1",
|
||||
"laravel-vite-plugin": "^1.2.0",
|
||||
"postcss": "^8.4.47",
|
||||
|
||||
122
resources/js/filament-chart-js-plugins.js
Normal file
122
resources/js/filament-chart-js-plugins.js
Normal file
@@ -0,0 +1,122 @@
|
||||
import ChartDataLabels from 'chartjs-plugin-datalabels';
|
||||
import Chart from 'chart.js/auto';
|
||||
|
||||
Chart.register(ChartDataLabels);
|
||||
window.Chart = Chart;
|
||||
window.filamentChartJsPlugins ??= [];
|
||||
|
||||
if (!window.filamentChartJsPlugins.includes(ChartDataLabels)) {
|
||||
window.filamentChartJsPlugins.push(ChartDataLabels);
|
||||
}
|
||||
|
||||
// window.filamentChartJsPlugins.push(ChartDataLabels);
|
||||
|
||||
// Chart.defaults.plugins.datalabels = {
|
||||
// anchor: 'end',
|
||||
// align: 'right',
|
||||
// color: '#000',
|
||||
// font: {
|
||||
// weight: 'bold',
|
||||
// size: 11,
|
||||
// },
|
||||
// formatter: (value) => `${value} min`,
|
||||
// backgroundColor: function (context) {
|
||||
// const value = context.dataset.data[context.dataIndex];
|
||||
// return Number(value) !== 0 ? 'rgba(40, 167, 69, 0.1)' : 'transparent';
|
||||
// },
|
||||
// };
|
||||
|
||||
// Set global datalabel options
|
||||
// ChartDataLabels.defaults.anchor = 'end'; // or 'start', 'center', etc.
|
||||
// ChartDataLabels.defaults.align = 'right'; // or 'left', 'top', 'bottom', etc.
|
||||
// // // Conditionally set backgroundColor
|
||||
// ChartDataLabels.defaults.backgroundColor = function(context) {
|
||||
// const value = context.dataset.data[context.dataIndex];
|
||||
// return Number(value) !== 0 ? 'rgba(40, 167, 69, 0.1)' : 'transparent';
|
||||
// };
|
||||
|
||||
// // // Conditionally set borderRadius
|
||||
// ChartDataLabels.defaults.borderRadius = function(context) {
|
||||
// const value = context.dataset.data[context.dataIndex];
|
||||
// return Number(value) !== 0 ? 8 : 0;
|
||||
// };
|
||||
|
||||
// Conditionally set padding
|
||||
// ChartDataLabels.defaults.padding = function(context) {
|
||||
// const value = context.dataset.data[context.dataIndex];
|
||||
// return Number(value) !== 0 ? 6 : 0;
|
||||
// };
|
||||
|
||||
// // // Conditionally set color
|
||||
// ChartDataLabels.defaults.color = function(context) {
|
||||
// const value = context.dataset.data[context.dataIndex];
|
||||
// return Number(value) !== 0 ? '#28a745' : 'transparent';
|
||||
// };
|
||||
|
||||
// // Conditionally set font
|
||||
// ChartDataLabels.defaults.font = function(context) {
|
||||
// const value = context.dataset.data[context.dataIndex];
|
||||
// return Number(value) !== 0 ? { weight: 'bold', size: 14 } : { size: 0 };
|
||||
// };
|
||||
|
||||
|
||||
// ChartDataLabels.defaults.formatter = function(value, context) {
|
||||
// if (Number(value) === 0){
|
||||
// return '';
|
||||
// }
|
||||
// return 'Count: ' + value;
|
||||
// };
|
||||
|
||||
|
||||
// const ctx = document.getElementById('hourly-production');
|
||||
// if (ctx && window.hourlyProductionData && window.hourlyProductionData.labels.length)
|
||||
// {
|
||||
// new Chart(ctx.getContext('2d'), {
|
||||
// type: 'line',
|
||||
// data: window.hourlyProductionData,
|
||||
// options: {
|
||||
// plugins: {
|
||||
// datalabels: {
|
||||
// anchor: 'end',
|
||||
// align: 'right',
|
||||
// backgroundColor: function(context) {
|
||||
// const value = context.dataset.data[context.dataIndex];
|
||||
// return Number(value) !== 0 ? 'rgba(40, 167, 69, 0.1)' : 'transparent';
|
||||
// },
|
||||
// borderRadius: function(context) {
|
||||
// const value = context.dataset.data[context.dataIndex];
|
||||
// return Number(value) !== 0 ? 8 : 0;
|
||||
// },
|
||||
// padding: function(context) {
|
||||
// const value = context.dataset.data[context.dataIndex];
|
||||
// return Number(value) !== 0 ? 6 : 0;
|
||||
// },
|
||||
// color: function(context) {
|
||||
// const value = context.dataset.data[context.dataIndex];
|
||||
// return Number(value) !== 0 ? '#28a745' : 'transparent';
|
||||
// },
|
||||
// font: function(context) {
|
||||
// const value = context.dataset.data[context.dataIndex];
|
||||
// return Number(value) !== 0 ? { weight: 'bold', size: 14 } : { size: 0 };
|
||||
// },
|
||||
// formatter: function(value, context) {
|
||||
// if (Number(value) === 0){
|
||||
// return '';
|
||||
// }
|
||||
// return 'Count: ' + value;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// plugins: [ChartDataLabels]
|
||||
// });
|
||||
// }
|
||||
// else {
|
||||
// console.log('No data available for the chart.');
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import laravel from 'laravel-vite-plugin';
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
laravel({
|
||||
//input: ['resources/css/app.css', 'resources/js/app.js', 'resources/js/filament-chart-js-plugins.js', 'resources/css/filament/admin/theme.css', 'resources/js/hourly-production-chart.js', ],
|
||||
input: ['resources/css/app.css', 'resources/js/app.js',],
|
||||
input: ['resources/css/app.css', 'resources/js/app.js', 'resources/js/filament-chart-js-plugins.js', 'resources/css/filament/admin/theme.css',],
|
||||
// input: ['resources/css/app.css', 'resources/js/app.js',],
|
||||
refresh: true,
|
||||
}),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user