snipe-it/routes/web/licenses.php
Daniel Meltzer a6f90cb3fc
Assorted licenses UI fixes while testing.
* Rename licenses route checkin parameter to clarify it's purpose and
fix incorrect route in users view page.
* Checkin note can be nullable for checking in a license.
* License Seat view was only showing 20 license seats due to faulty
transformer logic.
2020-05-12 14:38:21 -04:00

49 lines
1.5 KiB
PHP

<?php
# Licenses
Route::group([ 'prefix' => 'licenses', 'middleware' => ['auth'] ], function () {
Route::get('{licenseId}/clone', [ 'as' => 'clone/license', 'uses' => 'Licenses\LicensesController@getClone' ]);
Route::get('{licenseId}/freecheckout', [
'as' => 'licenses.freecheckout',
'uses' => 'Licenses\LicensesController@getFreeLicense'
]);
Route::get('{licenseId}/checkout/{seatId?}', [
'as' => 'licenses.checkout',
'uses' => 'Licenses\LicenseCheckoutController@create'
]);
Route::post(
'{licenseId}/checkout/{seatId?}',
[ 'as' => 'licenses.checkout', 'uses' => 'Licenses\LicenseCheckoutController@store' ]
);
Route::get('{licenseSeatId}/checkin/{backto?}', [
'as' => 'licenses.checkin',
'uses' => 'Licenses\LicenseCheckinController@create'
]);
Route::post('{licenseId}/checkin/{backto?}', [
'as' => 'licenses.checkin.save',
'uses' => 'Licenses\LicenseCheckinController@store'
]);
Route::post(
'{licenseId}/upload',
[ 'as' => 'upload/license', 'uses' => 'Licenses\LicenseFilesController@store' ]
);
Route::delete(
'{licenseId}/deletefile/{fileId}',
[ 'as' => 'delete/licensefile', 'uses' => 'Licenses\LicenseFilesController@destroy' ]
);
Route::get(
'{licenseId}/showfile/{fileId}/{download?}',
[ 'as' => 'show.licensefile', 'uses' => 'Licenses\LicenseFilesController@show' ]
);
});
Route::resource('licenses', 'Licenses\LicensesController', [
'middleware' => ['auth'],
'parameters' => ['license' => 'license_id']
]);