mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Handle consumables route names
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
4a4636bd03
commit
53ff28d2b0
|
@ -56,7 +56,7 @@ class ConsumableCheckoutController extends Controller
|
||||||
// Check if the user exists
|
// Check if the user exists
|
||||||
if (is_null($user = User::find($assigned_to))) {
|
if (is_null($user = User::find($assigned_to))) {
|
||||||
// Redirect to the consumable management page with error
|
// 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
|
// Update the consumable data
|
||||||
|
|
|
@ -127,7 +127,7 @@
|
||||||
|
|
||||||
@can('checkout', \App\Models\Consumable::class)
|
@can('checkout', \App\Models\Consumable::class)
|
||||||
<div class="col-md-12">
|
<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>
|
</div>
|
||||||
@endcan
|
@endcan
|
||||||
|
|
||||||
|
|
|
@ -9,12 +9,12 @@ Route::group(['prefix' => 'consumables', 'middleware' => ['auth']], function ()
|
||||||
Route::get(
|
Route::get(
|
||||||
'{consumablesID}/checkout',
|
'{consumablesID}/checkout',
|
||||||
[Consumables\ConsumableCheckoutController::class, 'create']
|
[Consumables\ConsumableCheckoutController::class, 'create']
|
||||||
)->name('checkout/consumable');
|
)->name('consumables.checkout.show');
|
||||||
|
|
||||||
Route::post(
|
Route::post(
|
||||||
'{consumablesID}/checkout',
|
'{consumablesID}/checkout',
|
||||||
[Consumables\ConsumableCheckoutController::class, 'store']
|
[Consumables\ConsumableCheckoutController::class, 'store']
|
||||||
)->name('checkout/consumable');
|
)->name('consumables.checkout.store');
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue