Compare commits
37 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2374d02670 | |||
| 472cb78ffb | |||
| a99021587e | |||
| 13837faaa5 | |||
| 9954817c16 | |||
| c13238014a | |||
| f9d2fcfa06 | |||
| 3431bef787 | |||
| 47bf882702 | |||
| 70c0e1f768 | |||
| 894fecf6b8 | |||
| 9051c8bd25 | |||
| efa24f90ce | |||
| eeb38a367e | |||
| d113d44463 | |||
| 085ae34e89 | |||
| 1969b7edc8 | |||
| 2fa2c0b9f7 | |||
| cb990adb2a | |||
| dae9f6f39e | |||
| a5e6b5f8d6 | |||
| e5097cf466 | |||
| ecb1dc2bcf | |||
| 3390f66226 | |||
| e7c539e4ef | |||
| 330e210fde | |||
| 7053ce029b | |||
| 2823e03793 | |||
| 42067a7b04 | |||
| 9e65a3731c | |||
| 4bdf14de83 | |||
| 141d6c25fa | |||
| 11ef29d89c | |||
| a2ef1742af | |||
| 4cc8296049 | |||
| d0dd8d35a9 | |||
| 4fb991e4c0 |
@@ -3,307 +3,119 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\Models\Bidders;
|
||||
use App\Models\CarShowCategory;
|
||||
use App\Models\CarShowWinner;
|
||||
use App\Models\PeoplesChoice;
|
||||
use App\Models\Vehicles;
|
||||
use App\Models\VehicleScores;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
|
||||
class TabulateWinners extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'carshow:tabulatewinners';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Tabulate Show Winners, and add them to the CarShowWinner table';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected $description = 'Tabulate Show Winners. Year Category 1st places can overlap with Best in Show/People\'s Choice.';
|
||||
|
||||
public function handle()
|
||||
{
|
||||
function bestInShowWinner()
|
||||
{
|
||||
$bestInShowWinnerQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $bestInShowWinnerQuery->vehicle;
|
||||
}
|
||||
|
||||
function bestInShow2ndWinner()
|
||||
{
|
||||
$bestInShow2ndWinnerQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $bestInShow2ndWinnerQuery->vehicle;
|
||||
}
|
||||
|
||||
function pcWinner()
|
||||
{
|
||||
$peoplesChoiceWinnerQuery = PeoplesChoice::join('vehicles', 'peoples_choice.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('peoples_choice.vehicle')
|
||||
->selectRaw('*, sum(pc_count) as totalscore')
|
||||
->whereNotIn('vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $peoplesChoiceWinnerQuery->vehicle;
|
||||
}
|
||||
|
||||
function pc2ndWinner()
|
||||
{
|
||||
$peoplesChoice2ndWinnerQuery = PeoplesChoice::join('vehicles', 'peoples_choice.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('peoples_choice.vehicle')
|
||||
->selectRaw('*, sum(pc_count) as totalscore')
|
||||
->whereNotIn('vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $peoplesChoice2ndWinnerQuery->vehicle;
|
||||
}
|
||||
|
||||
function zeroTo43Winner()
|
||||
{
|
||||
$zeroTo43Query = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 0)
|
||||
->where('vehicles.year', '<=', 1943)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $zeroTo43Query->vehicle;
|
||||
}
|
||||
|
||||
function zeroTo432ndWinner()
|
||||
{
|
||||
$zeroTo432ndQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 0)
|
||||
->where('vehicles.year', '<=', 1943)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $zeroTo432ndQuery->vehicle;
|
||||
}
|
||||
|
||||
function fortyFourToNinetySevenWinner()
|
||||
{
|
||||
$fortyFourToNinetySevenQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 1944)
|
||||
->where('vehicles.year', '<=', 1997)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $fortyFourToNinetySevenQuery->vehicle;
|
||||
}
|
||||
|
||||
function fortyFourToNinetySeven2ndWinner()
|
||||
{
|
||||
$fortyFourToNinetySeven2ndQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 1944)
|
||||
->where('vehicles.year', '<=', 1997)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $fortyFourToNinetySeven2ndQuery->vehicle;
|
||||
}
|
||||
|
||||
function NinetyEightToCurrentWinner()
|
||||
{
|
||||
$NinetyEightToCurrentQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 1998)
|
||||
//->where('vehicles.year', '<=', 1997)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $NinetyEightToCurrentQuery->vehicle;
|
||||
}
|
||||
|
||||
function NinetyEightToCurrent2ndWinner()
|
||||
{
|
||||
$NinetyEightToCurrent2ndQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 1998)
|
||||
//->where('vehicles.year', '<=', 1997)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $NinetyEightToCurrent2ndQuery->vehicle;
|
||||
}
|
||||
|
||||
// Truncate table first
|
||||
CarShowWinner::truncate();
|
||||
//Insert Best In Show Winner
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '6',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => bestInShowWinner()
|
||||
]
|
||||
);
|
||||
/*
|
||||
//Insert Best In Show 2nd Place Winner
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '6',
|
||||
'place' => 'second'
|
||||
],
|
||||
[
|
||||
'vehicle' => bestInShow2ndWinner()
|
||||
]
|
||||
);
|
||||
*/
|
||||
//Insert People's Choice Winner
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '3',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => pcWinner()
|
||||
]
|
||||
);
|
||||
/*
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '3',
|
||||
'place' => 'second'
|
||||
],
|
||||
[
|
||||
'vehicle' => pc2ndWinner()
|
||||
]
|
||||
);
|
||||
*/
|
||||
//Insert Year Award Winners
|
||||
//0-1943
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '17',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => zeroTo43Winner()
|
||||
]
|
||||
);
|
||||
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '17',
|
||||
'place' => 'second'
|
||||
],
|
||||
[
|
||||
'vehicle' => zeroTo432ndWinner()
|
||||
]
|
||||
);
|
||||
//1944-1997
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '18',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => fortyFourToNinetySevenWinner()
|
||||
]
|
||||
);
|
||||
$this->info('Starting tabulation...');
|
||||
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '18',
|
||||
'place' => 'second'
|
||||
],
|
||||
[
|
||||
'vehicle' => fortyFourToNinetySeven2ndWinner()
|
||||
]
|
||||
);
|
||||
|
||||
//1998-Current
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '19',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => NinetyEightToCurrentWinner()
|
||||
]
|
||||
);
|
||||
// 2. BEST IN SHOW (Category 6)
|
||||
$this->recordJudgedWinners(6, 'first', null, null, true);
|
||||
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '19',
|
||||
'place' => 'second'
|
||||
],
|
||||
[
|
||||
'vehicle' => NinetyEightToCurrent2ndWinner()
|
||||
]
|
||||
);
|
||||
// 3. PEOPLE'S CHOICE (Category 3)
|
||||
$this->recordPeoplesChoiceWinners(3, 'first');
|
||||
|
||||
// 4. YEAR CATEGORIES
|
||||
$yearConfigs = [
|
||||
['id' => 17, 'name' => '0-1942', 'start' => 0, 'end' => 1942],
|
||||
['id' => 18, 'name' => '1943-1969', 'start' => 1943, 'end' => 1969],
|
||||
['id' => 20, 'name' => '1970-2000', 'start' => 1970, 'end' => 2000],
|
||||
['id' => 19, 'name' => '2001-Current', 'start' => 2001, 'end' => 2026],
|
||||
];
|
||||
|
||||
foreach ($yearConfigs as $config) {
|
||||
$this->info("Processing Category: {$config['name']}");
|
||||
$this->recordJudgedWinners($config['id'], 'first', $config['start'], $config['end'], false);
|
||||
$this->recordJudgedWinners($config['id'], 'second', $config['start'], $config['end'], true);
|
||||
$this->recordJudgedWinners($config['id'], 'third', $config['start'], $config['end'], true);
|
||||
$this->recordJudgedWinners($config['id'], 'fourth', $config['start'], $config['end'], true);
|
||||
$this->recordJudgedWinners($config['id'], 'fifth', $config['start'], $config['end'], true);
|
||||
}
|
||||
|
||||
$this->info('Winners tabulated successfully.');
|
||||
}
|
||||
}
|
||||
|
||||
private function recordJudgedWinners($categoryId, $place, $startYear = null, $endYear = null, $excludeExisting = true)
|
||||
{
|
||||
$query = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->where('vehicles.doNotJudge', 0);
|
||||
|
||||
if ($excludeExisting) {
|
||||
$query->whereNotIn('vehicle_scores.vehicle', function ($q) {
|
||||
$q->select('vehicle')->from('car_show_winners');
|
||||
});
|
||||
}
|
||||
|
||||
if ($startYear !== null) $query->where('vehicles.year', '>=', $startYear);
|
||||
if ($endYear !== null) $query->where('vehicles.year', '<=', $endYear);
|
||||
|
||||
$maxScore = (clone $query)
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('sum(vehicle_scores.overall_score) as totalscore')
|
||||
->orderBy('totalscore', 'desc')
|
||||
->value('totalscore');
|
||||
|
||||
if ($maxScore) {
|
||||
$winners = $query->selectRaw('vehicles.id as vehicle_id, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->groupBy('vehicles.id')
|
||||
->having('totalscore', '=', $maxScore)
|
||||
->get();
|
||||
|
||||
foreach ($winners as $winner) {
|
||||
CarShowWinner::updateOrCreate([
|
||||
'category' => $categoryId,
|
||||
'place' => $place,
|
||||
'vehicle' => $winner->vehicle_id
|
||||
], [
|
||||
// Added totalscore here
|
||||
'total_score' => $winner->totalscore
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function recordPeoplesChoiceWinners($categoryId, $place)
|
||||
{
|
||||
$maxVotes = PeoplesChoice::join('vehicles', 'peoples_choice.vehicle', '=', 'vehicles.id')
|
||||
->where('vehicles.doNotJudge', 0)
|
||||
->whereNotIn('peoples_choice.vehicle', function ($q) {
|
||||
$q->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->groupBy('peoples_choice.vehicle')
|
||||
->selectRaw('sum(pc_count) as totalvotes')
|
||||
->orderBy('totalvotes', 'desc')
|
||||
->value('totalvotes');
|
||||
|
||||
if ($maxVotes) {
|
||||
$winners = PeoplesChoice::join('vehicles', 'peoples_choice.vehicle', '=', 'vehicles.id')
|
||||
->selectRaw('peoples_choice.vehicle as vehicle_id, sum(pc_count) as totalvotes')
|
||||
->where('vehicles.doNotJudge', 0)
|
||||
->whereNotIn('peoples_choice.vehicle', function ($q) {
|
||||
$q->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->groupBy('peoples_choice.vehicle')
|
||||
->having('totalvotes', '=', $maxVotes)
|
||||
->get();
|
||||
|
||||
foreach ($winners as $winner) {
|
||||
CarShowWinner::create([
|
||||
'category' => $categoryId,
|
||||
'place' => $place,
|
||||
'vehicle' => $winner->vehicle_id,
|
||||
// Added totalvotes here
|
||||
'total_score' => $winner->totalvotes
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,309 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\Models\Bidders;
|
||||
use App\Models\CarShowCategory;
|
||||
use App\Models\CarShowWinner;
|
||||
use App\Models\PeoplesChoice;
|
||||
use App\Models\Vehicles;
|
||||
use App\Models\VehicleScores;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
|
||||
class TabulateWinners extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'carshow:tabulatewinners';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Tabulate Show Winners, and add them to the CarShowWinner table';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
public function handle()
|
||||
{
|
||||
function bestInShowWinner()
|
||||
{
|
||||
$bestInShowWinnerQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $bestInShowWinnerQuery->vehicle;
|
||||
}
|
||||
|
||||
function bestInShow2ndWinner()
|
||||
{
|
||||
$bestInShow2ndWinnerQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $bestInShow2ndWinnerQuery->vehicle;
|
||||
}
|
||||
|
||||
function pcWinner()
|
||||
{
|
||||
$peoplesChoiceWinnerQuery = PeoplesChoice::join('vehicles', 'peoples_choice.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('peoples_choice.vehicle')
|
||||
->selectRaw('*, sum(pc_count) as totalscore')
|
||||
->whereNotIn('vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $peoplesChoiceWinnerQuery->vehicle;
|
||||
}
|
||||
|
||||
function pc2ndWinner()
|
||||
{
|
||||
$peoplesChoice2ndWinnerQuery = PeoplesChoice::join('vehicles', 'peoples_choice.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('peoples_choice.vehicle')
|
||||
->selectRaw('*, sum(pc_count) as totalscore')
|
||||
->whereNotIn('vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $peoplesChoice2ndWinnerQuery->vehicle;
|
||||
}
|
||||
|
||||
function zeroTo43Winner()
|
||||
{
|
||||
$zeroTo43Query = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 0)
|
||||
->where('vehicles.year', '<=', 1943)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $zeroTo43Query->vehicle;
|
||||
}
|
||||
|
||||
function zeroTo432ndWinner()
|
||||
{
|
||||
$zeroTo432ndQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 0)
|
||||
->where('vehicles.year', '<=', 1943)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $zeroTo432ndQuery->vehicle;
|
||||
}
|
||||
|
||||
function fortyFourToNinetySevenWinner()
|
||||
{
|
||||
$fortyFourToNinetySevenQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 1944)
|
||||
->where('vehicles.year', '<=', 1997)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $fortyFourToNinetySevenQuery->vehicle;
|
||||
}
|
||||
|
||||
function fortyFourToNinetySeven2ndWinner()
|
||||
{
|
||||
$fortyFourToNinetySeven2ndQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 1944)
|
||||
->where('vehicles.year', '<=', 1997)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $fortyFourToNinetySeven2ndQuery->vehicle;
|
||||
}
|
||||
|
||||
function NinetyEightToCurrentWinner()
|
||||
{
|
||||
$NinetyEightToCurrentQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 1998)
|
||||
//->where('vehicles.year', '<=', 1997)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $NinetyEightToCurrentQuery->vehicle;
|
||||
}
|
||||
|
||||
function NinetyEightToCurrent2ndWinner()
|
||||
{
|
||||
$NinetyEightToCurrent2ndQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 1998)
|
||||
//->where('vehicles.year', '<=', 1997)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $NinetyEightToCurrent2ndQuery->vehicle;
|
||||
}
|
||||
|
||||
// Truncate table first
|
||||
CarShowWinner::truncate();
|
||||
//Insert Best In Show Winner
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '6',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => bestInShowWinner()
|
||||
]
|
||||
);
|
||||
/*
|
||||
//Insert Best In Show 2nd Place Winner
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '6',
|
||||
'place' => 'second'
|
||||
],
|
||||
[
|
||||
'vehicle' => bestInShow2ndWinner()
|
||||
]
|
||||
);
|
||||
*/
|
||||
//Insert People's Choice Winner
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '3',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => pcWinner()
|
||||
]
|
||||
);
|
||||
/*
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '3',
|
||||
'place' => 'second'
|
||||
],
|
||||
[
|
||||
'vehicle' => pc2ndWinner()
|
||||
]
|
||||
);
|
||||
*/
|
||||
//Insert Year Award Winners
|
||||
//0-1943
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '17',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => zeroTo43Winner()
|
||||
]
|
||||
);
|
||||
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '17',
|
||||
'place' => 'second'
|
||||
],
|
||||
[
|
||||
'vehicle' => zeroTo432ndWinner()
|
||||
]
|
||||
);
|
||||
//1944-1997
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '18',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => fortyFourToNinetySevenWinner()
|
||||
]
|
||||
);
|
||||
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '18',
|
||||
'place' => 'second'
|
||||
],
|
||||
[
|
||||
'vehicle' => fortyFourToNinetySeven2ndWinner()
|
||||
]
|
||||
);
|
||||
|
||||
//1998-Current
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '19',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => NinetyEightToCurrentWinner()
|
||||
]
|
||||
);
|
||||
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '19',
|
||||
'place' => 'second'
|
||||
],
|
||||
[
|
||||
'vehicle' => NinetyEightToCurrent2ndWinner()
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,309 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\Models\Bidders;
|
||||
use App\Models\CarShowCategory;
|
||||
use App\Models\CarShowWinner;
|
||||
use App\Models\PeoplesChoice;
|
||||
use App\Models\Vehicles;
|
||||
use App\Models\VehicleScores;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
|
||||
class TabulateWinners extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'carshow:tabulatewinners';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Tabulate Show Winners, and add them to the CarShowWinner table';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
public function handle()
|
||||
{
|
||||
function bestInShowWinner()
|
||||
{
|
||||
$bestInShowWinnerQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $bestInShowWinnerQuery->vehicle;
|
||||
}
|
||||
|
||||
function bestInShow2ndWinner()
|
||||
{
|
||||
$bestInShow2ndWinnerQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $bestInShow2ndWinnerQuery->vehicle;
|
||||
}
|
||||
|
||||
function pcWinner()
|
||||
{
|
||||
$peoplesChoiceWinnerQuery = PeoplesChoice::join('vehicles', 'peoples_choice.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('peoples_choice.vehicle')
|
||||
->selectRaw('*, sum(pc_count) as totalscore')
|
||||
->whereNotIn('vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $peoplesChoiceWinnerQuery->vehicle;
|
||||
}
|
||||
|
||||
function pc2ndWinner()
|
||||
{
|
||||
$peoplesChoice2ndWinnerQuery = PeoplesChoice::join('vehicles', 'peoples_choice.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('peoples_choice.vehicle')
|
||||
->selectRaw('*, sum(pc_count) as totalscore')
|
||||
->whereNotIn('vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $peoplesChoice2ndWinnerQuery->vehicle;
|
||||
}
|
||||
|
||||
function zeroTo42Winner()
|
||||
{
|
||||
$zeroTo43Query = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 0)
|
||||
->where('vehicles.year', '<=', 1942)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $zeroTo43Query->vehicle;
|
||||
}
|
||||
|
||||
function fortyThreeToSixtyNineWinner()
|
||||
{
|
||||
$fortyThreeToSixtyNineQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 1943)
|
||||
->where('vehicles.year', '<=', 1969)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $fortyThreeToSixtyNineQuery->vehicle;
|
||||
}
|
||||
|
||||
function seventyToTwoThousandWinner()
|
||||
{
|
||||
$seventyToTwoThousandQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 1970)
|
||||
->where('vehicles.year', '<=', 2000)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $seventyToTwoThousandQuery->vehicle;
|
||||
}
|
||||
|
||||
function TwoThousandOneToCurrentWinner()
|
||||
{
|
||||
$TwoThousandOneToCurrentQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
||||
->groupBy('vehicles.id')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
||||
$query->select('vehicle')->from('car_show_winners');
|
||||
})
|
||||
->where('vehicles.year', '>=', 2001)
|
||||
//->where('vehicles.year', '<=', 1997)
|
||||
->where('vehicles.doNotJudge', '=', 0)
|
||||
->orderBy('totalscore','desc')
|
||||
->first();
|
||||
return $TwoThousandOneToCurrentQuery->vehicle;
|
||||
}
|
||||
|
||||
// Truncate table first
|
||||
CarShowWinner::truncate();
|
||||
//Insert Best In Show Winner
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '6',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => bestInShowWinner()
|
||||
]
|
||||
);
|
||||
|
||||
//Insert People's Choice Winner
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '3',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => pcWinner()
|
||||
]
|
||||
);
|
||||
|
||||
//Insert Year Award Winners
|
||||
//0-1942
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '17',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => zeroTo42Winner()
|
||||
]
|
||||
);
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '17',
|
||||
'place' => 'second'
|
||||
],
|
||||
[
|
||||
'vehicle' => zeroTo42Winner()
|
||||
]
|
||||
);
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '17',
|
||||
'place' => 'third'
|
||||
],
|
||||
[
|
||||
'vehicle' => zeroTo42Winner()
|
||||
]
|
||||
);
|
||||
//1943-1969
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '18',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => fortyThreeToSixtyNineWinner()
|
||||
]
|
||||
);
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '18',
|
||||
'place' => 'second'
|
||||
],
|
||||
[
|
||||
'vehicle' => fortyThreeToSixtyNineWinner()
|
||||
]
|
||||
);
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '18',
|
||||
'place' => 'third'
|
||||
],
|
||||
[
|
||||
'vehicle' => fortyThreeToSixtyNineWinner()
|
||||
]
|
||||
);
|
||||
|
||||
//1970-2000
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '20',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => seventyToTwoThousandWinner()
|
||||
]
|
||||
);
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '20',
|
||||
'place' => 'second'
|
||||
],
|
||||
[
|
||||
'vehicle' => seventyToTwoThousandWinner()
|
||||
]
|
||||
);
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '20',
|
||||
'place' => 'third'
|
||||
],
|
||||
[
|
||||
'vehicle' => seventyToTwoThousandWinner()
|
||||
]
|
||||
);
|
||||
|
||||
//2001-Current
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '19',
|
||||
'place' => 'first'
|
||||
],
|
||||
[
|
||||
'vehicle' => TwoThousandOneToCurrentWinner()
|
||||
]
|
||||
);
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '19',
|
||||
'place' => 'second'
|
||||
],
|
||||
[
|
||||
'vehicle' => TwoThousandOneToCurrentWinner()
|
||||
]
|
||||
);
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
'category' => '19',
|
||||
'place' => 'third'
|
||||
],
|
||||
[
|
||||
'vehicle' => TwoThousandOneToCurrentWinner()
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,9 @@ use App\Filament\Resources\BiddersResource\Pages;
|
||||
use App\Filament\Resources\BiddersResource\RelationManagers;
|
||||
use App\Models\Bidders;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -21,7 +21,7 @@ class BiddersResource extends Resource
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'idbidders';
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Silent Auction';
|
||||
|
||||
@@ -36,7 +36,7 @@ class BiddersResource extends Resource
|
||||
TextInput::make('bidder_state')->label('State'),
|
||||
TextInput::make('bidder_zip')->label('Zip'),
|
||||
TextInput::make('bidder_phone')->label('Phone Number')
|
||||
->mask(fn (TextInput\Mask $mask) => $mask->pattern('(000)000-0000')),
|
||||
->mask('(999) 999-9999'),
|
||||
TextInput::make('bidder_email')->label('Email'),
|
||||
TextInput::make('bidder_assigned_number')->label('Assigned Number'),
|
||||
]);
|
||||
@@ -63,7 +63,9 @@ class BiddersResource extends Resource
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
])
|
||||
->defaultSort('bidder_assigned_number');
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Filament\Resources\BiddersResource\Pages;
|
||||
|
||||
use App\Filament\Resources\BiddersResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateBidders extends CreateRecord
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\BiddersResource\Pages;
|
||||
|
||||
use App\Filament\Resources\BiddersResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditBidders extends EditRecord
|
||||
{
|
||||
protected static string $resource = BiddersResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\BiddersResource\Pages;
|
||||
|
||||
use App\Filament\Resources\BiddersResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListBidders extends ListRecords
|
||||
{
|
||||
protected static string $resource = BiddersResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\BiddersResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -16,7 +16,7 @@ class CheckoutRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'bidder_num';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -26,7 +26,7 @@ class CheckoutRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -52,7 +52,9 @@ class CheckoutRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\BiddersResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -17,7 +17,7 @@ class VehiclesRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'owner';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -34,7 +34,7 @@ class VehiclesRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -72,7 +72,9 @@ class VehiclesRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-5
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\BiddersResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -17,7 +17,7 @@ class WinningBidsRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'winning_bidder_num';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -28,7 +28,7 @@ class WinningBidsRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -55,7 +55,9 @@ class WinningBidsRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@ use App\Filament\Resources\CarShowCategoryResource\RelationManagers;
|
||||
use App\Filament\Resources\CarShowCategoryResource\RelationManagers\VehicleRelationManager;
|
||||
use App\Models\CarShowCategory;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -22,7 +22,7 @@ class CarShowCategoryResource extends Resource
|
||||
{
|
||||
protected static ?string $model = CarShowCategory::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Car Show';
|
||||
|
||||
@@ -49,7 +49,9 @@ class CarShowCategoryResource extends Resource
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
])
|
||||
->defaultSort('category_name');
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Filament\Resources\CarShowCategoryResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CarShowCategoryResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateCarShowCategory extends CreateRecord
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\CarShowCategoryResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CarShowCategoryResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditCarShowCategory extends EditRecord
|
||||
{
|
||||
protected static string $resource = CarShowCategoryResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\CarShowCategoryResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CarShowCategoryResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListCarShowCategories extends ListRecords
|
||||
{
|
||||
protected static string $resource = CarShowCategoryResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
|
||||
+8
-6
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\CarShowCategoryResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -18,7 +18,7 @@ class VehicleRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $inverseRelationship = 'vehicleType';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -28,7 +28,7 @@ class VehicleRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -51,8 +51,10 @@ class VehicleRelationManager extends RelationManager
|
||||
Tables\Actions\DissociateAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\DissociateBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\DissociateBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ use App\Filament\Resources\CarShowWinnerResource\Pages;
|
||||
use App\Filament\Resources\CarShowWinnerResource\RelationManagers;
|
||||
use App\Models\CarShowWinner;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -21,7 +21,7 @@ class CarShowWinnerResource extends Resource
|
||||
{
|
||||
protected static ?string $model = CarShowWinner::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Car Show';
|
||||
|
||||
@@ -57,7 +57,9 @@ class CarShowWinnerResource extends Resource
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Filament\Resources\CarShowWinnerResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CarShowWinnerResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateCarShowWinner extends CreateRecord
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\CarShowWinnerResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CarShowWinnerResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditCarShowWinner extends EditRecord
|
||||
{
|
||||
protected static string $resource = CarShowWinnerResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\CarShowWinnerResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CarShowWinnerResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListCarShowWinners extends ListRecords
|
||||
{
|
||||
protected static string $resource = CarShowWinnerResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
|
||||
+7
-5
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\CarShowWinnerResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -16,7 +16,7 @@ class AwardCategoryRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'id';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -26,7 +26,7 @@ class AwardCategoryRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -44,7 +44,9 @@ class AwardCategoryRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-5
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\CarShowWinnerResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -16,7 +16,7 @@ class AwardVehicleRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'id';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -26,7 +26,7 @@ class AwardVehicleRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -46,7 +46,9 @@ class AwardVehicleRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ use App\Filament\Resources\CheckoutResource\Pages;
|
||||
use App\Filament\Resources\CheckoutResource\RelationManagers;
|
||||
use App\Models\Checkout;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -24,7 +24,7 @@ class CheckoutResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Checkout::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Silent Auction';
|
||||
|
||||
@@ -40,15 +40,7 @@ class CheckoutResource extends Resource
|
||||
)
|
||||
->searchable(),
|
||||
TextInput::make('winnertotal')
|
||||
->label('Total Amount')
|
||||
->mask(
|
||||
fn (TextInput\Mask $mask) => $mask->money(
|
||||
prefix: '$',
|
||||
thousandsSeparator: ',',
|
||||
decimalPlaces: 2,
|
||||
isSigned: false
|
||||
)
|
||||
),
|
||||
->label('Total Amount'),
|
||||
Select::make('payment_method')
|
||||
->label('Payment Method')
|
||||
->options(PaymentMethods::all()->pluck('pm_name', 'pm_id'))
|
||||
@@ -78,7 +70,9 @@ class CheckoutResource extends Resource
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
])
|
||||
->defaultSort('bidders.bidder_assigned_number');
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Filament\Resources\CheckoutResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CheckoutResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateCheckout extends CreateRecord
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\CheckoutResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CheckoutResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditCheckout extends EditRecord
|
||||
{
|
||||
protected static string $resource = CheckoutResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\CheckoutResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CheckoutResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListCheckouts extends ListRecords
|
||||
{
|
||||
protected static string $resource = CheckoutResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\CheckoutResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -16,7 +16,7 @@ class BiddersRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'bidder_num';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -33,11 +33,11 @@ class BiddersRelationManager extends RelationManager
|
||||
Forms\Components\TextInput::make('bidder_phone')->label('Phone Number'),
|
||||
Forms\Components\TextInput::make('bidder_email')->label('Email'),
|
||||
Forms\Components\TextInput::make('bidder_assigned_number')->label('Assigned Number'),
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -56,7 +56,9 @@ class BiddersRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-5
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\CheckoutResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -16,7 +16,7 @@ class PaymentMethodRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'payment_method';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -26,7 +26,7 @@ class PaymentMethodRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -43,7 +43,9 @@ class PaymentMethodRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ use App\Filament\Resources\ItemsResource\Pages;
|
||||
use App\Filament\Resources\ItemsResource\RelationManagers;
|
||||
use App\Models\Items;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -21,7 +21,7 @@ class ItemsResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Items::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Silent Auction';
|
||||
|
||||
@@ -34,25 +34,9 @@ class ItemsResource extends Resource
|
||||
TextInput::make('item_desc')
|
||||
->label('Description'),
|
||||
TextInput::make('item_min_bid')
|
||||
->label('Minimum Bid')
|
||||
->mask(
|
||||
fn (TextInput\Mask $mask) => $mask->money(
|
||||
prefix: '$',
|
||||
thousandsSeparator: ',',
|
||||
decimalPlaces: 2,
|
||||
isSigned: false
|
||||
)
|
||||
),
|
||||
->label('Minimum Bid'),
|
||||
TextInput::make('item_est_value')
|
||||
->label('Estimated Value')
|
||||
->mask(
|
||||
fn (TextInput\Mask $mask) => $mask->money(
|
||||
prefix: '$',
|
||||
thousandsSeparator: ',',
|
||||
decimalPlaces: 2,
|
||||
isSigned: false
|
||||
)
|
||||
),
|
||||
->label('Estimated Value'),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -81,7 +65,9 @@ class ItemsResource extends Resource
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
])
|
||||
->defaultSort('item_assigned_num');
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Filament\Resources\ItemsResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ItemsResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateItems extends CreateRecord
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\ItemsResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ItemsResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditItems extends EditRecord
|
||||
{
|
||||
protected static string $resource = ItemsResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\ItemsResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ItemsResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListItems extends ListRecords
|
||||
{
|
||||
protected static string $resource = ItemsResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
|
||||
+7
-5
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\ItemsResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -16,7 +16,7 @@ class WinningBidsRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'iditems';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -26,7 +26,7 @@ class WinningBidsRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -43,7 +43,9 @@ class WinningBidsRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ use App\Filament\Resources\JudgesResource\Pages;
|
||||
use App\Filament\Resources\JudgesResource\RelationManagers;
|
||||
use App\Models\Judges;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -19,7 +19,7 @@ class JudgesResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Judges::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Car Show';
|
||||
|
||||
@@ -44,7 +44,9 @@ class JudgesResource extends Resource
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Filament\Resources\JudgesResource\Pages;
|
||||
|
||||
use App\Filament\Resources\JudgesResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateJudges extends CreateRecord
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\JudgesResource\Pages;
|
||||
|
||||
use App\Filament\Resources\JudgesResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditJudges extends EditRecord
|
||||
{
|
||||
protected static string $resource = JudgesResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\JudgesResource\Pages;
|
||||
|
||||
use App\Filament\Resources\JudgesResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListJudges extends ListRecords
|
||||
{
|
||||
protected static string $resource = JudgesResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
|
||||
+7
-5
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\JudgesResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -16,7 +16,7 @@ class VehicleScoresRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'judge';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -26,7 +26,7 @@ class VehicleScoresRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -43,7 +43,9 @@ class VehicleScoresRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ use App\Filament\Resources\PaymentMethodsResource\Pages;
|
||||
use App\Filament\Resources\PaymentMethodsResource\RelationManagers;
|
||||
use App\Models\PaymentMethods;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -19,7 +19,7 @@ class PaymentMethodsResource extends Resource
|
||||
{
|
||||
protected static ?string $model = PaymentMethods::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Silent Auction';
|
||||
|
||||
@@ -47,7 +47,9 @@ class PaymentMethodsResource extends Resource
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Filament\Resources\PaymentMethodsResource\Pages;
|
||||
|
||||
use App\Filament\Resources\PaymentMethodsResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreatePaymentMethods extends CreateRecord
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\PaymentMethodsResource\Pages;
|
||||
|
||||
use App\Filament\Resources\PaymentMethodsResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditPaymentMethods extends EditRecord
|
||||
{
|
||||
protected static string $resource = PaymentMethodsResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\PaymentMethodsResource\Pages;
|
||||
|
||||
use App\Filament\Resources\PaymentMethodsResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListPaymentMethods extends ListRecords
|
||||
{
|
||||
protected static string $resource = PaymentMethodsResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
|
||||
+7
-5
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\PaymentMethodsResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -16,7 +16,7 @@ class CheckoutRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'payment_method';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -26,7 +26,7 @@ class CheckoutRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -43,7 +43,9 @@ class CheckoutRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ use App\Filament\Resources\PeoplesChoiceResource\Pages;
|
||||
use App\Filament\Resources\PeoplesChoiceResource\RelationManagers;
|
||||
use App\Models\PeoplesChoice;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -21,7 +21,7 @@ class PeoplesChoiceResource extends Resource
|
||||
{
|
||||
protected static ?string $model = PeoplesChoice::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Car Show';
|
||||
|
||||
@@ -56,7 +56,9 @@ class PeoplesChoiceResource extends Resource
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Filament\Resources\PeoplesChoiceResource\Pages;
|
||||
|
||||
use App\Filament\Resources\PeoplesChoiceResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreatePeoplesChoice extends CreateRecord
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\PeoplesChoiceResource\Pages;
|
||||
|
||||
use App\Filament\Resources\PeoplesChoiceResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditPeoplesChoice extends EditRecord
|
||||
{
|
||||
protected static string $resource = PeoplesChoiceResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\PeoplesChoiceResource\Pages;
|
||||
|
||||
use App\Filament\Resources\PeoplesChoiceResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListPeoplesChoices extends ListRecords
|
||||
{
|
||||
protected static string $resource = PeoplesChoiceResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
|
||||
+7
-5
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\PeoplesChoiceResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -16,7 +16,7 @@ class VehiclesRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'vehicle';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -26,7 +26,7 @@ class VehiclesRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -43,7 +43,9 @@ class VehiclesRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ use App\Filament\Resources\VehicleScoresResource\Pages;
|
||||
use App\Filament\Resources\VehicleScoresResource\RelationManagers;
|
||||
use App\Models\VehicleScores;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -22,7 +22,7 @@ class VehicleScoresResource extends Resource
|
||||
{
|
||||
protected static ?string $model = VehicleScores::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Car Show';
|
||||
|
||||
@@ -59,7 +59,9 @@ class VehicleScoresResource extends Resource
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Filament\Resources\VehicleScoresResource\Pages;
|
||||
|
||||
use App\Filament\Resources\VehicleScoresResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateVehicleScores extends CreateRecord
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\VehicleScoresResource\Pages;
|
||||
|
||||
use App\Filament\Resources\VehicleScoresResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditVehicleScores extends EditRecord
|
||||
{
|
||||
protected static string $resource = VehicleScoresResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\VehicleScoresResource\Pages;
|
||||
|
||||
use App\Filament\Resources\VehicleScoresResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListVehicleScores extends ListRecords
|
||||
{
|
||||
protected static string $resource = VehicleScoresResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
|
||||
+7
-5
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\VehicleScoresResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -16,7 +16,7 @@ class JudgeRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'judge_number';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -26,7 +26,7 @@ class JudgeRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -43,7 +43,9 @@ class JudgeRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-5
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\VehicleScoresResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -16,7 +16,7 @@ class ScoredVehicleRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'id';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -26,7 +26,7 @@ class ScoredVehicleRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -46,7 +46,9 @@ class ScoredVehicleRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ use App\Filament\Resources\VehiclesResource\Pages;
|
||||
use App\Filament\Resources\VehiclesResource\RelationManagers;
|
||||
use App\Models\Vehicles;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Filament\Tables\Columns\BooleanColumn;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Select;
|
||||
@@ -24,7 +24,7 @@ class VehiclesResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Vehicles::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Car Show';
|
||||
|
||||
@@ -68,10 +68,11 @@ class VehiclesResource extends Resource
|
||||
TextColumn::make('vehicleType.category_name')
|
||||
->label('Type')
|
||||
->sortable(),
|
||||
BooleanColumn::make('doNotJudge')
|
||||
IconColumn::make('doNotJudge')
|
||||
->label('Judged?')
|
||||
->sortable()
|
||||
->falseIcon('heroicon-o-badge-check')
|
||||
->boolean()
|
||||
->falseIcon('heroicon-o-check-badge')
|
||||
->trueIcon('heroicon-o-x-circle')
|
||||
->trueColor('danger')
|
||||
->falseColor('success'),
|
||||
@@ -89,7 +90,9 @@ class VehiclesResource extends Resource
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
])
|
||||
->defaultSort('vehicleOwner.bidder_assigned_number');
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Filament\Resources\VehiclesResource\Pages;
|
||||
|
||||
use App\Filament\Resources\VehiclesResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateVehicles extends CreateRecord
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\VehiclesResource\Pages;
|
||||
|
||||
use App\Filament\Resources\VehiclesResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditVehicles extends EditRecord
|
||||
{
|
||||
protected static string $resource = VehiclesResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\VehiclesResource\Pages;
|
||||
|
||||
use App\Filament\Resources\VehiclesResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListVehicles extends ListRecords
|
||||
{
|
||||
protected static string $resource = VehiclesResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
|
||||
+7
-5
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -16,7 +16,7 @@ class CarShowWinnerRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'id';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -26,7 +26,7 @@ class CarShowWinnerRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -43,7 +43,9 @@ class CarShowWinnerRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-6
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -17,7 +17,7 @@ class VehicleOwnerRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'owner';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -39,11 +39,11 @@ class VehicleOwnerRelationManager extends RelationManager
|
||||
Forms\Components\TextInput::make('bidder_phone')->label('Phone Number'),
|
||||
Forms\Components\TextInput::make('bidder_email')->label('Email'),
|
||||
Forms\Components\TextInput::make('bidder_assigned_number')->label('Assigned Number'),
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -62,7 +62,9 @@ class VehicleOwnerRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-5
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -18,7 +18,7 @@ class VehicleScoresRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'id';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -35,7 +35,7 @@ class VehicleScoresRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -53,7 +53,9 @@ class VehicleScoresRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-6
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -17,7 +17,7 @@ class VehicleTypeRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'id';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -28,11 +28,11 @@ class VehicleTypeRelationManager extends RelationManager
|
||||
->createOptionForm([
|
||||
Forms\Components\TextInput::make('category_name'),
|
||||
Forms\Components\Toggle::make('vehicle_type')->inline(false),
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
@@ -49,7 +49,9 @@ class VehicleTypeRelationManager extends RelationManager
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ use App\Filament\Resources\WinningBidsResource\Pages;
|
||||
use App\Filament\Resources\WinningBidsResource\RelationManagers;
|
||||
use App\Models\WinningBids;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Filament\Tables\Columns\BooleanColumn;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
@@ -20,13 +20,11 @@ use App\Models\Bidders;
|
||||
use App\Models\Items;
|
||||
use Filament\Forms\Components\Select;
|
||||
|
||||
use function Ramsey\Uuid\v1;
|
||||
|
||||
class WinningBidsResource extends Resource
|
||||
{
|
||||
protected static ?string $model = WinningBids::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Silent Auction';
|
||||
|
||||
@@ -47,14 +45,8 @@ class WinningBidsResource extends Resource
|
||||
->searchable(),
|
||||
TextInput::make('winning_cost')
|
||||
->label('Winning Bid')
|
||||
->mask(
|
||||
fn (TextInput\Mask $mask) => $mask->money(
|
||||
prefix: '$',
|
||||
thousandsSeparator: ',',
|
||||
decimalPlaces: 2,
|
||||
isSigned: false
|
||||
)
|
||||
),
|
||||
->prefix('$')
|
||||
->numeric(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -73,7 +65,7 @@ class WinningBidsResource extends Resource
|
||||
->sortable(),
|
||||
TextColumn::make('winning_cost')
|
||||
->label('Winning Bid Amt')
|
||||
->money('usd', 'true')
|
||||
->money('usd')
|
||||
->sortable(),
|
||||
])
|
||||
->filters([
|
||||
@@ -83,7 +75,9 @@ class WinningBidsResource extends Resource
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]),
|
||||
])
|
||||
->defaultSort('items.item_assigned_num');
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Filament\Resources\WinningBidsResource\Pages;
|
||||
|
||||
use App\Filament\Resources\WinningBidsResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateWinningBids extends CreateRecord
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\WinningBidsResource\Pages;
|
||||
|
||||
use App\Filament\Resources\WinningBidsResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditWinningBids extends EditRecord
|
||||
{
|
||||
protected static string $resource = WinningBidsResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Resources\WinningBidsResource\Pages;
|
||||
|
||||
use App\Filament\Resources\WinningBidsResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListWinningBids extends ListRecords
|
||||
{
|
||||
protected static string $resource = WinningBidsResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
|
||||
@@ -490,6 +490,21 @@ class PagesController extends Controller
|
||||
->get();
|
||||
return view('carshowscores', ['carshowscore_results' => $carshowscore_results]);
|
||||
}
|
||||
public function showscoresbycar()
|
||||
{
|
||||
$carshowscore2_results = VehicleScores::with(['scoredVehicle'])
|
||||
->groupBy('vehicle')
|
||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
||||
//->orderBy('scoredVehicle.vehicleOwner.bidder_assigned_number')
|
||||
->orderByRaw('CAST((
|
||||
SELECT owner
|
||||
FROM vehicles
|
||||
WHERE vehicles.id = vehicle_scores.vehicle
|
||||
LIMIT 1
|
||||
) AS UNSIGNED) ASC')
|
||||
->get();
|
||||
return view('carshowscores', ['carshowscore_results' => $carshowscore2_results]);
|
||||
}
|
||||
public function showcarlist()
|
||||
{
|
||||
$showcarlist_results = Bidders::has('vehicles')
|
||||
|
||||
@@ -24,10 +24,13 @@ class Bidders extends Model
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function checkout()
|
||||
{
|
||||
|
||||
@@ -9,19 +9,19 @@ class CarShowCategory extends Model
|
||||
protected $table = 'car_show_categories';
|
||||
protected static ?string $recordTitleAttribute = 'category_name';
|
||||
|
||||
protected $casts = [
|
||||
'vehicle_type' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'category_name',
|
||||
'vehicle_type'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'vehicle_type' => 'boolean',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function vehicle()
|
||||
{
|
||||
|
||||
@@ -10,13 +10,17 @@ class CarShowWinner extends Model
|
||||
protected $fillable = [
|
||||
'vehicle',
|
||||
'category',
|
||||
'place'
|
||||
'place',
|
||||
'total_score'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function awardVehicle()
|
||||
{
|
||||
|
||||
@@ -21,10 +21,13 @@ class Checkout extends Model
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function bidders()
|
||||
{
|
||||
|
||||
@@ -19,10 +19,13 @@ class Items extends Model
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function winningBids()
|
||||
{
|
||||
|
||||
@@ -13,10 +13,13 @@ class Judges extends Model
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function vehicleScores()
|
||||
{
|
||||
|
||||
@@ -16,10 +16,13 @@ class PaymentMethods extends Model
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function checkout()
|
||||
{
|
||||
|
||||
@@ -14,10 +14,13 @@ class PeoplesChoice extends Model
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function vehicles()
|
||||
{
|
||||
|
||||
@@ -15,10 +15,13 @@ class VehicleScores extends Model
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function judges()
|
||||
{
|
||||
|
||||
@@ -8,10 +8,6 @@ class Vehicles extends Model
|
||||
{
|
||||
protected $table = 'vehicles';
|
||||
|
||||
protected $casts = [
|
||||
'owner' => 'integer'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'year',
|
||||
'make',
|
||||
@@ -21,10 +17,14 @@ class Vehicles extends Model
|
||||
'owner'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'owner' => 'integer',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function vehicleType()
|
||||
{
|
||||
|
||||
@@ -18,10 +18,13 @@ class WinningBids extends Model
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function items()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers\Filament;
|
||||
|
||||
use Filament\Http\Middleware\Authenticate;
|
||||
use Filament\Http\Middleware\AuthenticateSession;
|
||||
use Filament\Http\Middleware\DisableBladeIconComponents;
|
||||
use Filament\Http\Middleware\DispatchServingFilamentEvent;
|
||||
use Filament\Pages;
|
||||
use Filament\Panel;
|
||||
use Filament\PanelProvider;
|
||||
use Filament\Support\Colors\Color;
|
||||
use Filament\Widgets;
|
||||
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies;
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
|
||||
use Illuminate\Routing\Middleware\SubstituteBindings;
|
||||
use Illuminate\Session\Middleware\StartSession;
|
||||
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
||||
|
||||
class AdminPanelProvider extends PanelProvider
|
||||
{
|
||||
public function panel(Panel $panel): Panel
|
||||
{
|
||||
return $panel
|
||||
->default()
|
||||
->id('admin')
|
||||
->path('admin')
|
||||
->login()
|
||||
->brandName(env('APP_NAME'))
|
||||
->homeUrl('/')
|
||||
->colors([
|
||||
'primary' => Color::Amber,
|
||||
])
|
||||
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
|
||||
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
|
||||
->pages([
|
||||
Pages\Dashboard::class,
|
||||
])
|
||||
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
|
||||
->widgets([
|
||||
Widgets\AccountWidget::class,
|
||||
Widgets\FilamentInfoWidget::class,
|
||||
])
|
||||
->middleware([
|
||||
EncryptCookies::class,
|
||||
AddQueuedCookiesToResponse::class,
|
||||
StartSession::class,
|
||||
AuthenticateSession::class,
|
||||
ShareErrorsFromSession::class,
|
||||
VerifyCsrfToken::class,
|
||||
SubstituteBindings::class,
|
||||
DisableBladeIconComponents::class,
|
||||
DispatchServingFilamentEvent::class,
|
||||
])
|
||||
->authMiddleware([
|
||||
Authenticate::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
+18
-2
@@ -6,8 +6,9 @@ use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Filament\Models\Contracts\FilamentUser;
|
||||
use Filament\Models\Contracts\HasName;
|
||||
use Filament\Panel;
|
||||
|
||||
class User extends Authenticatable implements FilamentUser,HasName
|
||||
class User extends Authenticatable implements FilamentUser, HasName
|
||||
{
|
||||
use Notifiable;
|
||||
|
||||
@@ -28,10 +29,25 @@ class User extends Authenticatable implements FilamentUser,HasName
|
||||
protected $hidden = [
|
||||
'password', 'remember_token',
|
||||
];
|
||||
public function canAccessFilament(): bool
|
||||
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
|
||||
public function canAccessPanel(Panel $panel): bool
|
||||
{
|
||||
return str_ends_with($this->email, '@tfmm.co');
|
||||
}
|
||||
|
||||
public function getFilamentName(): string
|
||||
{
|
||||
return "{$this->name}";
|
||||
|
||||
+66
-65
@@ -1,68 +1,69 @@
|
||||
{
|
||||
"name": "laravel/laravel",
|
||||
"description": "The Laravel Framework.",
|
||||
"keywords": ["framework", "laravel"],
|
||||
"license": "MIT",
|
||||
"type": "project",
|
||||
"require": {
|
||||
"php": ">=7.0.0",
|
||||
"barryvdh/laravel-snappy": "^1.0",
|
||||
"carlos-meneses/laravel-mpdf": "^2.1",
|
||||
"filament/filament": "^2.0",
|
||||
"laravel/framework": "^9.0",
|
||||
"laravel/tinker": "^2.0",
|
||||
"laravel/ui": "^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3.7",
|
||||
"filp/whoops": "~2.0",
|
||||
"mockery/mockery": "0.9.*",
|
||||
"phpunit/phpunit": "^9.0"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"database"
|
||||
],
|
||||
"psr-4": {
|
||||
"App\\": "app/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Tests\\": "tests/"
|
||||
"name": "laravel/laravel",
|
||||
"description": "The Laravel Framework.",
|
||||
"keywords": ["framework", "laravel"],
|
||||
"license": "MIT",
|
||||
"type": "project",
|
||||
"require": {
|
||||
"php": "^8.2",
|
||||
"barryvdh/laravel-snappy": "^1.0",
|
||||
"carlos-meneses/laravel-mpdf": "^2.1",
|
||||
"filament/filament": "^3.2",
|
||||
"laravel/framework": "^11.0",
|
||||
"laravel/tinker": "^2.9",
|
||||
"laravel/ui": "^4.2"
|
||||
},
|
||||
"files": [
|
||||
"app/Helpers/BidderSelectList.php",
|
||||
"app/Helpers/CheckoutBidderSelectList.php",
|
||||
"app/Helpers/ItemSelectList.php",
|
||||
"app/Helpers/PaymentMethodSelectList.php",
|
||||
"app/Helpers/WinningBidderSelectList.php",
|
||||
"app/Helpers/WinningBidSelectList.php"
|
||||
]
|
||||
|
||||
},
|
||||
"scripts": {
|
||||
"post-root-package-install": [
|
||||
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||
],
|
||||
"post-create-project-cmd": [
|
||||
"php artisan key:generate"
|
||||
],
|
||||
"post-install-cmd": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postInstall"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
|
||||
"@php artisan filament:upgrade"
|
||||
],
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
"@php artisan package:discover"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true,
|
||||
"optimize-autoloader": true
|
||||
}
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3.8",
|
||||
"filp/whoops": "^2.14",
|
||||
"mockery/mockery": "^1.6",
|
||||
"nunomaduro/collision": "^8.1",
|
||||
"phpunit/phpunit": "^11.0"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"database"
|
||||
],
|
||||
"psr-4": {
|
||||
"App\\": "app/"
|
||||
},
|
||||
"files": [
|
||||
"app/Helpers/BidderSelectList.php",
|
||||
"app/Helpers/CheckoutBidderSelectList.php",
|
||||
"app/Helpers/ItemSelectList.php",
|
||||
"app/Helpers/PaymentMethodSelectList.php",
|
||||
"app/Helpers/WinningBidderSelectList.php",
|
||||
"app/Helpers/WinningBidSelectList.php"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"post-root-package-install": [
|
||||
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||
],
|
||||
"post-create-project-cmd": [
|
||||
"php artisan key:generate"
|
||||
],
|
||||
"post-install-cmd": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postInstall"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
|
||||
"@php artisan filament:upgrade"
|
||||
],
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
"@php artisan package:discover",
|
||||
"@php artisan filament:upgrade"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true,
|
||||
"optimize-autoloader": true
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+3957
-1978
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -175,7 +175,8 @@ return [
|
||||
App\Providers\AuthServiceProvider::class,
|
||||
// App\Providers\BroadcastServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
App\Providers\Filament\AdminPanelProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
|
||||
],
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up():
|
||||
void {
|
||||
Schema::table('car_show_winners', function (Blueprint $table) {
|
||||
$table->integer('total_score')->after('vehicle');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down():
|
||||
void {
|
||||
Schema::table('car_show_winners', function (Blueprint $table) {
|
||||
$table->dropColumn('total_score');
|
||||
});
|
||||
}
|
||||
};
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+49
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
.fi-pagination-items,.fi-pagination-overview,.fi-pagination-records-per-page-select:not(.fi-compact){display:none}@supports (container-type:inline-size){.fi-pagination{container-type:inline-size}@container (min-width: 28rem){.fi-pagination-records-per-page-select.fi-compact{display:none}.fi-pagination-records-per-page-select:not(.fi-compact){display:inline}}@container (min-width: 56rem){.fi-pagination:not(.fi-simple)>.fi-pagination-previous-btn{display:none}.fi-pagination-overview{display:inline}.fi-pagination:not(.fi-simple)>.fi-pagination-next-btn{display:none}.fi-pagination-items{display:flex}}}@supports not (container-type:inline-size){@media (min-width:640px){.fi-pagination-records-per-page-select.fi-compact{display:none}.fi-pagination-records-per-page-select:not(.fi-compact){display:inline}}@media (min-width:768px){.fi-pagination:not(.fi-simple)>.fi-pagination-previous-btn{display:none}.fi-pagination-overview{display:inline}.fi-pagination:not(.fi-simple)>.fi-pagination-next-btn{display:none}.fi-pagination-items{display:flex}}}.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity;white-space:normal}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.tippy-content{padding:5px 9px;position:relative;z-index:1}.tippy-box[data-theme~=light]{background-color:#fff;box-shadow:0 0 20px 4px #9aa1b126,0 4px 80px -8px #24282f40,0 4px 4px -2px #5b5e6926;color:#26323d}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff}.tippy-box[data-theme~=light]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light]>.tippy-svg-arrow{fill:#fff}.fi-sortable-ghost{opacity:.3}
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+13
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+123
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
function r({state:o}){return{state:o,rows:[],shouldUpdateRows:!0,init:function(){this.updateRows(),this.rows.length<=0?this.rows.push({key:"",value:""}):this.updateState(),this.$watch("state",(t,e)=>{let s=i=>i===null?0:Array.isArray(i)?i.length:typeof i!="object"?0:Object.keys(i).length;s(t)===0&&s(e)===0||this.updateRows()})},addRow:function(){this.rows.push({key:"",value:""}),this.updateState()},deleteRow:function(t){this.rows.splice(t,1),this.rows.length<=0&&this.addRow(),this.updateState()},reorderRows:function(t){let e=Alpine.raw(this.rows);this.rows=[];let s=e.splice(t.oldIndex,1)[0];e.splice(t.newIndex,0,s),this.$nextTick(()=>{this.rows=e,this.updateState()})},updateRows:function(){if(!this.shouldUpdateRows){this.shouldUpdateRows=!0;return}let t=[];for(let[e,s]of Object.entries(this.state??{}))t.push({key:e,value:s});this.rows=t},updateState:function(){let t={};this.rows.forEach(e=>{e.key===""||e.key===null||(t[e.key]=e.value)}),this.shouldUpdateRows=!1,this.state=t}}}export{r as default};
|
||||
File diff suppressed because one or more lines are too long
+150
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
function i({state:a,splitKeys:n}){return{newTag:"",state:a,createTag:function(){if(this.newTag=this.newTag.trim(),this.newTag!==""){if(this.state.includes(this.newTag)){this.newTag="";return}this.state.push(this.newTag),this.newTag=""}},deleteTag:function(t){this.state=this.state.filter(e=>e!==t)},reorderTags:function(t){let e=this.state.splice(t.oldIndex,1)[0];this.state.splice(t.newIndex,0,e),this.state=[...this.state]},input:{"x-on:blur":"createTag()","x-model":"newTag","x-on:keydown"(t){["Enter",...n].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.createTag())},"x-on:paste"(){this.$nextTick(()=>{if(n.length===0){this.createTag();return}let t=n.map(e=>e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")).join("|");this.newTag.split(new RegExp(t,"g")).forEach(e=>{this.newTag=e,this.createTag()})})}}}}export{i as default};
|
||||
@@ -0,0 +1 @@
|
||||
function r({initialHeight:t,shouldAutosize:i,state:s}){return{state:s,wrapperEl:null,init:function(){this.wrapperEl=this.$el.parentNode,this.setInitialHeight(),i?this.$watch("state",()=>{this.resize()}):this.setUpResizeObserver()},setInitialHeight:function(){this.$el.scrollHeight<=0||(this.wrapperEl.style.height=t+"rem")},resize:function(){if(this.setInitialHeight(),this.$el.scrollHeight<=0)return;let e=this.$el.scrollHeight+"px";this.wrapperEl.style.height!==e&&(this.wrapperEl.style.height=e)},setUpResizeObserver:function(){new ResizeObserver(()=>{this.wrapperEl.style.height=this.$el.style.height}).observe(this.$el)}}}export{r as default};
|
||||
File diff suppressed because one or more lines are too long
+46
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
function d(){return{checkboxClickController:null,collapsedGroups:[],isLoading:!1,selectedRecords:[],shouldCheckUniqueSelection:!0,lastCheckedRecord:null,livewireId:null,init:function(){this.livewireId=this.$root.closest("[wire\\:id]").attributes["wire:id"].value,this.$wire.$on("deselectAllTableRecords",()=>this.deselectAllRecords()),this.$watch("selectedRecords",()=>{if(!this.shouldCheckUniqueSelection){this.shouldCheckUniqueSelection=!0;return}this.selectedRecords=[...new Set(this.selectedRecords)],this.shouldCheckUniqueSelection=!1}),this.$nextTick(()=>this.watchForCheckboxClicks()),Livewire.hook("element.init",({component:e})=>{e.id===this.livewireId&&this.watchForCheckboxClicks()})},mountAction:function(e,t=null){this.$wire.set("selectedTableRecords",this.selectedRecords,!1),this.$wire.mountTableAction(e,t)},mountBulkAction:function(e){this.$wire.set("selectedTableRecords",this.selectedRecords,!1),this.$wire.mountTableBulkAction(e)},toggleSelectRecordsOnPage:function(){let e=this.getRecordsOnPage();if(this.areRecordsSelected(e)){this.deselectRecords(e);return}this.selectRecords(e)},toggleSelectRecordsInGroup:async function(e){this.isLoading=!0;let t=await this.$wire.getGroupedSelectableTableRecordKeys(e);this.areRecordsSelected(this.getRecordsInGroupOnPage(e))?this.deselectRecords(t):this.selectRecords(t),this.isLoading=!1},getRecordsInGroupOnPage:function(e){let t=[];for(let s of this.$root?.getElementsByClassName("fi-ta-record-checkbox")??[])s.dataset.group===e&&t.push(s.value);return t},getRecordsOnPage:function(){let e=[];for(let t of this.$root?.getElementsByClassName("fi-ta-record-checkbox")??[])e.push(t.value);return e},selectRecords:function(e){for(let t of e)this.isRecordSelected(t)||this.selectedRecords.push(t)},deselectRecords:function(e){for(let t of e){let s=this.selectedRecords.indexOf(t);s!==-1&&this.selectedRecords.splice(s,1)}},selectAllRecords:async function(){this.isLoading=!0,this.selectedRecords=await this.$wire.getAllSelectableTableRecordKeys(),this.isLoading=!1},deselectAllRecords:function(){this.selectedRecords=[]},isRecordSelected:function(e){return this.selectedRecords.includes(e)},areRecordsSelected:function(e){return e.every(t=>this.isRecordSelected(t))},toggleCollapseGroup:function(e){if(this.isGroupCollapsed(e)){this.collapsedGroups.splice(this.collapsedGroups.indexOf(e),1);return}this.collapsedGroups.push(e)},isGroupCollapsed:function(e){return this.collapsedGroups.includes(e)},resetCollapsedGroups:function(){this.collapsedGroups=[]},watchForCheckboxClicks:function(){this.checkboxClickController&&this.checkboxClickController.abort(),this.checkboxClickController=new AbortController;let{signal:e}=this.checkboxClickController;this.$root?.addEventListener("click",t=>t.target?.matches(".fi-ta-record-checkbox")&&this.handleCheckboxClick(t,t.target),{signal:e})},handleCheckboxClick:function(e,t){if(!this.lastChecked){this.lastChecked=t;return}if(e.shiftKey){let s=Array.from(this.$root?.getElementsByClassName("fi-ta-record-checkbox")??[]);if(!s.includes(this.lastChecked)){this.lastChecked=t;return}let l=s.indexOf(this.lastChecked),r=s.indexOf(t),o=[l,r].sort((c,n)=>c-n),i=[];for(let c=o[0];c<=o[1];c++)s[c].checked=t.checked,i.push(s[c].value);t.checked?this.selectRecords(i):this.deselectRecords(i)}this.lastChecked=t}}}export{d as default};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user