A free open source IT asset/license management system
Handle consumables route names
snipe53ff28d2b0d0
diff --git a/app/Http/Controllers/Consumables/ConsumableCheckoutController.php b/app/Http/Controllers/Consumables/ConsumableCheckoutController.phpindex 03ca2f2052..48cb6ac76a 100644--- a/app/Http/Controllers/Consumables/ConsumableCheckoutController.php+++ b/app/Http/Controllers/Consumables/ConsumableCheckoutController.php@@ -56,7 +56,7 @@ class ConsumableCheckoutController extends Controller// Check if the user existsif (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 datadiff --git a/resources/views/consumables/view.blade.php b/resources/views/consumables/view.blade.phpindex 958c0e1ee8..cacab8b267 100644--- a/resources/views/consumables/view.blade.php+++ b/resources/views/consumables/view.blade.php@@ -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>@endcandiff --git a/routes/web/consumables.php b/routes/web/consumables.phpindex 17e59df8aa..9f930a968c 100644--- a/routes/web/consumables.php+++ b/routes/web/consumables.php@@ -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');});