Merge branch 'upgrades-and-filament' into 'master'
Upgrades and filament See merge request tfmm/Silent-Auction!1
This commit is contained in:
commit
4fb991e4c0
@ -198,7 +198,8 @@ class TabulateWinners extends Command
|
||||
return $NinetyEightToCurrent2ndQuery->vehicle;
|
||||
}
|
||||
|
||||
|
||||
// Truncate table first
|
||||
CarShowWinner::truncate();
|
||||
//Insert Best In Show Winner
|
||||
CarShowWinner::updateOrCreate(
|
||||
[
|
||||
|
@ -2,64 +2,49 @@
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Auth\AuthenticationException;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Throwable;
|
||||
|
||||
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 = [
|
||||
\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,
|
||||
protected $levels = [
|
||||
//
|
||||
];
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
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'));
|
||||
}
|
||||
}
|
||||
}
|
88
app/Filament/Resources/BiddersResource.php
Normal file
88
app/Filament/Resources/BiddersResource.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\BiddersResource\Pages;
|
||||
use App\Filament\Resources\BiddersResource\RelationManagers;
|
||||
use App\Models\Bidders;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
|
||||
class BiddersResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Bidders::class;
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'idbidders';
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
|
||||
protected static ?string $navigationGroup = 'Silent Auction';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
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(fn (TextInput\Mask $mask) => $mask->pattern('(000)000-0000')),
|
||||
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'),
|
||||
TextColumn::make('bidder_fname')->sortable()->label('First Name'),
|
||||
TextColumn::make('bidder_lname')->sortable()->label('Last Name'),
|
||||
TextColumn::make('bidder_addr')->label('Address'),
|
||||
TextColumn::make('bidder_city')->label('City'),
|
||||
TextColumn::make('bidder_state')->label('State'),
|
||||
TextColumn::make('bidder_zip')->label('Zip'),
|
||||
TextColumn::make('bidder_phone')->label('Phone Number'),
|
||||
TextColumn::make('bidder_email')->label('Email'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\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\Pages\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateBidders extends CreateRecord
|
||||
{
|
||||
protected static string $resource = BiddersResource::class;
|
||||
}
|
19
app/Filament/Resources/BiddersResource/Pages/EditBidders.php
Normal file
19
app/Filament/Resources/BiddersResource/Pages/EditBidders.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BiddersResource\Pages;
|
||||
|
||||
use App\Filament\Resources\BiddersResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditBidders extends EditRecord
|
||||
{
|
||||
protected static string $resource = BiddersResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
19
app/Filament/Resources/BiddersResource/Pages/ListBidders.php
Normal file
19
app/Filament/Resources/BiddersResource/Pages/ListBidders.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BiddersResource\Pages;
|
||||
|
||||
use App\Filament\Resources\BiddersResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListBidders extends ListRecords
|
||||
{
|
||||
protected static string $resource = BiddersResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BiddersResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\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 = 'bidder_num';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('bidder_num')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('bidders.bidder_assigned_number')
|
||||
->label('Bidder Number')
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('winnertotal')
|
||||
->label('Total Amount')
|
||||
->money('usd', 'true')
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('paymentMethod.pm_name')
|
||||
->label('Payment Method')
|
||||
->sortable(),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
Tables\Actions\CreateAction::make(),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BiddersResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use App\Models\CarShowCategory;
|
||||
|
||||
class VehiclesRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'vehicles';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'owner';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
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 static 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(),
|
||||
Tables\Columns\BooleanColumn::make('doNotJudge')
|
||||
->label('Judged?')
|
||||
->sortable()
|
||||
->falseIcon('heroicon-o-badge-check')
|
||||
->trueIcon('heroicon-o-x-circle')
|
||||
->trueColor('danger')
|
||||
->falseColor('success'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
Tables\Actions\CreateAction::make(),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\BiddersResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use App\Models\Bidders;
|
||||
|
||||
class WinningBidsRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'winningBids';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'winning_bidder_num';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\Select::make('winning_bidder_num')
|
||||
->label('Winning Bidder Number')
|
||||
->options(Bidders::pluck('bidder_assigned_number', 'idbidders'))
|
||||
->searchable(),
|
||||
]);
|
||||
}
|
||||
|
||||
public static 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', 'true')
|
||||
->sortable(),
|
||||
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
Tables\Actions\CreateAction::make(),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
72
app/Filament/Resources/CarShowCategoryResource.php
Normal file
72
app/Filament/Resources/CarShowCategoryResource.php
Normal file
@ -0,0 +1,72 @@
|
||||
<?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\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Filament\Tables\Columns\BooleanColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
|
||||
class CarShowCategoryResource extends Resource
|
||||
{
|
||||
protected static ?string $model = CarShowCategory::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
|
||||
protected static ?string $navigationGroup = 'Car Show';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
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(),
|
||||
BooleanColumn::make('vehicle_type')->sortable(),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\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\Pages\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\Pages\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditCarShowCategory extends EditRecord
|
||||
{
|
||||
protected static string $resource = CarShowCategoryResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\CarShowCategoryResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CarShowCategoryResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListCarShowCategories extends ListRecords
|
||||
{
|
||||
protected static string $resource = CarShowCategoryResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\CarShowCategoryResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
|
||||
class VehicleRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'vehicle';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'id';
|
||||
|
||||
protected static ?string $inverseRelationship = 'vehicleType';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('id')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
]);
|
||||
}
|
||||
|
||||
public static 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([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
Tables\Actions\CreateAction::make(),
|
||||
Tables\Actions\AssociateAction::make(),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
Tables\Actions\DissociateAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\DissociateBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
80
app/Filament/Resources/CarShowWinnerResource.php
Normal file
80
app/Filament/Resources/CarShowWinnerResource.php
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\CarShowWinnerResource\Pages;
|
||||
use App\Filament\Resources\CarShowWinnerResource\RelationManagers;
|
||||
use App\Models\CarShowWinner;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\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;
|
||||
|
||||
class CarShowWinnerResource extends Resource
|
||||
{
|
||||
protected static ?string $model = CarShowWinner::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
|
||||
protected static ?string $navigationGroup = 'Car Show';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
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'),
|
||||
TextColumn::make('awardVehicle.owner')->label('Vehicle Number'),
|
||||
TextColumn::make('awardVehicle.year')->label('Year'),
|
||||
TextColumn::make('awardVehicle.make')->label('Make'),
|
||||
TextColumn::make('awardVehicle.model')->label('Model'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\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\Pages\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\Pages\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditCarShowWinner extends EditRecord
|
||||
{
|
||||
protected static string $resource = CarShowWinnerResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\CarShowWinnerResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CarShowWinnerResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListCarShowWinners extends ListRecords
|
||||
{
|
||||
protected static string $resource = CarShowWinnerResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\CarShowWinnerResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
|
||||
class AwardCategoryRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'awardCategory';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'id';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('id')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('id'),
|
||||
Tables\Columns\TextColumn::make('category_name'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
Tables\Actions\CreateAction::make(),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\CarShowWinnerResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
|
||||
class AwardVehicleRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'awardVehicle';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'id';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('id')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
]);
|
||||
}
|
||||
|
||||
public static 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([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
Tables\Actions\CreateAction::make(),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
101
app/Filament/Resources/CheckoutResource.php
Normal file
101
app/Filament/Resources/CheckoutResource.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\CheckoutResource\Pages;
|
||||
use App\Filament\Resources\CheckoutResource\RelationManagers;
|
||||
use App\Models\Checkout;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Filament\Tables\Columns\BooleanColumn;
|
||||
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;
|
||||
|
||||
class CheckoutResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Checkout::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
|
||||
protected static ?string $navigationGroup = 'Silent Auction';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Select::make('bidder_num')
|
||||
->label('Bidder')
|
||||
->options(
|
||||
Bidders::orderBy('bidder_assigned_number')
|
||||
->pluck('bidder_assigned_number', 'idbidders')
|
||||
)
|
||||
->searchable(),
|
||||
TextInput::make('winnertotal')
|
||||
->label('Total Amount')
|
||||
->mask(
|
||||
fn (TextInput\Mask $mask) => $mask->money(
|
||||
prefix: '$',
|
||||
thousandsSeparator: ',',
|
||||
decimalPlaces: 2,
|
||||
isSigned: false
|
||||
)
|
||||
),
|
||||
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', 'true')
|
||||
->sortable(),
|
||||
TextColumn::make('paymentMethod.pm_name')
|
||||
->label('Payment Method')
|
||||
->sortable(),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\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\Pages\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\Pages\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditCheckout extends EditRecord
|
||||
{
|
||||
protected static string $resource = CheckoutResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\CheckoutResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CheckoutResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListCheckouts extends ListRecords
|
||||
{
|
||||
protected static string $resource = CheckoutResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\CheckoutResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\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 static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
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 static 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\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\CheckoutResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\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 static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('payment_method')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
]);
|
||||
}
|
||||
|
||||
public static 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\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
104
app/Filament/Resources/ItemsResource.php
Normal file
104
app/Filament/Resources/ItemsResource.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\ItemsResource\Pages;
|
||||
use App\Filament\Resources\ItemsResource\RelationManagers;
|
||||
use App\Models\Items;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Filament\Tables\Columns\BooleanColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
|
||||
class ItemsResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Items::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
|
||||
protected static ?string $navigationGroup = 'Silent Auction';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
TextInput::make('item_assigned_num')
|
||||
->label('Item Number'),
|
||||
TextInput::make('item_desc')
|
||||
->label('Description'),
|
||||
TextInput::make('item_min_bid')
|
||||
->label('Minimum Bid')
|
||||
->mask(
|
||||
fn (TextInput\Mask $mask) => $mask->money(
|
||||
prefix: '$',
|
||||
thousandsSeparator: ',',
|
||||
decimalPlaces: 2,
|
||||
isSigned: false
|
||||
)
|
||||
),
|
||||
TextInput::make('item_est_value')
|
||||
->label('Estimated Value')
|
||||
->mask(
|
||||
fn (TextInput\Mask $mask) => $mask->money(
|
||||
prefix: '$',
|
||||
thousandsSeparator: ',',
|
||||
decimalPlaces: 2,
|
||||
isSigned: false
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
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', 'true')
|
||||
->sortable(),
|
||||
TextColumn::make('item_est_value')
|
||||
->label('Estimated Value')
|
||||
->money('usd', 'true')
|
||||
->sortable(),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\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'),
|
||||
];
|
||||
}
|
||||
}
|
12
app/Filament/Resources/ItemsResource/Pages/CreateItems.php
Normal file
12
app/Filament/Resources/ItemsResource/Pages/CreateItems.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\ItemsResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ItemsResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateItems extends CreateRecord
|
||||
{
|
||||
protected static string $resource = ItemsResource::class;
|
||||
}
|
19
app/Filament/Resources/ItemsResource/Pages/EditItems.php
Normal file
19
app/Filament/Resources/ItemsResource/Pages/EditItems.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\ItemsResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ItemsResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditItems extends EditRecord
|
||||
{
|
||||
protected static string $resource = ItemsResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
19
app/Filament/Resources/ItemsResource/Pages/ListItems.php
Normal file
19
app/Filament/Resources/ItemsResource/Pages/ListItems.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\ItemsResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ItemsResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListItems extends ListRecords
|
||||
{
|
||||
protected static string $resource = ItemsResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\ItemsResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\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 static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('iditems')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
]);
|
||||
}
|
||||
|
||||
public static 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\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
66
app/Filament/Resources/JudgesResource.php
Normal file
66
app/Filament/Resources/JudgesResource.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\JudgesResource\Pages;
|
||||
use App\Filament\Resources\JudgesResource\RelationManagers;
|
||||
use App\Models\Judges;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
|
||||
class JudgesResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Judges::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
|
||||
protected static ?string $navigationGroup = 'Car Show';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
TextInput::make('judge_number'),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('judge_number')->sortable(),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\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'),
|
||||
];
|
||||
}
|
||||
}
|
12
app/Filament/Resources/JudgesResource/Pages/CreateJudges.php
Normal file
12
app/Filament/Resources/JudgesResource/Pages/CreateJudges.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\JudgesResource\Pages;
|
||||
|
||||
use App\Filament\Resources\JudgesResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateJudges extends CreateRecord
|
||||
{
|
||||
protected static string $resource = JudgesResource::class;
|
||||
}
|
19
app/Filament/Resources/JudgesResource/Pages/EditJudges.php
Normal file
19
app/Filament/Resources/JudgesResource/Pages/EditJudges.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\JudgesResource\Pages;
|
||||
|
||||
use App\Filament\Resources\JudgesResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditJudges extends EditRecord
|
||||
{
|
||||
protected static string $resource = JudgesResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
19
app/Filament/Resources/JudgesResource/Pages/ListJudges.php
Normal file
19
app/Filament/Resources/JudgesResource/Pages/ListJudges.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\JudgesResource\Pages;
|
||||
|
||||
use App\Filament\Resources\JudgesResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListJudges extends ListRecords
|
||||
{
|
||||
protected static string $resource = JudgesResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\JudgesResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\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 static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('judge')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
]);
|
||||
}
|
||||
|
||||
public static 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\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
69
app/Filament/Resources/PaymentMethodsResource.php
Normal file
69
app/Filament/Resources/PaymentMethodsResource.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\PaymentMethodsResource\Pages;
|
||||
use App\Filament\Resources\PaymentMethodsResource\RelationManagers;
|
||||
use App\Models\PaymentMethods;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
|
||||
class PaymentMethodsResource extends Resource
|
||||
{
|
||||
protected static ?string $model = PaymentMethods::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
|
||||
protected static ?string $navigationGroup = 'Silent Auction';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
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([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\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\Pages\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\Pages\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditPaymentMethods extends EditRecord
|
||||
{
|
||||
protected static string $resource = PaymentMethodsResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\PaymentMethodsResource\Pages;
|
||||
|
||||
use App\Filament\Resources\PaymentMethodsResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListPaymentMethods extends ListRecords
|
||||
{
|
||||
protected static string $resource = PaymentMethodsResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\PaymentMethodsResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\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 static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('payment_method')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
]);
|
||||
}
|
||||
|
||||
public static 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\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
78
app/Filament/Resources/PeoplesChoiceResource.php
Normal file
78
app/Filament/Resources/PeoplesChoiceResource.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\PeoplesChoiceResource\Pages;
|
||||
use App\Filament\Resources\PeoplesChoiceResource\RelationManagers;
|
||||
use App\Models\PeoplesChoice;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\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;
|
||||
|
||||
class PeoplesChoiceResource extends Resource
|
||||
{
|
||||
protected static ?string $model = PeoplesChoice::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
|
||||
protected static ?string $navigationGroup = 'Car Show';
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Peoples Choice';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
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'),
|
||||
TextColumn::make('vehicles.owner')->label('Vehicle Number'),
|
||||
TextColumn::make('vehicles.year')->label('Year'),
|
||||
TextColumn::make('vehicles.make')->label('Make'),
|
||||
TextColumn::make('vehicles.model')->label('Model'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\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\Pages\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\Pages\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditPeoplesChoice extends EditRecord
|
||||
{
|
||||
protected static string $resource = PeoplesChoiceResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\PeoplesChoiceResource\Pages;
|
||||
|
||||
use App\Filament\Resources\PeoplesChoiceResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListPeoplesChoices extends ListRecords
|
||||
{
|
||||
protected static string $resource = PeoplesChoiceResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\PeoplesChoiceResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\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 static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('vehicle')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
]);
|
||||
}
|
||||
|
||||
public static 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\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
82
app/Filament/Resources/VehicleScoresResource.php
Normal file
82
app/Filament/Resources/VehicleScoresResource.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\VehicleScoresResource\Pages;
|
||||
use App\Filament\Resources\VehicleScoresResource\RelationManagers;
|
||||
use App\Models\VehicleScores;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\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;
|
||||
|
||||
class VehicleScoresResource extends Resource
|
||||
{
|
||||
protected static ?string $model = VehicleScores::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
|
||||
protected static ?string $navigationGroup = 'Car Show';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
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([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\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\Pages\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\Pages\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditVehicleScores extends EditRecord
|
||||
{
|
||||
protected static string $resource = VehicleScoresResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\VehicleScoresResource\Pages;
|
||||
|
||||
use App\Filament\Resources\VehicleScoresResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListVehicleScores extends ListRecords
|
||||
{
|
||||
protected static string $resource = VehicleScoresResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\VehicleScoresResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
|
||||
class JudgeRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'judges';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'judge_number';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('judge_number')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('judge_number'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
Tables\Actions\CreateAction::make(),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\VehicleScoresResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
|
||||
class ScoredVehicleRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'scoredVehicle';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'id';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('owner')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
]);
|
||||
}
|
||||
|
||||
public static 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([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
Tables\Actions\CreateAction::make(),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
115
app/Filament/Resources/VehiclesResource.php
Normal file
115
app/Filament/Resources/VehiclesResource.php
Normal file
@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\VehiclesResource\Pages;
|
||||
use App\Filament\Resources\VehiclesResource\RelationManagers;
|
||||
use App\Models\Vehicles;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Filament\Tables\Columns\BooleanColumn;
|
||||
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;
|
||||
|
||||
class VehiclesResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Vehicles::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
|
||||
protected static ?string $navigationGroup = 'Car Show';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
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(),
|
||||
BooleanColumn::make('doNotJudge')
|
||||
->label('Judged?')
|
||||
->sortable()
|
||||
->falseIcon('heroicon-o-badge-check')
|
||||
->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([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\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\Pages\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\Pages\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditVehicles extends EditRecord
|
||||
{
|
||||
protected static string $resource = VehiclesResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\VehiclesResource\Pages;
|
||||
|
||||
use App\Filament\Resources\VehiclesResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListVehicles extends ListRecords
|
||||
{
|
||||
protected static string $resource = VehiclesResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
|
||||
class CarShowWinnerRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'CarShowWinner';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'id';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('id')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('id'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
Tables\Actions\CreateAction::make(),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use App\Models\Bidders;
|
||||
|
||||
class VehicleOwnerRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'vehicleOwner';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'owner';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
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 static 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\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use App\Models\Vehicles;
|
||||
use App\Models\Judges;
|
||||
|
||||
class VehicleScoresRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'vehicleScores';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'id';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
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 static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('judge'),
|
||||
Tables\Columns\TextColumn::make('overall_score'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
Tables\Actions\CreateAction::make(),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use App\Models\CarShowCategory;
|
||||
|
||||
class VehicleTypeRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'vehicleType';
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'id';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
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 static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('category_name'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
Tables\Actions\CreateAction::make(),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
Tables\Actions\DeleteAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
106
app/Filament/Resources/WinningBidsResource.php
Normal file
106
app/Filament/Resources/WinningBidsResource.php
Normal file
@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\WinningBidsResource\Pages;
|
||||
use App\Filament\Resources\WinningBidsResource\RelationManagers;
|
||||
use App\Models\WinningBids;
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Filament\Tables\Columns\BooleanColumn;
|
||||
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 function Ramsey\Uuid\v1;
|
||||
|
||||
class WinningBidsResource extends Resource
|
||||
{
|
||||
protected static ?string $model = WinningBids::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
||||
|
||||
protected static ?string $navigationGroup = 'Silent Auction';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
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')
|
||||
->mask(
|
||||
fn (TextInput\Mask $mask) => $mask->money(
|
||||
prefix: '$',
|
||||
thousandsSeparator: ',',
|
||||
decimalPlaces: 2,
|
||||
isSigned: false
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
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', 'true')
|
||||
->sortable(),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\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\Pages\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\Pages\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditWinningBids extends EditRecord
|
||||
{
|
||||
protected static string $resource = WinningBidsResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\WinningBidsResource\Pages;
|
||||
|
||||
use App\Filament\Resources\WinningBidsResource;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListWinningBids extends ListRecords
|
||||
{
|
||||
protected static string $resource = WinningBidsResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Bidders extends Model
|
||||
{
|
||||
protected $table = 'bidders';
|
||||
|
||||
protected $primaryKey = 'idbidders';
|
||||
|
||||
protected $fillable = [
|
||||
'bidder_fname',
|
||||
'bidder_lname',
|
||||
@ -38,6 +41,6 @@ class Bidders extends Model
|
||||
|
||||
public function vehicles()
|
||||
{
|
||||
return $this->hasMany('App\Models\Vehicles', 'owner', 'bidder_assigned_number');
|
||||
return $this->hasMany(Vehicles::class, 'owner', 'bidder_assigned_number');
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,12 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class CarShowCategory extends Model
|
||||
{
|
||||
protected $table = 'car_show_categories';
|
||||
protected static ?string $recordTitleAttribute = 'category_name';
|
||||
|
||||
protected $casts = [
|
||||
'vehicle_type' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'category_name',
|
||||
'vehicle_type'
|
||||
@ -19,10 +25,15 @@ class CarShowCategory extends Model
|
||||
|
||||
public function vehicle()
|
||||
{
|
||||
return $this->hasMany('App\Models\Vehicles', 'id', 'type');
|
||||
return $this->hasMany(Vehicles::class, 'type');
|
||||
}
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Checkout extends Model
|
||||
{
|
||||
protected $table = 'checkout';
|
||||
|
||||
protected $primaryKey = 'checkout_id';
|
||||
|
||||
protected $fillable = [
|
||||
'bidder_num',
|
||||
'winnertotal',
|
||||
@ -25,11 +28,11 @@ class Checkout extends Model
|
||||
|
||||
public function bidders()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Bidders', 'bidder_num', 'idbidders');
|
||||
return $this->belongsTo(Bidders::class, 'bidder_num', 'idbidders');
|
||||
}
|
||||
|
||||
public function paymentMethod()
|
||||
{
|
||||
return $this->hasMany('App\Models\PaymentMethods', 'payment_method', 'pm_id');
|
||||
return $this->hasMany(PaymentMethods::class, 'pm_id', 'payment_method');
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Items extends Model
|
||||
{
|
||||
protected $table = 'items';
|
||||
|
||||
protected $primaryKey = 'iditems';
|
||||
|
||||
protected $fillable = [
|
||||
'item_desc',
|
||||
'item_min_bid',
|
||||
@ -23,6 +26,6 @@ class Items extends Model
|
||||
|
||||
public function winningBids()
|
||||
{
|
||||
return $this->belongsTo('App\Models\WinningBids', 'iditems', 'winning_item_num');
|
||||
return $this->belongsTo(WinningBids::class, 'iditems', 'winning_item_num');
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,6 @@ class Judges extends Model
|
||||
|
||||
public function vehicleScores()
|
||||
{
|
||||
return $this->hasMany('App\Models\VehicleScores', 'judge', 'id');
|
||||
return $this->hasMany(VehicleScores::class, 'judge', 'id');
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class PaymentMethods extends Model
|
||||
{
|
||||
protected $table = 'payment_methods';
|
||||
|
||||
protected $primaryKey = 'pm_id';
|
||||
|
||||
protected $fillable = [
|
||||
'pm_name',
|
||||
'created_at',
|
||||
@ -20,6 +23,6 @@ class PaymentMethods extends Model
|
||||
|
||||
public function checkout()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Checkout', 'payment_method', 'pm_id');
|
||||
return $this->belongsTo(Checkout::class, 'payment_method', 'pm_id');
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,6 @@ class PeoplesChoice extends Model
|
||||
|
||||
public function vehicles()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Vehicles', 'vehicle', 'id');
|
||||
return $this->belongsTo(Vehicles::class, 'vehicle', 'id');
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ class VehicleScores extends Model
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
public function judge()
|
||||
public function judges()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Judges', 'judge', 'id');
|
||||
}
|
||||
|
@ -4,40 +4,45 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class vehicles extends Model
|
||||
class Vehicles extends Model
|
||||
{
|
||||
protected $table = 'vehicles';
|
||||
protected $fillable = [
|
||||
'year',
|
||||
'make',
|
||||
'model',
|
||||
'type',
|
||||
'doNotJudge',
|
||||
'owner'
|
||||
];
|
||||
protected $table = 'vehicles';
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
protected $casts = [
|
||||
'owner' => 'integer'
|
||||
];
|
||||
|
||||
public function vehicleType()
|
||||
{
|
||||
return $this->belongsTo('App\Models\CarShowCategory', 'type', 'id');
|
||||
}
|
||||
protected $fillable = [
|
||||
'year',
|
||||
'make',
|
||||
'model',
|
||||
'type',
|
||||
'doNotJudge',
|
||||
'owner'
|
||||
];
|
||||
|
||||
public function vehicleOwner()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Bidders', 'owner', 'bidder_assigned_number');
|
||||
}
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
public function vehicleScores()
|
||||
{
|
||||
return $this->hasMany('App\Models\VechicleScores', 'id', 'vehicle');
|
||||
}
|
||||
public function vehicleType()
|
||||
{
|
||||
return $this->belongsTo(CarShowCategory::class, 'type', 'id');
|
||||
}
|
||||
|
||||
public function CarShowWinner()
|
||||
{
|
||||
return $this->belongsTo('App\Models\CarShowWinner', 'id', 'vehicle');
|
||||
}
|
||||
public function vehicleOwner()
|
||||
{
|
||||
return $this->belongsTo(Bidders::class, 'owner', 'bidder_assigned_number');
|
||||
}
|
||||
|
||||
public function vehicleScores()
|
||||
{
|
||||
return $this->hasMany(VehicleScores::class, 'vehicle');
|
||||
}
|
||||
|
||||
public function CarShowWinner()
|
||||
{
|
||||
return $this->belongsTo(CarShowWinner::class, 'vehicle');
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class WinningBids extends Model
|
||||
{
|
||||
protected $table = 'winning_bids';
|
||||
|
||||
protected $primaryKey = 'idwinning_bids';
|
||||
|
||||
protected $fillable = [
|
||||
'winning_bidder_num',
|
||||
'winning_cost',
|
||||
@ -22,11 +25,11 @@ class WinningBids extends Model
|
||||
|
||||
public function items()
|
||||
{
|
||||
return $this->hasMany('App\Models\Items', 'iditems', 'winning_item_num');
|
||||
return $this->hasMany(Items::class, 'iditems', 'winning_item_num');
|
||||
}
|
||||
|
||||
public function bidders()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Bidders', 'winning_bidder_num', 'idbidders');
|
||||
return $this->belongsTo(Bidders::class, 'winning_bidder_num', 'idbidders');
|
||||
}
|
||||
}
|
||||
|
12
app/User.php
12
app/User.php
@ -4,8 +4,10 @@ namespace App;
|
||||
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Filament\Models\Contracts\FilamentUser;
|
||||
use Filament\Models\Contracts\HasName;
|
||||
|
||||
class User extends Authenticatable
|
||||
class User extends Authenticatable implements FilamentUser,HasName
|
||||
{
|
||||
use Notifiable;
|
||||
|
||||
@ -26,4 +28,12 @@ class User extends Authenticatable
|
||||
protected $hidden = [
|
||||
'password', 'remember_token',
|
||||
];
|
||||
public function canAccessFilament(): bool
|
||||
{
|
||||
return str_ends_with($this->email, '@tfmm.co');
|
||||
}
|
||||
public function getFilamentName(): string
|
||||
{
|
||||
return "{$this->name}";
|
||||
}
|
||||
}
|
||||
|
@ -6,17 +6,18 @@
|
||||
"type": "project",
|
||||
"require": {
|
||||
"php": ">=7.0.0",
|
||||
"barryvdh/laravel-snappy": "^0.4.1",
|
||||
"laravel/framework": "5.6.*",
|
||||
"laravel/tinker": "~1.0",
|
||||
"niklasravnsborg/laravel-pdf": "^2.0"
|
||||
"barryvdh/laravel-snappy": "^1.0",
|
||||
"carlos-meneses/laravel-mpdf": "^2.1",
|
||||
"filament/filament": "^2.0",
|
||||
"laravel/framework": "^9.0",
|
||||
"laravel/tinker": "^2.0",
|
||||
"laravel/ui": "^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3.2",
|
||||
"barryvdh/laravel-debugbar": "^3.7",
|
||||
"filp/whoops": "~2.0",
|
||||
"fzaninotto/faker": "~1.4",
|
||||
"mockery/mockery": "0.9.*",
|
||||
"phpunit/phpunit": "~7.0"
|
||||
"phpunit/phpunit": "^9.0"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
@ -51,7 +52,8 @@
|
||||
"Illuminate\\Foundation\\ComposerScripts::postInstall"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postUpdate"
|
||||
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
|
||||
"@php artisan filament:upgrade"
|
||||
],
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
|
7058
composer.lock
generated
7058
composer.lock
generated
File diff suppressed because it is too large
Load Diff
6558
composer.lock.bak
Normal file
6558
composer.lock.bak
Normal file
File diff suppressed because it is too large
Load Diff
14
config/eloquent-sortable.php
Normal file
14
config/eloquent-sortable.php
Normal file
@ -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,
|
||||
];
|
294
config/filament.php
Normal file
294
config/filament.php
Normal file
@ -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,
|
||||
],
|
||||
],
|
||||
|
||||
];
|
@ -161,7 +161,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'secure' => env('SESSION_SECURE_COOKIE', false),
|
||||
'secure' => env('SESSION_SECURE_COOKIE', null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -151,6 +151,11 @@
|
||||
Vehicle Total Scores
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/tabulateshowwinners">
|
||||
Tabulate Show Winners
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
|
@ -58,4 +58,8 @@ Route::group(['middleware' => 'auth'], function() {
|
||||
Route::post('vehicletypes', [ 'uses' => 'PagesController@vehicletypes']);
|
||||
Route::post('awardcategories', [ 'uses' => 'PagesController@awardcategories']);
|
||||
Route::get('showcarlist', [ 'uses' => 'PagesController@showcarlist']);
|
||||
Route::get('tabulateshowwinners', function() {
|
||||
Artisan::call('carshow:tabulatewinners');
|
||||
return redirect('showwinners');
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user