Skip to content

Commit 3a4fa35

Browse files
authored
Merge pull request #16874 from grokability/clone_breadcrumb_fix
Fixed breadcrumbs for cloning
2 parents 500d6a0 + 45ff195 commit 3a4fa35

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

app/Providers/BreadcrumbsServiceProvider.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ public function boot()
6767
->push(trans('general.create'), route('hardware.create'))
6868
);
6969

70+
Breadcrumbs::for('clone/hardware', fn (Trail $trail) =>
71+
$trail->parent('hardware.index', route('hardware.index'))
72+
->push(trans('admin/hardware/general.clone'), route('hardware.create'))
73+
);
74+
7075
Breadcrumbs::for('hardware.show', fn (Trail $trail, Asset $asset) =>
7176
$trail->parent('hardware.index', route('hardware.index'))
7277
->push($asset->present()->fullName(), route('hardware.show', $asset))
@@ -378,6 +383,12 @@ public function boot()
378383
->push(trans('general.create'), route('locations.create'))
379384
);
380385

386+
Breadcrumbs::for('clone/location', fn (Trail $trail) =>
387+
$trail->parent('locations.index', route('locations.index'))
388+
->push(trans('admin/locations/table.clone'), route('locations.create'))
389+
);
390+
391+
381392
Breadcrumbs::for('locations.show', fn (Trail $trail, Location $location) =>
382393
$trail->parent('locations.index', route('locations.index'))
383394
->push($location->name, route('locations.show', $location))
@@ -539,6 +550,13 @@ public function boot()
539550
->push(trans('general.create'), route('users.create'))
540551
);
541552

553+
Breadcrumbs::for('users.clone.show', fn (Trail $trail) =>
554+
$trail->parent('users.index', route('users.index'))
555+
->push(trans('admin/users/general.clone'), route('users.create'))
556+
);
557+
558+
559+
542560
Breadcrumbs::for('users.show', fn (Trail $trail, User $user) =>
543561
$trail->parent('users.index', route('users.index'))
544562
->push($user->getFullNameAttribute() ?? 'Missing Username!', route('users.show', $user))

resources/lang/en-US/admin/locations/table.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@
3939
'signed_by_finance_auditor' => 'Signed By (Finance Auditor):',
4040
'signed_by_location_manager' => 'Signed By (Location Manager):',
4141
'signed_by' => 'Signed Off By:',
42+
'clone' => 'Clone Location',
4243
];

routes/web/models.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use App\Http\Controllers\AssetModelsFilesController;
55
use App\Http\Controllers\BulkAssetModelsController;
66
use Illuminate\Support\Facades\Route;
7+
use Tabuna\Breadcrumbs\Trail;
78

89
// Asset Model Management
910

@@ -28,7 +29,10 @@
2829
AssetModelsController::class,
2930
'getClone'
3031
]
31-
)->name('models.clone.create')->withTrashed();
32+
)->name('models.clone.create')->withTrashed()
33+
->breadcrumbs(fn (Trail $trail) =>
34+
$trail->parent('models.index')
35+
->push(trans('admin/models/table.clone'), route('models.index')));
3236

3337
Route::post(
3438
'{model}/clone',

0 commit comments

Comments
 (0)