diff --git a/app/Http/Controllers/Licenses/LicenseCheckinController.php b/app/Http/Controllers/Licenses/LicenseCheckinController.php index 373a167642..4197cf771e 100644 --- a/app/Http/Controllers/Licenses/LicenseCheckinController.php +++ b/app/Http/Controllers/Licenses/LicenseCheckinController.php @@ -28,16 +28,11 @@ class LicenseCheckinController extends Controller * @return \Illuminate\Contracts\View\View * @throws \Illuminate\Auth\Access\AuthorizationException */ - public function create($seatId = null, $backTo = null) + public function create(LicenseSeat $licenseSeat, $backTo = null) { // Check if the asset exists - if (is_null($licenseSeat = LicenseSeat::find($seatId)) || is_null($license = License::find($licenseSeat->license_id))) { - // Redirect to the asset management page with error - return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.not_found')); - } - + $license = License::find($licenseSeat->license_id); $this->authorize('checkout', $license); - return view('licenses/checkin', compact('licenseSeat'))->with('backto', $backTo); }