Compare commits
210 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d64e1d5578 | |||
| ad66fef19b | |||
| 5a7684bc8c | |||
| aed29fbf56 | |||
| 816fba5121 | |||
| ddbfc642f2 | |||
| b6db2f200b | |||
| ef4ef144a6 | |||
| 7a338c6a31 | |||
| 44521ab677 | |||
| 4b6839aafa | |||
| 186865890d | |||
| cfc8f58a1e | |||
| 59f6c733ac | |||
| a4fff7aea3 | |||
| 47ae95f060 | |||
| 377cc4ab77 | |||
| 947fb290f6 | |||
| 0c794c89a4 | |||
| 55925c8abf | |||
| 20349e57c4 | |||
| 10aa32e19c | |||
| 8bd68a42bd | |||
| fc96cb96ed | |||
| d25890d3ac | |||
| f6df7aa08e | |||
| db1d4ba165 | |||
| a30b70bf27 | |||
| 193d7ecb1f | |||
| a01afdc321 | |||
| ee526dce89 | |||
| 5eea2de51e | |||
| 48fd3d2b35 | |||
| 237fe9f07b | |||
| bab18b6d26 | |||
| 6d8f2b8ead | |||
| 849794ff90 | |||
| 24beacae7e | |||
| 4283399ffa | |||
| de1443b300 | |||
| 02f0fed769 | |||
| 87f9befa72 | |||
| d32c2d6a99 | |||
| e3a64c6ba3 | |||
| 9326fb5026 | |||
| bdd06abcd1 | |||
| 72dfb16018 | |||
| 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 | |||
| 925032b146 | |||
| 78715cc3ef | |||
| 2ef2f216cb | |||
| fac607c57d | |||
| b85754b888 | |||
| bc7a52ab28 | |||
| efa2e08c31 | |||
| 5b814baaa7 | |||
| 44fffdcc97 | |||
| 25100251b7 | |||
| a49bb5e218 | |||
| 0d73255ee8 | |||
| a2f3b2c380 | |||
| 5e7155457d | |||
| aed20ddd00 | |||
| e6e49ddfcb | |||
| 082c110616 | |||
| 24841b3b98 | |||
| b51e56ff6f | |||
| eb2dee7c13 | |||
| 99d8b9ec0a | |||
| 892bf2b09f | |||
| f4255621fe | |||
| a13c9be41c | |||
| ef96dc7cd8 | |||
| 1629e22b63 | |||
| e484c0df98 | |||
| 8f95e68e61 | |||
| bc6f3c05d8 | |||
| d91e1703e7 | |||
| a588f397b2 | |||
| ee9d54eeff | |||
| 9ffb0cafc5 | |||
| 6d38150b1d | |||
| d4a3fb430b | |||
| f4a19837bb | |||
| 60b526adf8 | |||
| b6641efea7 | |||
| a15f64253b | |||
| 2399774b52 | |||
| cf8cf1a00c | |||
| 0991c4b5eb | |||
| 875ae802e2 | |||
| bee1c9dd0d | |||
| 65f5d194ed | |||
| 7211867d1c | |||
| 1a20df54a1 | |||
| cb7008a74f | |||
| 8536fb0c7b | |||
| 5249fff6f6 | |||
| 421b19b3e9 | |||
| ad3dbe3b42 | |||
| e0a5e98a6a | |||
| c9843c6404 | |||
| 3382de51d5 | |||
| 401f432a96 | |||
| 1d3abb8b8d | |||
| b3e2909728 | |||
| 4f751c32b0 | |||
| 484e2c23ec | |||
| 78c72d1937 | |||
| 6a118fc047 | |||
| 910ab01712 | |||
| e23fe4eacf | |||
| 69bc4f3313 | |||
| 5cd5b84ebd | |||
| 4922235796 | |||
| be12b4756d | |||
| 9bc97078fc | |||
| 012a95bc36 | |||
| eab6be34be | |||
| 0a826b5dfd | |||
| dbb2821472 | |||
| 3b93552ec7 | |||
| 87be8975c0 | |||
| 24ac516631 | |||
| acf63aeb46 | |||
| 10ce7b5224 | |||
| 3033006fd6 | |||
| 82bfe4da3f | |||
| 5a330c6cda | |||
| e618bd4b56 | |||
| 6191923269 | |||
| 05d347914e | |||
| 2bbb10e55b | |||
| ae21c17f60 | |||
| 56b6180432 | |||
| 910a8f79fb | |||
| 3c6097a5b2 | |||
| 7d4964e268 | |||
| eebffa5fa2 | |||
| e0182f4127 | |||
| b2c91d16f7 | |||
| 0133c405a5 | |||
| 9ac36b7ab8 | |||
| e5b7b58cc8 | |||
| 0ba081bb8c | |||
| 31eb22c3c2 | |||
| afa1c78db4 | |||
| d4d33e3267 | |||
| 6e2bdee1c6 | |||
| 83a89329b8 | |||
| fb50e5624f | |||
| 8fbdcc2a2f | |||
| 7fdc4bbc42 | |||
| fde7c758d7 | |||
| b6ff1755ad | |||
| 92daf26e8a | |||
| ef7aa5fe90 | |||
| c83921b40a | |||
| 2068289064 | |||
| 2b735c9fbf | |||
| c63f4b6042 | |||
| 7e001c7b56 | |||
| 5cd77faf79 | |||
| cef7923531 | |||
| 2192f9de7c | |||
| de31581290 | |||
| 3ac8d12c15 | |||
| 003e686224 | |||
| f54e41aef9 | |||
| a3f751e8fa | |||
| 01ce1a4f58 | |||
| 17f6924abb | |||
| bc534f4d74 | |||
| dba67cec9c |
@@ -0,0 +1 @@
|
|||||||
|
{"version":2,"defects":{"Tests\\Feature\\MyWinningsTest::test_mywinnings_form_is_accessible":8,"Tests\\Feature\\MyWinningsTest::test_mywinnings_results_show_correct_data":8,"Tests\\Feature\\MyWinningsTest::test_mywinnings_invalid_bidder_shows_error":8},"times":{"Tests\\Unit\\PhoneFormattingTest::it_formats_a_10_digit_phone_number":0.018,"Tests\\Unit\\PhoneFormattingTest::it_strips_non_numeric_characters_before_formatting":0,"Tests\\Unit\\PhoneFormattingTest::it_returns_original_value_if_not_10_digits":0,"Tests\\Unit\\PhoneFormattingTest::bidder_model_accessor_formats_phone_number":0.003}}
|
||||||
@@ -3,306 +3,119 @@
|
|||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use App\Models\Bidders;
|
|
||||||
use App\Models\CarShowCategory;
|
|
||||||
use App\Models\CarShowWinner;
|
use App\Models\CarShowWinner;
|
||||||
use App\Models\PeoplesChoice;
|
use App\Models\PeoplesChoice;
|
||||||
use App\Models\Vehicles;
|
|
||||||
use App\Models\VehicleScores;
|
use App\Models\VehicleScores;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
|
||||||
class TabulateWinners extends Command
|
class TabulateWinners extends Command
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'carshow:tabulatewinners';
|
protected $signature = 'carshow:tabulatewinners';
|
||||||
|
protected $description = 'Tabulate Show Winners. Year Category 1st places can overlap with Best in Show/People\'s Choice.';
|
||||||
/**
|
|
||||||
* 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()
|
public function handle()
|
||||||
{
|
{
|
||||||
function bestInShowWinner()
|
CarShowWinner::truncate();
|
||||||
{
|
|
||||||
$bestInShowWinnerQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
$this->info('Starting tabulation...');
|
||||||
->groupBy('vehicles.id')
|
|
||||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
// 2. BEST IN SHOW (Category 6)
|
||||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
$this->recordJudgedWinners(6, 'first', null, null, true);
|
||||||
$query->select('vehicle')->from('car_show_winners');
|
|
||||||
})
|
// 3. PEOPLE'S CHOICE (Category 3)
|
||||||
->where('vehicles.doNotJudge', '=', 0)
|
$this->recordPeoplesChoiceWinners(3, 'first');
|
||||||
->orderBy('totalscore','desc')
|
|
||||||
->first();
|
// 4. YEAR CATEGORIES
|
||||||
return $bestInShowWinnerQuery->vehicle;
|
$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);
|
||||||
}
|
}
|
||||||
|
|
||||||
function bestInShow2ndWinner()
|
$this->info('Winners tabulated successfully.');
|
||||||
{
|
|
||||||
$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()
|
private function recordJudgedWinners($categoryId, $place, $startYear = null, $endYear = null, $excludeExisting = true)
|
||||||
{
|
{
|
||||||
$peoplesChoiceWinnerQuery = PeoplesChoice::join('vehicles', 'peoples_choice.vehicle', '=', 'vehicles.id')
|
$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')
|
->groupBy('peoples_choice.vehicle')
|
||||||
->selectRaw('*, sum(pc_count) as totalscore')
|
->selectRaw('sum(pc_count) as totalvotes')
|
||||||
->whereNotIn('vehicle', function($query){
|
->orderBy('totalvotes', 'desc')
|
||||||
$query->select('vehicle')->from('car_show_winners');
|
->value('totalvotes');
|
||||||
})
|
|
||||||
->where('vehicles.doNotJudge', '=', 0)
|
|
||||||
->orderBy('totalscore','desc')
|
|
||||||
->first();
|
|
||||||
return $peoplesChoiceWinnerQuery->vehicle;
|
|
||||||
}
|
|
||||||
|
|
||||||
function pc2ndWinner()
|
if ($maxVotes) {
|
||||||
{
|
$winners = PeoplesChoice::join('vehicles', 'peoples_choice.vehicle', '=', 'vehicles.id')
|
||||||
$peoplesChoice2ndWinnerQuery = 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')
|
->groupBy('peoples_choice.vehicle')
|
||||||
->selectRaw('*, sum(pc_count) as totalscore')
|
->having('totalvotes', '=', $maxVotes)
|
||||||
->whereNotIn('vehicle', function($query){
|
->get();
|
||||||
$query->select('vehicle')->from('car_show_winners');
|
|
||||||
})
|
|
||||||
->where('vehicles.doNotJudge', '=', 0)
|
|
||||||
->orderBy('totalscore','desc')
|
|
||||||
->first();
|
|
||||||
return $peoplesChoice2ndWinnerQuery->vehicle;
|
|
||||||
}
|
|
||||||
|
|
||||||
function zeroTo43Winner()
|
foreach ($winners as $winner) {
|
||||||
{
|
CarShowWinner::create([
|
||||||
$zeroTo43Query = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
|
'category' => $categoryId,
|
||||||
->groupBy('vehicles.id')
|
'place' => $place,
|
||||||
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
|
'vehicle' => $winner->vehicle_id,
|
||||||
->whereNotIn('vehicle_scores.vehicle', function($query){
|
// Added totalvotes here
|
||||||
$query->select('vehicle')->from('car_show_winners');
|
'total_score' => $winner->totalvotes
|
||||||
})
|
]);
|
||||||
->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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//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 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()
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
+29
-44
@@ -2,64 +2,49 @@
|
|||||||
|
|
||||||
namespace App\Exceptions;
|
namespace App\Exceptions;
|
||||||
|
|
||||||
use Exception;
|
|
||||||
use Illuminate\Auth\AuthenticationException;
|
|
||||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
class Handler extends ExceptionHandler
|
class Handler extends ExceptionHandler
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* A list of the exception types that should not be reported.
|
* A list of exception types with their corresponding custom log levels.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
|
||||||
*/
|
*/
|
||||||
protected $dontReport = [
|
protected $levels = [
|
||||||
\Illuminate\Auth\AuthenticationException::class,
|
//
|
||||||
\Illuminate\Auth\Access\AuthorizationException::class,
|
|
||||||
\Symfony\Component\HttpKernel\Exception\HttpException::class,
|
|
||||||
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
|
|
||||||
\Illuminate\Session\TokenMismatchException::class,
|
|
||||||
\Illuminate\Validation\ValidationException::class,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Report or log an exception.
|
* A list of the exception types that are not reported.
|
||||||
*
|
*
|
||||||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
* @var array<int, class-string<\Throwable>>
|
||||||
|
*/
|
||||||
|
protected $dontReport = [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A list of the inputs that are never flashed to the session on validation exceptions.
|
||||||
|
*
|
||||||
|
* @var array<int, string>
|
||||||
|
*/
|
||||||
|
protected $dontFlash = [
|
||||||
|
'current_password',
|
||||||
|
'password',
|
||||||
|
'password_confirmation',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the exception handling callbacks for the application.
|
||||||
*
|
*
|
||||||
* @param \Exception $exception
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function report(Exception $exception)
|
public function register()
|
||||||
{
|
{
|
||||||
parent::report($exception);
|
$this->reportable(function (Throwable $e) {
|
||||||
}
|
//
|
||||||
|
});
|
||||||
/**
|
|
||||||
* Render an exception into an HTTP response.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @param \Exception $exception
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function render($request, Exception $exception)
|
|
||||||
{
|
|
||||||
return parent::render($request, $exception);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert an authentication exception into an unauthenticated response.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @param \Illuminate\Auth\AuthenticationException $exception
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
protected function unauthenticated($request, AuthenticationException $exception)
|
|
||||||
{
|
|
||||||
if ($request->expectsJson()) {
|
|
||||||
return response()->json(['error' => 'Unauthenticated.'], 401);
|
|
||||||
}
|
|
||||||
|
|
||||||
return redirect()->guest(route('login'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\BiddersResource\Pages;
|
||||||
|
use App\Filament\Resources\BiddersResource\RelationManagers;
|
||||||
|
use App\Models\Bidders;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use UnitEnum;
|
||||||
|
use BackedEnum;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
|
||||||
|
class BiddersResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = Bidders::class;
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'idbidders';
|
||||||
|
|
||||||
|
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static string | UnitEnum | null $navigationGroup = 'Silent Auction';
|
||||||
|
|
||||||
|
public static function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
TextInput::make('bidder_fname')->label('First Name'),
|
||||||
|
TextInput::make('bidder_lname')->label('Last Name'),
|
||||||
|
TextInput::make('bidder_addr')->label('Address'),
|
||||||
|
TextInput::make('bidder_city')->label('City'),
|
||||||
|
TextInput::make('bidder_state')->label('State'),
|
||||||
|
TextInput::make('bidder_zip')->label('Zip'),
|
||||||
|
TextInput::make('bidder_phone')->label('Phone Number')
|
||||||
|
->mask('(999) 999-9999'),
|
||||||
|
TextInput::make('bidder_email')->label('Email'),
|
||||||
|
TextInput::make('bidder_assigned_number')->label('Assigned Number'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
TextColumn::make('bidder_assigned_number')->sortable()->label('Assigned Number')->sortable(),
|
||||||
|
TextColumn::make('bidder_fname')->sortable()->label('First Name')->sortable(),
|
||||||
|
TextColumn::make('bidder_lname')->sortable()->label('Last Name')->sortable(),
|
||||||
|
TextColumn::make('bidder_addr')->label('Address')->sortable(),
|
||||||
|
TextColumn::make('bidder_city')->label('City')->sortable(),
|
||||||
|
TextColumn::make('bidder_state')->label('State')->sortable(),
|
||||||
|
TextColumn::make('bidder_zip')->label('Zip')->sortable(),
|
||||||
|
TextColumn::make('bidder_phone')->label('Phone Number')->sortable()
|
||||||
|
->formatStateUsing(fn ($state) => \App\Helpers\PhoneHelper::format($state)),
|
||||||
|
TextColumn::make('bidder_email')->label('Email')->sortable(),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
->defaultSort('bidder_assigned_number');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
RelationManagers\VehiclesRelationManager::class,
|
||||||
|
RelationManagers\CheckoutRelationManager::class,
|
||||||
|
RelationManagers\WinningBidsRelationManager::class,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListBidders::route('/'),
|
||||||
|
'create' => Pages\CreateBidders::route('/create'),
|
||||||
|
'edit' => Pages\EditBidders::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\BiddersResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\BiddersResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateBidders extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = BiddersResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\BiddersResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\BiddersResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditBidders extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = BiddersResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\BiddersResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\BiddersResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListBidders extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = BiddersResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\BiddersResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
|
||||||
|
class CheckoutRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'checkout';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'bidder_num';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\TextInput::make('bidder_num')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
TextColumn::make('bidders.bidder_assigned_number')
|
||||||
|
->label('Bidder Number')
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('winnertotal')
|
||||||
|
->label('Total Amount')
|
||||||
|
->money('USD')
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('paymentMethod.pm_name')
|
||||||
|
->label('Payment Method')
|
||||||
|
->sortable(),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
CreateAction::make(),
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\BiddersResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use App\Models\CarShowCategory;
|
||||||
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
use Filament\Tables\Columns\IconColumn;
|
||||||
|
class VehiclesRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'vehicles';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'owner';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\TextInput::make('year')
|
||||||
|
->label('Year'),
|
||||||
|
Forms\Components\TextInput::make('make')
|
||||||
|
->label('Make'),
|
||||||
|
Forms\Components\TextInput::make('model')
|
||||||
|
->label('Model'),
|
||||||
|
Forms\Components\Select::make('type')
|
||||||
|
->label('Type')
|
||||||
|
->options(CarShowCategory::vehtype()->pluck('category_name', 'id'))
|
||||||
|
->searchable(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('vehicleOwner.bidder_assigned_number')
|
||||||
|
->label('Number')
|
||||||
|
->sortable(),
|
||||||
|
Tables\Columns\TextColumn::make('year')
|
||||||
|
->label('Year')
|
||||||
|
->sortable(),
|
||||||
|
Tables\Columns\TextColumn::make('make')
|
||||||
|
->label('Make')
|
||||||
|
->sortable(),
|
||||||
|
Tables\Columns\TextColumn::make('model')
|
||||||
|
->label('Model')
|
||||||
|
->sortable(),
|
||||||
|
Tables\Columns\TextColumn::make('vehicleType.category_name')
|
||||||
|
->label('Type')
|
||||||
|
->sortable(),
|
||||||
|
IconColumn::make('doNotJudge')
|
||||||
|
->boolean()
|
||||||
|
->label('Judged?')
|
||||||
|
->sortable()
|
||||||
|
->falseIcon('heroicon-o-check-badge')
|
||||||
|
->trueIcon('heroicon-o-x-circle')
|
||||||
|
->trueColor('danger')
|
||||||
|
->falseColor('success'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
CreateAction::make(),
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
+66
@@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\BiddersResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use App\Models\Bidders;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
|
||||||
|
class WinningBidsRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'winningBids';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'winning_bidder_num';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\Select::make('winning_bidder_num')
|
||||||
|
->label('Winning Bidder Number')
|
||||||
|
->options(Bidders::pluck('bidder_assigned_number', 'idbidders'))
|
||||||
|
->searchable(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('items.item_assigned_num')
|
||||||
|
->label('Item Number')
|
||||||
|
->sortable(),
|
||||||
|
Tables\Columns\TextColumn::make('bidders.winning_bidder_num')
|
||||||
|
->label('Bidder Number')
|
||||||
|
->sortable(),
|
||||||
|
Tables\Columns\TextColumn::make('winning_cost')
|
||||||
|
->label('Winning Bid Amt')
|
||||||
|
->money('USD')
|
||||||
|
->sortable(),
|
||||||
|
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
CreateAction::make(),
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CarShowCategoryResource\Pages;
|
||||||
|
use App\Filament\Resources\CarShowCategoryResource\RelationManagers;
|
||||||
|
use App\Filament\Resources\CarShowCategoryResource\RelationManagers\VehicleRelationManager;
|
||||||
|
use App\Models\CarShowCategory;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Tables\Columns\IconColumn;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use UnitEnum;
|
||||||
|
use BackedEnum;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
|
||||||
|
class CarShowCategoryResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = CarShowCategory::class;
|
||||||
|
|
||||||
|
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static string | UnitEnum | null $navigationGroup = 'Car Show';
|
||||||
|
|
||||||
|
|
||||||
|
public static function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
TextInput::make('category_name'),
|
||||||
|
Toggle::make('vehicle_type')->inline(false)
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
TextColumn::make('category_name')->sortable(),
|
||||||
|
IconColumn::make('vehicle_type')->boolean()->sortable(),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
->defaultSort('category_name');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
RelationManagers\VehicleRelationManager::class,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListCarShowCategories::route('/'),
|
||||||
|
'create' => Pages\CreateCarShowCategory::route('/create'),
|
||||||
|
'edit' => Pages\EditCarShowCategory::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CarShowCategoryResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CarShowCategoryResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateCarShowCategory extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = CarShowCategoryResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CarShowCategoryResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CarShowCategoryResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditCarShowCategory extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = CarShowCategoryResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CarShowCategoryResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CarShowCategoryResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListCarShowCategories extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = CarShowCategoryResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+63
@@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CarShowCategoryResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
use Filament\Actions\DissociateAction;
|
||||||
|
use Filament\Actions\AssociateAction;
|
||||||
|
class VehicleRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'vehicle';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'id';
|
||||||
|
|
||||||
|
protected static ?string $inverseRelationship = 'vehicleType';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\TextInput::make('id')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('id'),
|
||||||
|
Tables\Columns\TextColumn::make('owner'),
|
||||||
|
Tables\Columns\TextColumn::make('year'),
|
||||||
|
Tables\Columns\TextColumn::make('make'),
|
||||||
|
Tables\Columns\TextColumn::make('model'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
DeleteAction::make(),
|
||||||
|
DissociateAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
CreateAction::make(),
|
||||||
|
AssociateAction::make(),
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CarShowWinnerResource\Pages;
|
||||||
|
use App\Filament\Resources\CarShowWinnerResource\RelationManagers;
|
||||||
|
use App\Models\CarShowWinner;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use App\Models\Vehicles;
|
||||||
|
use App\Models\CarShowCategory;
|
||||||
|
use UnitEnum;
|
||||||
|
use BackedEnum;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
|
||||||
|
class CarShowWinnerResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = CarShowWinner::class;
|
||||||
|
|
||||||
|
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static string | UnitEnum | null $navigationGroup = 'Car Show';
|
||||||
|
|
||||||
|
public static function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Select::make('vehicle')
|
||||||
|
->label('Vehicle')
|
||||||
|
->options(Vehicles::all()->pluck('owner', 'id'))
|
||||||
|
->searchable(),
|
||||||
|
Select::make('category')
|
||||||
|
->label('Category')
|
||||||
|
->options(CarShowCategory::all()->pluck('category_name', 'id'))
|
||||||
|
->searchable(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
TextColumn::make('awardCategory.category_name')->label('Category')->sortable(),
|
||||||
|
TextColumn::make('awardVehicle.owner')->label('Vehicle Number')->sortable(),
|
||||||
|
TextColumn::make('total_score')->label('Total Score')->sortable(),
|
||||||
|
TextColumn::make('awardVehicle.year')->label('Year')->sortable(),
|
||||||
|
TextColumn::make('awardVehicle.make')->label('Make')->sortable(),
|
||||||
|
TextColumn::make('awardVehicle.model')->label('Model')->sortable(),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
RelationManagers\AwardVehicleRelationManager::class,
|
||||||
|
RelationManagers\AwardCategoryRelationManager::class,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListCarShowWinners::route('/'),
|
||||||
|
'create' => Pages\CreateCarShowWinner::route('/create'),
|
||||||
|
'edit' => Pages\EditCarShowWinner::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CarShowWinnerResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CarShowWinnerResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateCarShowWinner extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = CarShowWinnerResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CarShowWinnerResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CarShowWinnerResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditCarShowWinner extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = CarShowWinnerResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CarShowWinnerResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CarShowWinnerResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListCarShowWinners extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = CarShowWinnerResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CarShowWinnerResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
class AwardCategoryRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'awardCategory';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'id';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\TextInput::make('id')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('id'),
|
||||||
|
Tables\Columns\TextColumn::make('category_name'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
CreateAction::make(),
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
+56
@@ -0,0 +1,56 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CarShowWinnerResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
class AwardVehicleRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'awardVehicle';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'id';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\TextInput::make('id')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('owner'),
|
||||||
|
Tables\Columns\TextColumn::make('year'),
|
||||||
|
Tables\Columns\TextColumn::make('make'),
|
||||||
|
Tables\Columns\TextColumn::make('model'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
CreateAction::make(),
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CheckoutResource\Pages;
|
||||||
|
use App\Filament\Resources\CheckoutResource\RelationManagers;
|
||||||
|
use App\Models\Checkout;
|
||||||
|
use UnitEnum;
|
||||||
|
use BackedEnum;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use App\Models\Bidders;
|
||||||
|
use App\Models\PaymentMethods;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
|
||||||
|
class CheckoutResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = Checkout::class;
|
||||||
|
|
||||||
|
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static string | UnitEnum | null $navigationGroup = 'Silent Auction';
|
||||||
|
|
||||||
|
public static function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Select::make('bidder_num')
|
||||||
|
->label('Bidder')
|
||||||
|
->options(
|
||||||
|
Bidders::orderBy('bidder_assigned_number')
|
||||||
|
->pluck('bidder_assigned_number', 'idbidders')
|
||||||
|
)
|
||||||
|
->searchable(),
|
||||||
|
TextInput::make('winnertotal')
|
||||||
|
->label('Total Amount'),
|
||||||
|
Select::make('payment_method')
|
||||||
|
->label('Payment Method')
|
||||||
|
->options(PaymentMethods::all()->pluck('pm_name', 'pm_id'))
|
||||||
|
->searchable(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
TextColumn::make('bidders.bidder_assigned_number')
|
||||||
|
->label('Bidder Number')
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('winnertotal')
|
||||||
|
->label('Total Amount')
|
||||||
|
->money('USD')
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('paymentMethod.pm_name')
|
||||||
|
->label('Payment Method')
|
||||||
|
->sortable(),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
->defaultSort('bidders.bidder_assigned_number');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListCheckouts::route('/'),
|
||||||
|
'create' => Pages\CreateCheckout::route('/create'),
|
||||||
|
'edit' => Pages\EditCheckout::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CheckoutResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CheckoutResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateCheckout extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = CheckoutResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CheckoutResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CheckoutResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditCheckout extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = CheckoutResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CheckoutResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\CheckoutResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListCheckouts extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = CheckoutResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CheckoutResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class BiddersRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'bidders';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'bidder_num';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\Select::make('bidder_num')
|
||||||
|
->label('Number')
|
||||||
|
->required()
|
||||||
|
->createOptionForm([
|
||||||
|
Forms\Components\TextInput::make('bidder_fname')->label('First Name'),
|
||||||
|
Forms\Components\TextInput::make('bidder_lname')->label('Last Name'),
|
||||||
|
Forms\Components\TextInput::make('bidder_addr')->label('Address'),
|
||||||
|
Forms\Components\TextInput::make('bidder_city')->label('City'),
|
||||||
|
Forms\Components\TextInput::make('bidder_state')->label('State'),
|
||||||
|
Forms\Components\TextInput::make('bidder_zip')->label('Zip'),
|
||||||
|
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 function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('bidder_fname')->label('First Name'),
|
||||||
|
Tables\Columns\TextColumn::make('bidder_lname')->label('Last Name'),
|
||||||
|
Tables\Columns\TextColumn::make('bidder_assigned_number')->label('Number'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
Tables\Actions\CreateAction::make(),
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
Tables\Actions\DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
+51
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CheckoutResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class PaymentMethodRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'paymentMethod';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'payment_method';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\TextInput::make('payment_method')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('payment_method'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
Tables\Actions\CreateAction::make(),
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
Tables\Actions\DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\ItemsResource\Pages;
|
||||||
|
use App\Filament\Resources\ItemsResource\RelationManagers;
|
||||||
|
use App\Models\Items;
|
||||||
|
use UnitEnum;
|
||||||
|
use BackedEnum;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
|
||||||
|
class ItemsResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = Items::class;
|
||||||
|
|
||||||
|
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static string | UnitEnum | null $navigationGroup = 'Silent Auction';
|
||||||
|
|
||||||
|
public static function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
TextInput::make('item_assigned_num')
|
||||||
|
->label('Item Number'),
|
||||||
|
TextInput::make('item_desc')
|
||||||
|
->label('Description'),
|
||||||
|
TextInput::make('item_min_bid')
|
||||||
|
->label('Minimum Bid'),
|
||||||
|
TextInput::make('item_est_value')
|
||||||
|
->label('Estimated Value'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
TextColumn::make('item_assigned_num')
|
||||||
|
->label('Item Number')
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('item_desc')
|
||||||
|
->label('Description'),
|
||||||
|
TextColumn::make('item_min_bid')
|
||||||
|
->label('Minimum Bid')
|
||||||
|
->money('USD')
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('item_est_value')
|
||||||
|
->label('Estimated Value')
|
||||||
|
->money('USD')
|
||||||
|
->sortable(),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
->defaultSort('item_assigned_num');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListItems::route('/'),
|
||||||
|
'create' => Pages\CreateItems::route('/create'),
|
||||||
|
'edit' => Pages\EditItems::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\ItemsResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\ItemsResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateItems extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = ItemsResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\ItemsResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\ItemsResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditItems extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = ItemsResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\ItemsResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\ItemsResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListItems extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = ItemsResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\ItemsResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class WinningBidsRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'winningBids';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'iditems';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\TextInput::make('iditems')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('iditems'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
Tables\Actions\CreateAction::make(),
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
Tables\Actions\DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\JudgesResource\Pages;
|
||||||
|
use App\Filament\Resources\JudgesResource\RelationManagers;
|
||||||
|
use App\Models\Judges;
|
||||||
|
use UnitEnum;
|
||||||
|
use BackedEnum;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
|
||||||
|
class JudgesResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = Judges::class;
|
||||||
|
|
||||||
|
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static string | UnitEnum | null $navigationGroup = 'Car Show';
|
||||||
|
|
||||||
|
public static function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
TextInput::make('judge_number'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
TextColumn::make('judge_number')->sortable(),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListJudges::route('/'),
|
||||||
|
'create' => Pages\CreateJudges::route('/create'),
|
||||||
|
'edit' => Pages\EditJudges::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\JudgesResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\JudgesResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateJudges extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = JudgesResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\JudgesResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\JudgesResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditJudges extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = JudgesResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\JudgesResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\JudgesResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListJudges extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = JudgesResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+51
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\JudgesResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class VehicleScoresRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'vehicleScores';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'judge';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\TextInput::make('judge')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('judge'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
Tables\Actions\CreateAction::make(),
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
Tables\Actions\DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\PaymentMethodsResource\Pages;
|
||||||
|
use App\Filament\Resources\PaymentMethodsResource\RelationManagers;
|
||||||
|
use App\Models\PaymentMethods;
|
||||||
|
use UnitEnum;
|
||||||
|
use BackedEnum;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
|
||||||
|
class PaymentMethodsResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = PaymentMethods::class;
|
||||||
|
|
||||||
|
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static string | UnitEnum | null $navigationGroup = 'Silent Auction';
|
||||||
|
|
||||||
|
public static function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
TextInput::make('pm_name')
|
||||||
|
->label('Method Name'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
TextColumn::make('pm_name')
|
||||||
|
->label('Method Name')
|
||||||
|
->sortable(),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListPaymentMethods::route('/'),
|
||||||
|
'create' => Pages\CreatePaymentMethods::route('/create'),
|
||||||
|
'edit' => Pages\EditPaymentMethods::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\PaymentMethodsResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\PaymentMethodsResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreatePaymentMethods extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = PaymentMethodsResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\PaymentMethodsResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\PaymentMethodsResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditPaymentMethods extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = PaymentMethodsResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\PaymentMethodsResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\PaymentMethodsResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListPaymentMethods extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = PaymentMethodsResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+51
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\PaymentMethodsResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class CheckoutRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'checkout';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'payment_method';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\TextInput::make('payment_method')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('payment_method'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
Tables\Actions\CreateAction::make(),
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
Tables\Actions\DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\PeoplesChoiceResource\Pages;
|
||||||
|
use App\Filament\Resources\PeoplesChoiceResource\RelationManagers;
|
||||||
|
use App\Models\PeoplesChoice;
|
||||||
|
use UnitEnum;
|
||||||
|
use BackedEnum;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use App\Models\Vehicles;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
|
||||||
|
class PeoplesChoiceResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = PeoplesChoice::class;
|
||||||
|
|
||||||
|
protected static ?string $pluralModelLabel = 'Peoples Choice';
|
||||||
|
|
||||||
|
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static string | UnitEnum | null $navigationGroup = 'Car Show';
|
||||||
|
|
||||||
|
public static function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Select::make('vehicle')
|
||||||
|
->label('Vehicle')
|
||||||
|
->options(Vehicles::all()->pluck('owner', 'id'))
|
||||||
|
->searchable(),
|
||||||
|
TextInput::make('pc_count'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
TextColumn::make('pc_count')->label('PC Vote Count')->sortable(),
|
||||||
|
TextColumn::make('vehicles.owner')->label('Vehicle Number')->sortable(),
|
||||||
|
TextColumn::make('vehicles.year')->label('Year')->sortable(),
|
||||||
|
TextColumn::make('vehicles.make')->label('Make')->sortable(),
|
||||||
|
TextColumn::make('vehicles.model')->label('Model')->sortable(),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListPeoplesChoices::route('/'),
|
||||||
|
'create' => Pages\CreatePeoplesChoice::route('/create'),
|
||||||
|
'edit' => Pages\EditPeoplesChoice::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\PeoplesChoiceResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\PeoplesChoiceResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreatePeoplesChoice extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = PeoplesChoiceResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\PeoplesChoiceResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\PeoplesChoiceResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditPeoplesChoice extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = PeoplesChoiceResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\PeoplesChoiceResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\PeoplesChoiceResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListPeoplesChoices extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = PeoplesChoiceResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+51
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\PeoplesChoiceResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class VehiclesRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'vehicles';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'vehicle';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\TextInput::make('vehicle')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('vehicle'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
Tables\Actions\CreateAction::make(),
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
Tables\Actions\DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\VehicleScoresResource\Pages;
|
||||||
|
use App\Filament\Resources\VehicleScoresResource\RelationManagers;
|
||||||
|
use App\Models\VehicleScores;
|
||||||
|
use UnitEnum;
|
||||||
|
use BackedEnum;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use App\Models\Vehicles;
|
||||||
|
use App\Models\Judges;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
|
||||||
|
class VehicleScoresResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = VehicleScores::class;
|
||||||
|
|
||||||
|
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static string | UnitEnum | null $navigationGroup = 'Car Show';
|
||||||
|
|
||||||
|
public static function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Select::make('judge')
|
||||||
|
->label('Judge')
|
||||||
|
->options(Judges::all()->pluck('judge_number', 'id'))
|
||||||
|
->searchable(),
|
||||||
|
Select::make('vehicle')
|
||||||
|
->label('Vehicle')
|
||||||
|
->options(Vehicles::all()->pluck('owner', 'id'))
|
||||||
|
->searchable(),
|
||||||
|
TextInput::make('overall_score')
|
||||||
|
->label('Overall Score'),
|
||||||
|
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
TextColumn::make('judges.judge_number')->label('Judge')->sortable(),
|
||||||
|
TextColumn::make('scoredVehicle.owner')->label('Vehicle Number')->sortable(),
|
||||||
|
TextColumn::make('overall_score')->label('Score')->sortable(),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
RelationManagers\JudgeRelationManager::class,
|
||||||
|
RelationManagers\ScoredVehicleRelationManager::class,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListVehicleScores::route('/'),
|
||||||
|
'create' => Pages\CreateVehicleScores::route('/create'),
|
||||||
|
'edit' => Pages\EditVehicleScores::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\VehicleScoresResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\VehicleScoresResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateVehicleScores extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = VehicleScoresResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\VehicleScoresResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\VehicleScoresResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditVehicleScores extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = VehicleScoresResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\VehicleScoresResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\VehicleScoresResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListVehicleScores extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = VehicleScoresResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+55
@@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\VehicleScoresResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
class JudgeRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'judges';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'judge_number';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\TextInput::make('judge_number')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('judge_number'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
CreateAction::make(),
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
+56
@@ -0,0 +1,56 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\VehicleScoresResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
class ScoredVehicleRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'scoredVehicle';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'id';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\TextInput::make('owner')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('owner'),
|
||||||
|
Tables\Columns\TextColumn::make('year')->label('Year'),
|
||||||
|
Tables\Columns\TextColumn::make('make')->label('Make'),
|
||||||
|
Tables\Columns\TextColumn::make('model')->label('Model'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
CreateAction::make(),
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\VehiclesResource\Pages;
|
||||||
|
use App\Filament\Resources\VehiclesResource\RelationManagers;
|
||||||
|
use App\Models\Vehicles;
|
||||||
|
use UnitEnum;
|
||||||
|
use BackedEnum;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Tables\Columns\IconColumn;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use App\Models\Bidders;
|
||||||
|
use App\Models\CarShowCategory;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
|
||||||
|
class VehiclesResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = Vehicles::class;
|
||||||
|
|
||||||
|
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static string | UnitEnum | null $navigationGroup = 'Car Show';
|
||||||
|
|
||||||
|
public static function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Select::make('owner')
|
||||||
|
->label('Owner')
|
||||||
|
->options(Bidders::orderBy('bidder_assigned_number')->pluck('bidder_assigned_number', 'idbidders'))
|
||||||
|
->searchable(),
|
||||||
|
TextInput::make('year')
|
||||||
|
->label('Year'),
|
||||||
|
TextInput::make('make')
|
||||||
|
->label('Make'),
|
||||||
|
TextInput::make('model')
|
||||||
|
->label('Model'),
|
||||||
|
Select::make('type')
|
||||||
|
->label('Type')
|
||||||
|
->options(CarShowCategory::vehtype()->pluck('category_name', 'id'))
|
||||||
|
->searchable(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
TextColumn::make('vehicleOwner.bidder_assigned_number')
|
||||||
|
->label('Number')
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('year')
|
||||||
|
->label('Year')
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('make')
|
||||||
|
->label('Make')
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('model')
|
||||||
|
->label('Model')
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('vehicleType.category_name')
|
||||||
|
->label('Type')
|
||||||
|
->sortable(),
|
||||||
|
IconColumn::make('doNotJudge')
|
||||||
|
->label('Judged?')
|
||||||
|
->sortable()
|
||||||
|
->boolean()
|
||||||
|
->falseIcon('heroicon-o-check-badge')
|
||||||
|
->trueIcon('heroicon-o-x-circle')
|
||||||
|
->trueColor('danger')
|
||||||
|
->falseColor('success'),
|
||||||
|
TextColumn::make('vehicleOwner.bidder_fname')
|
||||||
|
->label('First Name')
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('vehicleOwner.bidder_lname')
|
||||||
|
->label('Last Name')
|
||||||
|
->sortable(),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
->defaultSort('vehicleOwner.bidder_assigned_number');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
RelationManagers\VehicleOwnerRelationManager::class,
|
||||||
|
RelationManagers\VehicleScoresRelationManager::class,
|
||||||
|
RelationManagers\VehicleTypeRelationManager::class,
|
||||||
|
RelationManagers\CarShowWinnerRelationManager::class,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListVehicles::route('/'),
|
||||||
|
'create' => Pages\CreateVehicles::route('/create'),
|
||||||
|
'edit' => Pages\EditVehicles::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\VehiclesResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\VehiclesResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateVehicles extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = VehiclesResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\VehiclesResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\VehiclesResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditVehicles extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = VehiclesResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\VehiclesResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\VehiclesResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListVehicles extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = VehiclesResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
+53
@@ -0,0 +1,53 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
class CarShowWinnerRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'CarShowWinner';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'id';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\TextInput::make('id')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('id'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
CreateAction::make(),
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
+72
@@ -0,0 +1,72 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use App\Models\Bidders;
|
||||||
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
class VehicleOwnerRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'vehicleOwner';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'owner';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\Select::make('owner')
|
||||||
|
->label('Owner Assigned Number')
|
||||||
|
->required()
|
||||||
|
->searchable()
|
||||||
|
->options(
|
||||||
|
Bidders::orderBy('bidder_assigned_number')
|
||||||
|
->pluck('bidder_assigned_number', 'idbidders'
|
||||||
|
))
|
||||||
|
->createOptionForm([
|
||||||
|
Forms\Components\TextInput::make('bidder_fname')->label('First Name'),
|
||||||
|
Forms\Components\TextInput::make('bidder_lname')->label('Last Name'),
|
||||||
|
Forms\Components\TextInput::make('bidder_addr')->label('Address'),
|
||||||
|
Forms\Components\TextInput::make('bidder_city')->label('City'),
|
||||||
|
Forms\Components\TextInput::make('bidder_state')->label('State'),
|
||||||
|
Forms\Components\TextInput::make('bidder_zip')->label('Zip'),
|
||||||
|
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 function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('bidder_fname')->label('First Name'),
|
||||||
|
Tables\Columns\TextColumn::make('bidder_lname')->label('Last Name'),
|
||||||
|
Tables\Columns\TextColumn::make('bidder_assigned_number')->label('Number'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
CreateAction::make(),
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
+63
@@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use App\Models\Vehicles;
|
||||||
|
use App\Models\Judges;
|
||||||
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
class VehicleScoresRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'vehicleScores';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'id';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\Select::make('judge')
|
||||||
|
->label('Judge')
|
||||||
|
->options(Judges::all()->pluck('judge_number', 'id'))
|
||||||
|
->searchable(),
|
||||||
|
Forms\Components\Select::make('vehicle')
|
||||||
|
->label('Vehicle')
|
||||||
|
->options(Vehicles::all()->pluck('owner', 'id'))
|
||||||
|
->searchable(),
|
||||||
|
Forms\Components\TextInput::make('overall_score')
|
||||||
|
->label('Overall Score'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('judge'),
|
||||||
|
Tables\Columns\TextColumn::make('overall_score'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
CreateAction::make(),
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
+59
@@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use App\Models\CarShowCategory;
|
||||||
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
class VehicleTypeRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'vehicleType';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'id';
|
||||||
|
|
||||||
|
public function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Forms\Components\Select::make('category_name')
|
||||||
|
->required()
|
||||||
|
->searchable()
|
||||||
|
->options(CarShowCategory::vehtype()->pluck('category_name', 'id'))
|
||||||
|
->createOptionForm([
|
||||||
|
Forms\Components\TextInput::make('category_name'),
|
||||||
|
Forms\Components\Toggle::make('vehicle_type')->inline(false),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('category_name'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
CreateAction::make(),
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\WinningBidsResource\Pages;
|
||||||
|
use App\Filament\Resources\WinningBidsResource\RelationManagers;
|
||||||
|
use App\Models\WinningBids;
|
||||||
|
use UnitEnum;
|
||||||
|
use BackedEnum;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Filament\Tables\Columns\IconColumn;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use App\Models\Bidders;
|
||||||
|
use App\Models\Items;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
|
||||||
|
class WinningBidsResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = WinningBids::class;
|
||||||
|
|
||||||
|
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static string | UnitEnum | null $navigationGroup = 'Silent Auction';
|
||||||
|
|
||||||
|
public static function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
Select::make('winning_item_num')
|
||||||
|
->label('Item')
|
||||||
|
->options(Items::orderBy('item_assigned_num')->pluck('item_assigned_num', 'iditems'))
|
||||||
|
->searchable(),
|
||||||
|
Select::make('winning_bidder_num')
|
||||||
|
->label('Bidder')
|
||||||
|
->options(
|
||||||
|
Bidders::orderBy('bidder_assigned_number')
|
||||||
|
->pluck('bidder_assigned_number', 'idbidders')
|
||||||
|
)
|
||||||
|
->searchable(),
|
||||||
|
TextInput::make('winning_cost')
|
||||||
|
->label('Winning Bid')
|
||||||
|
->prefix('$')
|
||||||
|
->numeric(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
TextColumn::make('items.item_assigned_num')
|
||||||
|
->label('Item')
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('items.item_desc')
|
||||||
|
->label('Item Description')
|
||||||
|
->limit(15),
|
||||||
|
TextColumn::make('bidders.bidder_assigned_number')
|
||||||
|
->label('Bidder Number')
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('winning_cost')
|
||||||
|
->label('Winning Bid Amt')
|
||||||
|
->money('USD')
|
||||||
|
->sortable(),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
->defaultSort('items.item_assigned_num');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListWinningBids::route('/'),
|
||||||
|
'create' => Pages\CreateWinningBids::route('/create'),
|
||||||
|
'edit' => Pages\EditWinningBids::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\WinningBidsResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\WinningBidsResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateWinningBids extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = WinningBidsResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\WinningBidsResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\WinningBidsResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditWinningBids extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = WinningBidsResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\WinningBidsResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\WinningBidsResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListWinningBids extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = WinningBidsResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Helpers;
|
||||||
|
|
||||||
|
class PhoneHelper
|
||||||
|
{
|
||||||
|
public static function format($phone)
|
||||||
|
{
|
||||||
|
$phone = preg_replace('/[^0-9]/', '', $phone);
|
||||||
|
if (strlen($phone) == 10) {
|
||||||
|
return preg_replace('/([0-9]{3})([0-9]{3})([0-9]{4})/', '$1-$2-$3', $phone);
|
||||||
|
}
|
||||||
|
return $phone;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -490,6 +490,21 @@ class PagesController extends Controller
|
|||||||
->get();
|
->get();
|
||||||
return view('carshowscores', ['carshowscore_results' => $carshowscore_results]);
|
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()
|
public function showcarlist()
|
||||||
{
|
{
|
||||||
$showcarlist_results = Bidders::has('vehicles')
|
$showcarlist_results = Bidders::has('vehicles')
|
||||||
@@ -500,4 +515,30 @@ class PagesController extends Controller
|
|||||||
//dd($showcarlist_results);
|
//dd($showcarlist_results);
|
||||||
return view('showcarlist', ['showcarlist_results' => $showcarlist_results]);
|
return view('showcarlist', ['showcarlist_results' => $showcarlist_results]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function myWinnings(Request $request)
|
||||||
|
{
|
||||||
|
if (!$request->bidder_number) {
|
||||||
|
return view('mywinnings_form');
|
||||||
|
}
|
||||||
|
|
||||||
|
$bidder_number = $request->bidder_number;
|
||||||
|
$bidder = Bidders::where('bidder_assigned_number', $bidder_number)->first();
|
||||||
|
|
||||||
|
if (!$bidder) {
|
||||||
|
return view('mywinnings_form', ['error' => 'Bidder number not found.']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$winnings = WinningBids::with('items')
|
||||||
|
->where('winning_bidder_num', $bidder->idbidders)
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$total_cost = $winnings->sum('winning_cost');
|
||||||
|
|
||||||
|
return view('mywinnings_results', [
|
||||||
|
'bidder' => $bidder,
|
||||||
|
'winnings' => $winnings,
|
||||||
|
'total_cost' => $total_cost
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-4
@@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
class Bidders extends Model
|
class Bidders extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'bidders';
|
protected $table = 'bidders';
|
||||||
|
|
||||||
|
protected $primaryKey = 'idbidders';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'bidder_fname',
|
'bidder_fname',
|
||||||
'bidder_lname',
|
'bidder_lname',
|
||||||
@@ -21,10 +24,13 @@ class Bidders extends Model
|
|||||||
'updated_at'
|
'updated_at'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $dates = [
|
protected function casts(): array
|
||||||
'created_at',
|
{
|
||||||
'updated_at'
|
return [
|
||||||
|
'created_at' => 'datetime',
|
||||||
|
'updated_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function checkout()
|
public function checkout()
|
||||||
{
|
{
|
||||||
@@ -38,6 +44,6 @@ class Bidders extends Model
|
|||||||
|
|
||||||
public function vehicles()
|
public function vehicles()
|
||||||
{
|
{
|
||||||
return $this->hasMany('App\Models\Vehicles', 'owner', 'bidder_assigned_number');
|
return $this->hasMany(Vehicles::class, 'owner', 'bidder_assigned_number');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,22 +7,33 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
class CarShowCategory extends Model
|
class CarShowCategory extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'car_show_categories';
|
protected $table = 'car_show_categories';
|
||||||
|
protected static ?string $recordTitleAttribute = 'category_name';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'category_name',
|
'category_name',
|
||||||
'vehicle_type'
|
'vehicle_type'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $dates = [
|
protected function casts(): array
|
||||||
'created_at',
|
{
|
||||||
'updated_at'
|
return [
|
||||||
|
'vehicle_type' => 'boolean',
|
||||||
|
'created_at' => 'datetime',
|
||||||
|
'updated_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function vehicle()
|
public function vehicle()
|
||||||
{
|
{
|
||||||
return $this->hasMany('App\Models\Vehicles', 'id', 'type');
|
return $this->hasMany(Vehicles::class, 'type');
|
||||||
}
|
}
|
||||||
public function showWinner()
|
public function showWinner()
|
||||||
{
|
{
|
||||||
return $this->hasMany('App\Models\CarShowWinner', 'id', 'category');
|
return $this->hasMany(CarShowWinner::class, 'category');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function scopeVehtype($query)
|
||||||
|
{
|
||||||
|
return $query->where('vehicle_type', 1)->orderBy('category_name');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,13 +10,17 @@ class CarShowWinner extends Model
|
|||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'vehicle',
|
'vehicle',
|
||||||
'category',
|
'category',
|
||||||
'place'
|
'place',
|
||||||
|
'total_score'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $dates = [
|
protected function casts(): array
|
||||||
'created_at',
|
{
|
||||||
'updated_at'
|
return [
|
||||||
|
'created_at' => 'datetime',
|
||||||
|
'updated_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function awardVehicle()
|
public function awardVehicle()
|
||||||
{
|
{
|
||||||
|
|||||||
+12
-5
@@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
class Checkout extends Model
|
class Checkout extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'checkout';
|
protected $table = 'checkout';
|
||||||
|
|
||||||
|
protected $primaryKey = 'checkout_id';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'bidder_num',
|
'bidder_num',
|
||||||
'winnertotal',
|
'winnertotal',
|
||||||
@@ -18,18 +21,22 @@ class Checkout extends Model
|
|||||||
'updated_at'
|
'updated_at'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $dates = [
|
protected function casts(): array
|
||||||
'created_at',
|
{
|
||||||
'updated_at'
|
return [
|
||||||
|
'created_at' => 'datetime',
|
||||||
|
'updated_at' => 'datetime',
|
||||||
|
'winnertotal' => 'integer',
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function bidders()
|
public function bidders()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('App\Models\Bidders', 'bidder_num', 'idbidders');
|
return $this->belongsTo(Bidders::class, 'bidder_num', 'idbidders');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function paymentMethod()
|
public function paymentMethod()
|
||||||
{
|
{
|
||||||
return $this->hasMany('App\Models\PaymentMethods', 'payment_method', 'pm_id');
|
return $this->hasMany(PaymentMethods::class, 'pm_id', 'payment_method');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-4
@@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
class Items extends Model
|
class Items extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'items';
|
protected $table = 'items';
|
||||||
|
|
||||||
|
protected $primaryKey = 'iditems';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'item_desc',
|
'item_desc',
|
||||||
'item_min_bid',
|
'item_min_bid',
|
||||||
@@ -16,13 +19,16 @@ class Items extends Model
|
|||||||
'updated_at'
|
'updated_at'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $dates = [
|
protected function casts(): array
|
||||||
'created_at',
|
{
|
||||||
'updated_at'
|
return [
|
||||||
|
'created_at' => 'datetime',
|
||||||
|
'updated_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function winningBids()
|
public function winningBids()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('App\Models\WinningBids', 'iditems', 'winning_item_num');
|
return $this->belongsTo(WinningBids::class, 'iditems', 'winning_item_num');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,13 +13,16 @@ class Judges extends Model
|
|||||||
'updated_at'
|
'updated_at'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $dates = [
|
protected function casts(): array
|
||||||
'created_at',
|
{
|
||||||
'updated_at'
|
return [
|
||||||
|
'created_at' => 'datetime',
|
||||||
|
'updated_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function vehicleScores()
|
public function vehicleScores()
|
||||||
{
|
{
|
||||||
return $this->hasMany('App\Models\VehicleScores', 'judge', 'id');
|
return $this->hasMany(VehicleScores::class, 'judge', 'id');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,19 +7,25 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
class PaymentMethods extends Model
|
class PaymentMethods extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'payment_methods';
|
protected $table = 'payment_methods';
|
||||||
|
|
||||||
|
protected $primaryKey = 'pm_id';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'pm_name',
|
'pm_name',
|
||||||
'created_at',
|
'created_at',
|
||||||
'updated_at'
|
'updated_at'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $dates = [
|
protected function casts(): array
|
||||||
'created_at',
|
{
|
||||||
'updated_at'
|
return [
|
||||||
|
'created_at' => 'datetime',
|
||||||
|
'updated_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function checkout()
|
public function checkout()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('App\Models\Checkout', 'payment_method', 'pm_id');
|
return $this->belongsTo(Checkout::class, 'payment_method', 'pm_id');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,13 +14,16 @@ class PeoplesChoice extends Model
|
|||||||
'updated_at'
|
'updated_at'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $dates = [
|
protected function casts(): array
|
||||||
'created_at',
|
{
|
||||||
'updated_at'
|
return [
|
||||||
|
'created_at' => 'datetime',
|
||||||
|
'updated_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function vehicles()
|
public function vehicles()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('App\Models\Vehicles', 'vehicle', 'id');
|
return $this->belongsTo(Vehicles::class, 'vehicle', 'id');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,12 +15,15 @@ class VehicleScores extends Model
|
|||||||
'updated_at'
|
'updated_at'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $dates = [
|
protected function casts(): array
|
||||||
'created_at',
|
{
|
||||||
'updated_at'
|
return [
|
||||||
|
'created_at' => 'datetime',
|
||||||
|
'updated_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function judge()
|
public function judges()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('App\Models\Judges', 'judge', 'id');
|
return $this->belongsTo('App\Models\Judges', 'judge', 'id');
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-8
@@ -4,9 +4,10 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class vehicles extends Model
|
class Vehicles extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'vehicles';
|
protected $table = 'vehicles';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'year',
|
'year',
|
||||||
'make',
|
'make',
|
||||||
@@ -16,28 +17,32 @@ class vehicles extends Model
|
|||||||
'owner'
|
'owner'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $dates = [
|
protected function casts(): array
|
||||||
'created_at',
|
{
|
||||||
'updated_at'
|
return [
|
||||||
|
'owner' => 'integer',
|
||||||
|
'created_at' => 'datetime',
|
||||||
|
'updated_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function vehicleType()
|
public function vehicleType()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('App\Models\CarShowCategory', 'type', 'id');
|
return $this->belongsTo(CarShowCategory::class, 'type', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function vehicleOwner()
|
public function vehicleOwner()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('App\Models\Bidders', 'owner', 'bidder_assigned_number');
|
return $this->belongsTo(Bidders::class, 'owner', 'bidder_assigned_number');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function vehicleScores()
|
public function vehicleScores()
|
||||||
{
|
{
|
||||||
return $this->hasMany('App\Models\VechicleScores', 'id', 'vehicle');
|
return $this->hasMany(VehicleScores::class, 'vehicle');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function CarShowWinner()
|
public function CarShowWinner()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('App\Models\CarShowWinner', 'id', 'vehicle');
|
return $this->belongsTo(CarShowWinner::class, 'vehicle');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
class WinningBids extends Model
|
class WinningBids extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'winning_bids';
|
protected $table = 'winning_bids';
|
||||||
|
|
||||||
|
protected $primaryKey = 'idwinning_bids';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'winning_bidder_num',
|
'winning_bidder_num',
|
||||||
'winning_cost',
|
'winning_cost',
|
||||||
@@ -15,18 +18,21 @@ class WinningBids extends Model
|
|||||||
'updated_at'
|
'updated_at'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $dates = [
|
protected function casts(): array
|
||||||
'created_at',
|
{
|
||||||
'updated_at'
|
return [
|
||||||
|
'created_at' => 'datetime',
|
||||||
|
'updated_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function items()
|
public function items()
|
||||||
{
|
{
|
||||||
return $this->hasMany('App\Models\Items', 'iditems', 'winning_item_num');
|
return $this->belongsTo(Items::class, 'winning_item_num', 'iditems');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function bidders()
|
public function bidders()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('App\Models\Bidders', 'winning_bidder_num', 'idbidders');
|
return $this->belongsTo(Bidders::class, 'winning_bidder_num', 'idbidders');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
+27
-1
@@ -4,8 +4,11 @@ namespace App;
|
|||||||
|
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
|
use Filament\Models\Contracts\FilamentUser;
|
||||||
|
use Filament\Models\Contracts\HasName;
|
||||||
|
use Filament\Panel;
|
||||||
|
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable implements FilamentUser, HasName
|
||||||
{
|
{
|
||||||
use Notifiable;
|
use Notifiable;
|
||||||
|
|
||||||
@@ -26,4 +29,27 @@ class User extends Authenticatable
|
|||||||
protected $hidden = [
|
protected $hidden = [
|
||||||
'password', 'remember_token',
|
'password', 'remember_token',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-18
@@ -5,18 +5,21 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.0.0",
|
"php": "^8.2",
|
||||||
"barryvdh/laravel-snappy": "^0.4.1",
|
"barryvdh/laravel-snappy": "^1.0",
|
||||||
"laravel/framework": "5.6.*",
|
"carlos-meneses/laravel-mpdf": "^2.1",
|
||||||
"laravel/tinker": "~1.0",
|
"filament/filament": "^5.0",
|
||||||
"niklasravnsborg/laravel-pdf": "^2.0"
|
"laravel/framework": "^11.0",
|
||||||
|
"laravel/tinker": "^2.9",
|
||||||
|
"laravel/ui": "^4.2"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"barryvdh/laravel-debugbar": "^3.2",
|
"barryvdh/laravel-debugbar": "^3.8",
|
||||||
"filp/whoops": "~2.0",
|
"filament/upgrade": "^5.0",
|
||||||
"fzaninotto/faker": "~1.4",
|
"filp/whoops": "^2.14",
|
||||||
"mockery/mockery": "0.9.*",
|
"mockery/mockery": "^1.6",
|
||||||
"phpunit/phpunit": "~7.0"
|
"nunomaduro/collision": "^8.1",
|
||||||
|
"phpunit/phpunit": "^11.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"classmap": [
|
"classmap": [
|
||||||
@@ -24,11 +27,6 @@
|
|||||||
],
|
],
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"App\\": "app/"
|
"App\\": "app/"
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload-dev": {
|
|
||||||
"psr-4": {
|
|
||||||
"Tests\\": "tests/"
|
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"app/Helpers/BidderSelectList.php",
|
"app/Helpers/BidderSelectList.php",
|
||||||
@@ -38,7 +36,11 @@
|
|||||||
"app/Helpers/WinningBidderSelectList.php",
|
"app/Helpers/WinningBidderSelectList.php",
|
||||||
"app/Helpers/WinningBidSelectList.php"
|
"app/Helpers/WinningBidSelectList.php"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"autoload-dev": {
|
||||||
|
"psr-4": {
|
||||||
|
"Tests\\": "tests/"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"post-root-package-install": [
|
"post-root-package-install": [
|
||||||
@@ -51,11 +53,13 @@
|
|||||||
"Illuminate\\Foundation\\ComposerScripts::postInstall"
|
"Illuminate\\Foundation\\ComposerScripts::postInstall"
|
||||||
],
|
],
|
||||||
"post-update-cmd": [
|
"post-update-cmd": [
|
||||||
"Illuminate\\Foundation\\ComposerScripts::postUpdate"
|
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
|
||||||
|
"@php artisan filament:upgrade"
|
||||||
],
|
],
|
||||||
"post-autoload-dump": [
|
"post-autoload-dump": [
|
||||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||||
"@php artisan package:discover"
|
"@php artisan package:discover",
|
||||||
|
"@php artisan filament:upgrade"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
|||||||
Generated
+7892
-1824
File diff suppressed because it is too large
Load Diff
+6558
File diff suppressed because it is too large
Load Diff
@@ -175,6 +175,7 @@ return [
|
|||||||
App\Providers\AuthServiceProvider::class,
|
App\Providers\AuthServiceProvider::class,
|
||||||
// App\Providers\BroadcastServiceProvider::class,
|
// App\Providers\BroadcastServiceProvider::class,
|
||||||
App\Providers\EventServiceProvider::class,
|
App\Providers\EventServiceProvider::class,
|
||||||
|
App\Providers\Filament\AdminPanelProvider::class,
|
||||||
App\Providers\RouteServiceProvider::class,
|
App\Providers\RouteServiceProvider::class,
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
/*
|
||||||
|
* Which column will be used as the order column.
|
||||||
|
*/
|
||||||
|
'order_column_name' => 'order_column',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Define if the models should sort when creating.
|
||||||
|
* When true, the package will automatically assign the highest order number to a new mode
|
||||||
|
*/
|
||||||
|
'sort_when_creating' => true,
|
||||||
|
];
|
||||||
@@ -0,0 +1,294 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Filament\Http\Middleware\Authenticate;
|
||||||
|
use Filament\Http\Middleware\DispatchServingFilamentEvent;
|
||||||
|
use Filament\Http\Middleware\MirrorConfigToSubpackages;
|
||||||
|
use Filament\Pages;
|
||||||
|
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\AuthenticateSession;
|
||||||
|
use Illuminate\Session\Middleware\StartSession;
|
||||||
|
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Filament Path
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| The default is `admin` but you can change it to whatever works best and
|
||||||
|
| doesn't conflict with the routing in your application.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'path' => env('FILAMENT_PATH', 'admin'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Filament Core Path
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This is the path which Filament will use to load its core routes and assets.
|
||||||
|
| You may change it if it conflicts with your other routes.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'core_path' => env('FILAMENT_CORE_PATH', 'filament'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Filament Domain
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| You may change the domain where Filament should be active. If the domain
|
||||||
|
| is empty, all domains will be valid.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'domain' => env('FILAMENT_DOMAIN'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Homepage URL
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This is the URL that Filament will redirect the user to when they click
|
||||||
|
| on the sidebar's header.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'home_url' => '/',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Brand Name
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This will be displayed on the login page and in the sidebar's header.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'brand' => env('APP_NAME'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Auth
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This is the configuration that Filament will use to handle authentication
|
||||||
|
| into the admin panel.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'auth' => [
|
||||||
|
'guard' => env('FILAMENT_AUTH_GUARD', 'web'),
|
||||||
|
'pages' => [
|
||||||
|
'login' => \Filament\Http\Livewire\Auth\Login::class,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Pages
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This is the namespace and directory that Filament will automatically
|
||||||
|
| register pages from. You may also register pages here.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'pages' => [
|
||||||
|
'namespace' => 'App\\Filament\\Pages',
|
||||||
|
'path' => app_path('Filament/Pages'),
|
||||||
|
'register' => [
|
||||||
|
Pages\Dashboard::class,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Resources
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This is the namespace and directory that Filament will automatically
|
||||||
|
| register resources from. You may also register resources here.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'resources' => [
|
||||||
|
'namespace' => 'App\\Filament\\Resources',
|
||||||
|
'path' => app_path('Filament/Resources'),
|
||||||
|
'register' => [],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Widgets
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This is the namespace and directory that Filament will automatically
|
||||||
|
| register dashboard widgets from. You may also register widgets here.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'widgets' => [
|
||||||
|
'namespace' => 'App\\Filament\\Widgets',
|
||||||
|
'path' => app_path('Filament/Widgets'),
|
||||||
|
'register' => [
|
||||||
|
Widgets\AccountWidget::class,
|
||||||
|
Widgets\FilamentInfoWidget::class,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Livewire
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This is the namespace and directory that Filament will automatically
|
||||||
|
| register Livewire components inside.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'livewire' => [
|
||||||
|
'namespace' => 'App\\Filament',
|
||||||
|
'path' => app_path('Filament'),
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Dark mode
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| By enabling this feature, your users are able to select between a light
|
||||||
|
| and dark appearance for the admin panel, or let their system decide.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'dark_mode' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Layout
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This is the configuration for the general layout of the admin panel.
|
||||||
|
|
|
||||||
|
| You may configure the max content width from `xl` to `7xl`, or `full`
|
||||||
|
| for no max width.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'layout' => [
|
||||||
|
'actions' => [
|
||||||
|
'modal' => [
|
||||||
|
'actions' => [
|
||||||
|
'alignment' => 'left',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'forms' => [
|
||||||
|
'actions' => [
|
||||||
|
'alignment' => 'left',
|
||||||
|
],
|
||||||
|
'have_inline_labels' => false,
|
||||||
|
],
|
||||||
|
'footer' => [
|
||||||
|
'should_show_logo' => true,
|
||||||
|
],
|
||||||
|
'max_content_width' => null,
|
||||||
|
'notifications' => [
|
||||||
|
'vertical_alignment' => 'top',
|
||||||
|
'alignment' => 'right',
|
||||||
|
],
|
||||||
|
'sidebar' => [
|
||||||
|
'is_collapsible_on_desktop' => false,
|
||||||
|
'groups' => [
|
||||||
|
'are_collapsible' => true,
|
||||||
|
],
|
||||||
|
'width' => null,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Favicon
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This is the path to the favicon used for pages in the admin panel.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'favicon' => null,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Avatar Provider
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This is the service that will be used to retrieve default avatars if one
|
||||||
|
| has not been uploaded.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default_avatar_provider' => \Filament\AvatarProviders\UiAvatarsProvider::class,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Filesystem Disk
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This is the storage disk Filament will use to put media. You may use any
|
||||||
|
| of the disks defined in the `config/filesystems.php`.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default_filesystem_disk' => env('FILAMENT_FILESYSTEM_DRIVER', 'public'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Google Fonts
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This is the URL for Google Fonts that should be loaded. You may use any
|
||||||
|
| font, or set to `null` to prevent any Google Fonts from loading.
|
||||||
|
|
|
||||||
|
| When using a custom font, you should also set the font family in your
|
||||||
|
| custom theme's `tailwind.config.js` file.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'google_fonts' => 'https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Middleware
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| You may customise the middleware stack that Filament uses to handle
|
||||||
|
| requests.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'middleware' => [
|
||||||
|
'auth' => [
|
||||||
|
Authenticate::class,
|
||||||
|
],
|
||||||
|
'base' => [
|
||||||
|
EncryptCookies::class,
|
||||||
|
AddQueuedCookiesToResponse::class,
|
||||||
|
StartSession::class,
|
||||||
|
AuthenticateSession::class,
|
||||||
|
ShareErrorsFromSession::class,
|
||||||
|
VerifyCsrfToken::class,
|
||||||
|
SubstituteBindings::class,
|
||||||
|
DispatchServingFilamentEvent::class,
|
||||||
|
MirrorConfigToSubpackages::class,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
||||||
+1
-1
@@ -161,7 +161,7 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'secure' => env('SESSION_SECURE_COOKIE', false),
|
'secure' => env('SESSION_SECURE_COOKIE', null),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -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');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('sessions', function (Blueprint $table) {
|
||||||
|
$table->string('id')->primary();
|
||||||
|
$table->foreignId('user_id')->nullable()->index();
|
||||||
|
$table->string('ip_address', 45)->nullable();
|
||||||
|
$table->text('user_agent')->nullable();
|
||||||
|
$table->longText('payload');
|
||||||
|
$table->integer('last_activity')->index();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('sessions');
|
||||||
|
}
|
||||||
|
};
|
||||||
Vendored
+2
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}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-cyrillic-ext-wght-normal-IYF56FF6.woff2") format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-cyrillic-wght-normal-JEOLYBOO.woff2") format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-greek-ext-wght-normal-EOVOK2B5.woff2") format("woff2-variations");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-greek-wght-normal-IRE366VL.woff2") format("woff2-variations");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-vietnamese-wght-normal-CE5GGD3W.woff2") format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-latin-ext-wght-normal-HA22NDSG.woff2") format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url("./inter-latin-wght-normal-NRMW37G5.woff2") format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user