Skip to content

Commit

Permalink
Changes to files: Classes/Item.php
Browse files Browse the repository at this point in the history
Classes/PrintTicket.php
Http/Controllers/.gitkeep
Http/Controllers/TicketController.php
Http/Requests/.gitkeep
Models/.gitkeep
Models/Attendant.php
Models/Data/Attendant.php
Models/Data/Destination.php
Models/Destination.php
Models/Ticket.php
Models/TicketLog.php
Resources/views/ticket-create.blade.php
Resources/views/ticket-dashboard.blade.php
Resources/views/ticket-move.blade.php
Resources/vue/widgets/destination.vue
Resources/vue/widgets/ticket.vue
Routes/.gitkeep
Routes/api.php
Routes/web.php
Tests/Feature/.gitkeep
Tests/Unit/.gitkeep
composer.json
  • Loading branch information
dedanirungu committed Aug 12, 2024
1 parent e0a5a00 commit 83b448b
Show file tree
Hide file tree
Showing 39 changed files with 617 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
104 changes: 104 additions & 0 deletions app/Filament/Resources/AttendantResource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?php

namespace Modules\Queuing\Filament\Resources;

use Modules\Queuing\Filament\Resources\AttendantResource\Pages;
use Modules\Queuing\Filament\Resources\AttendantResource\RelationManagers;
use Modules\Queuing\Models\Attendant;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;

class AttendantResource extends Resource
{
protected static ?string $model = Attendant::class;

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('name')
->maxLength(255)
->default(null),
Forms\Components\TextInput::make('slug')
->maxLength(255)
->default(null),
Forms\Components\Textarea::make('description')
->columnSpanFull(),
Forms\Components\TextInput::make('partner_id')
->required()
->numeric(),
Forms\Components\TextInput::make('destination_id')
->required()
->numeric(),
]);
}

public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name')
->searchable(),
Tables\Columns\TextColumn::make('slug')
->searchable(),
Tables\Columns\TextColumn::make('partner_id')
->numeric()
->sortable(),
Tables\Columns\TextColumn::make('destination_id')
->numeric()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
Tables\Filters\TrashedFilter::make(),
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]),
]);
}

public static function getRelations(): array
{
return [
//
];
}

public static function getPages(): array
{
return [
'index' => Pages\ListAttendants::route('/'),
'create' => Pages\CreateAttendant::route('/create'),
'edit' => Pages\EditAttendant::route('/{record}/edit'),
];
}

public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()
->withoutGlobalScopes([
SoftDeletingScope::class,
]);
}
}
12 changes: 12 additions & 0 deletions app/Filament/Resources/AttendantResource/Pages/CreateAttendant.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Modules\Queuing\Filament\Resources\AttendantResource\Pages;

use Modules\Queuing\Filament\Resources\AttendantResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;

class CreateAttendant extends CreateRecord
{
protected static string $resource = AttendantResource::class;
}
21 changes: 21 additions & 0 deletions app/Filament/Resources/AttendantResource/Pages/EditAttendant.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Modules\Queuing\Filament\Resources\AttendantResource\Pages;

use Modules\Queuing\Filament\Resources\AttendantResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;

class EditAttendant extends EditRecord
{
protected static string $resource = AttendantResource::class;

protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make(),
Actions\ForceDeleteAction::make(),
Actions\RestoreAction::make(),
];
}
}
19 changes: 19 additions & 0 deletions app/Filament/Resources/AttendantResource/Pages/ListAttendants.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Modules\Queuing\Filament\Resources\AttendantResource\Pages;

use Modules\Queuing\Filament\Resources\AttendantResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;

class ListAttendants extends ListRecords
{
protected static string $resource = AttendantResource::class;

protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
];
}
}
94 changes: 94 additions & 0 deletions app/Filament/Resources/DestinationResource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?php

namespace Modules\Queuing\Filament\Resources;

use Modules\Queuing\Filament\Resources\DestinationResource\Pages;
use Modules\Queuing\Filament\Resources\DestinationResource\RelationManagers;
use Modules\Queuing\Models\Destination;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;

class DestinationResource extends Resource
{
protected static ?string $model = Destination::class;

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('name')
->maxLength(255)
->default(null),
Forms\Components\TextInput::make('slug')
->maxLength(255)
->default(null),
Forms\Components\Textarea::make('description')
->columnSpanFull(),
Forms\Components\TextInput::make('assigned'),
]);
}

public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name')
->searchable(),
Tables\Columns\TextColumn::make('slug')
->searchable(),
Tables\Columns\TextColumn::make('assigned'),
Tables\Columns\TextColumn::make('created_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
Tables\Filters\TrashedFilter::make(),
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
]),
]);
}

public static function getRelations(): array
{
return [
//
];
}

public static function getPages(): array
{
return [
'index' => Pages\ListDestinations::route('/'),
'create' => Pages\CreateDestination::route('/create'),
'edit' => Pages\EditDestination::route('/{record}/edit'),
];
}

public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()
->withoutGlobalScopes([
SoftDeletingScope::class,
]);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Modules\Queuing\Filament\Resources\DestinationResource\Pages;

use Modules\Queuing\Filament\Resources\DestinationResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;

class CreateDestination extends CreateRecord
{
protected static string $resource = DestinationResource::class;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Modules\Queuing\Filament\Resources\DestinationResource\Pages;

use Modules\Queuing\Filament\Resources\DestinationResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;

class EditDestination extends EditRecord
{
protected static string $resource = DestinationResource::class;

protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make(),
Actions\ForceDeleteAction::make(),
Actions\RestoreAction::make(),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Modules\Queuing\Filament\Resources\DestinationResource\Pages;

use Modules\Queuing\Filament\Resources\DestinationResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;

class ListDestinations extends ListRecords
{
protected static string $resource = DestinationResource::class;

protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
];
}
}
Loading

0 comments on commit 83b448b

Please sign in to comment.