Example #1
0
 /**
  * Get the number of assigned seats
  *
  */
 public function assignedcount()
 {
     return \App\Models\LicenseSeat::where('license_id', '=', $this->id)->where(function ($query) {
         $query->whereNotNull('assigned_to')->orWhereNotNull('asset_id');
     })->count();
 }
Example #2
0
 public function freeSeat()
 {
     $seat = LicenseSeat::where('license_id', '=', $this->id)->whereNull('deleted_at')->whereNull('assigned_to')->whereNull('asset_id')->first();
     return $seat->id;
 }