Added breadcrumbs to licenses routes
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
6f071722a2
commit
ddb72bf4d0
1 changed files with 13 additions and 6 deletions
|
@ -3,6 +3,7 @@
|
||||||
use App\Http\Controllers\Licenses;
|
use App\Http\Controllers\Licenses;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
use App\Models\License;
|
use App\Models\License;
|
||||||
|
use App\Models\LicenseSeat;
|
||||||
use Tabuna\Breadcrumbs\Trail;
|
use Tabuna\Breadcrumbs\Trail;
|
||||||
|
|
||||||
// Licenses
|
// Licenses
|
||||||
|
@ -13,18 +14,24 @@ Route::group(['prefix' => 'licenses', 'middleware' => ['auth']], function () {
|
||||||
[Licenses\LicensesController::class, 'getFreeLicense']
|
[Licenses\LicensesController::class, 'getFreeLicense']
|
||||||
)->name('licenses.freecheckout');
|
)->name('licenses.freecheckout');
|
||||||
|
|
||||||
Route::get('{license}/checkout/{seatId?}',
|
Route::get('{license}/checkout/{seatId?}', [Licenses\LicenseCheckoutController::class, 'create'])
|
||||||
[Licenses\LicenseCheckoutController::class, 'create']
|
->name('licenses.checkout')
|
||||||
)->name('licenses.checkout');
|
->breadcrumbs(fn (Trail $trail, License $license) =>
|
||||||
|
$trail->parent('licenses.show', $license)
|
||||||
|
->push(trans('general.checkout'), route('licenses.checkout', $license))
|
||||||
|
);
|
||||||
|
|
||||||
Route::post(
|
Route::post(
|
||||||
'{licenseId}/checkout/{seatId?}',
|
'{licenseId}/checkout/{seatId?}',
|
||||||
[Licenses\LicenseCheckoutController::class, 'store']
|
[Licenses\LicenseCheckoutController::class, 'store']
|
||||||
); //name() would duplicate here, so we skip it.
|
); //name() would duplicate here, so we skip it.
|
||||||
|
|
||||||
Route::get('{licenseSeat}/checkin/{backto?}',
|
Route::get('{licenseSeat}/checkin/{backto?}', [Licenses\LicenseCheckinController::class, 'create'])
|
||||||
[Licenses\LicenseCheckinController::class, 'create']
|
->name('licenses.checkin')
|
||||||
)->name('licenses.checkin');
|
->breadcrumbs(fn (Trail $trail, LicenseSeat $licenseSeat) =>
|
||||||
|
$trail->parent('licenses.show', $licenseSeat->license)
|
||||||
|
->push(trans('general.checkin'), route('licenses.checkin', $licenseSeat))
|
||||||
|
);
|
||||||
|
|
||||||
Route::post('{licenseId}/checkin/{backto?}',
|
Route::post('{licenseId}/checkin/{backto?}',
|
||||||
[Licenses\LicenseCheckinController::class, 'store']
|
[Licenses\LicenseCheckinController::class, 'store']
|
||||||
|
|
Loading…
Add table
Reference in a new issue