Add getFreeLicense

Picks free seat for license and redirects to checkout specific seat
This commit is contained in:
madd15
2015-07-07 12:30:55 +09:30
parent 1edce0a4fa
commit f363e742e6
@@ -908,4 +908,14 @@ class LicensesController extends AdminController
->orderColumns('name','serial','totalSeats','remaining','purchase_date','actions')
->make();
}
public function getFreeLicense($licenseId) {
// Check if the asset exists
if (is_null($license = License::find($licenseId))) {
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
$seatId = $license->freeSeat($licenseId);
return Redirect::to('admin/licenses/'.$seatId.'/checkout');
}
}