diff --git a/app/Http/Controllers/Applications/InviteesController.php b/app/Http/Controllers/Applications/InviteesController.php index dc65538..4a32360 100644 --- a/app/Http/Controllers/Applications/InviteesController.php +++ b/app/Http/Controllers/Applications/InviteesController.php @@ -43,6 +43,26 @@ public function view() ]); } + /** + * This is the confirmation page for removing a share/assistant from a dealership. + * It has been added in place of the confirmationless @see InviteesController::destroy(). + */ + public function delete(InviteeRemovalRequest $request) + { + $invitee = Application::findOrFail($request->get('invitee_id')); + // Note: We do not check the end dates here but in the actual destroy handler below. + // Users should not be routed to this view anyway if they are not allowed to do this. + + return view('application.invitee-delete', [ + "invitee" => $invitee, + ]); + } + + /** + * This is the actual destroy function, which was previously executed without a confirmation page. + * @param InviteeRemovalRequest $request + * @return \Illuminate\Http\RedirectResponse + */ public function destroy(InviteeRemovalRequest $request) { $invitee = Application::findOrFail($request->get('invitee_id')); @@ -66,7 +86,7 @@ public function destroy(InviteeRemovalRequest $request) if ($oldParent) { $oldParent->user()->first()->notify(new LeaveNotification($oldApplicationType->value, $invitee->user()->first()->name)); } - return back(); + return Redirect::route('applications.invitees.view'); } public function codes(Request $request) diff --git a/database/factories/TableTypeFactory.php b/database/factories/TableTypeFactory.php index 967a3c2..f85ba45 100644 --- a/database/factories/TableTypeFactory.php +++ b/database/factories/TableTypeFactory.php @@ -14,8 +14,8 @@ public function definition(): array { return [ 'name' => $this->faker->name(), - 'spaces' => $this->faker->randomNumber(), - 'seats' => $this->faker->randomNumber(), + 'spaces' => $this->faker->randomDigitNotZero() + 1, + 'seats' => $this->faker->randomDigitNotZero() + 1, 'price' => $this->faker->randomNumber(), 'package' => $this->faker->word(), 'created_at' => Carbon::now(), diff --git a/resources/css/app.scss b/resources/css/app.scss index e85c633..940bcff 100644 --- a/resources/css/app.scss +++ b/resources/css/app.scss @@ -1,17 +1,22 @@ $primary: #00504b; @import "bootstrap/scss/bootstrap.scss"; -label.required:after, legend.required:after, span.required:after { +label.required:after, +legend.required:after, +span.required:after { content: "*"; color: red; } /* DD Specific */ .dd-table-button { - width: 5ex; - height: 5ex; + width: 5.5ex; + height: 5.5ex; font-weight: bold; margin: 0.25ex; + display: inline-flex; + align-items: center; + justify-content: center; } .dd-table-button.border-danger { diff --git a/resources/views/application/invitee-delete.blade.php b/resources/views/application/invitee-delete.blade.php new file mode 100644 index 0000000..7535e62 --- /dev/null +++ b/resources/views/application/invitee-delete.blade.php @@ -0,0 +1,41 @@ +@extends('layouts.app') +@section('title') + Remove {{ ucfirst($invitee->type->value) }} from your Dealership +@endsection +@section('content') +