Handle consumables route names

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-08-01 16:07:56 -07:00
parent 4a4636bd03
commit 53ff28d2b0
3 changed files with 4 additions and 4 deletions

View file

@ -56,7 +56,7 @@ class ConsumableCheckoutController extends Controller
// Check if the user exists
if (is_null($user = User::find($assigned_to))) {
// Redirect to the consumable management page with error
return redirect()->route('checkout/consumable', $consumable)->with('error', trans('admin/consumables/message.checkout.user_does_not_exist'));
return redirect()->route('consumables.checkout.show', $consumable)->with('error', trans('admin/consumables/message.checkout.user_does_not_exist'));
}
// Update the consumable data

View file

@ -127,7 +127,7 @@
@can('checkout', \App\Models\Consumable::class)
<div class="col-md-12">
<a href="{{ route('checkout/consumable', $consumable->id) }}" style="padding-bottom:5px;" class="btn btn-primary btn-sm" {{ (($consumable->numRemaining() > 0 ) ? '' : ' disabled') }}>{{ trans('general.checkout') }}</a>
<a href="{{ route('consumables.checkout.show', $consumable->id) }}" style="padding-bottom:5px;" class="btn btn-primary btn-sm" {{ (($consumable->numRemaining() > 0 ) ? '' : ' disabled') }}>{{ trans('general.checkout') }}</a>
</div>
@endcan

View file

@ -9,12 +9,12 @@ Route::group(['prefix' => 'consumables', 'middleware' => ['auth']], function ()
Route::get(
'{consumablesID}/checkout',
[Consumables\ConsumableCheckoutController::class, 'create']
)->name('checkout/consumable');
)->name('consumables.checkout.show');
Route::post(
'{consumablesID}/checkout',
[Consumables\ConsumableCheckoutController::class, 'store']
)->name('checkout/consumable');
)->name('consumables.checkout.store');
});