Skip to content

A free open source IT asset/license management system

Added breadcrumbs, updated controller to new bulk one (mm…. bread…)

snipe89e3b61dce69
diff --git a/routes/web/locations.php b/routes/web/locations.php
index bd2dfb7ddd..af8ef9d89a 100644
--- a/routes/web/locations.php
+++ b/routes/web/locations.php
@@ -1,20 +1,38 @@
<?php
+use App\Http\Controllers\BulkLocationsController;
use App\Http\Controllers\LocationsController;
use Illuminate\Support\Facades\Route;
+use Tabuna\Breadcrumbs\Trail;
Route::group(['prefix' => 'locations', 'middleware' => ['auth']], function () {
Route::post(
'bulkdelete',
- [LocationsController::class, 'postBulkDelete']
- )->name('locations.bulkdelete.show');
+ [BulkLocationsController::class, 'edit']
+ )->name('locations.bulkdelete.show')
+ ->breadcrumbs(function (Trail $trail) {
+ $label = match (request()->input('bulk_actions')) {
+ 'edit' => trans('general.bulk_edit'),
+ 'delete' => trans('general.delete'),
+ default => trans('general.bulk_actions'),
+ };
+
+ return $trail->parent('locations.index')->push($label, route('locations.index'));
+ });
Route::post(
'bulkedit',
- [LocationsController::class, 'postBulkDeleteStore']
+ [BulkLocationsController::class, 'destroy']
)->name('locations.bulkdelete.store');
+ Route::post(
+ 'bulkeditsave',
+ [BulkLocationsController::class, 'update']
+ )->name('locations.bulkedit.store')
+ ->breadcrumbs(fn(Trail $trail) => $trail->parent('locations.index')
+ ->push(trans('general.bulk_edit'), route('locations.index')));
+
Route::post(
'{location}/restore',
[LocationsController::class, 'postRestore']