paginate(20); } public function getUnitById($UnitId) { return Unit::findOrFail($UnitId); } public function getUnitByEmail($email) { return Unit::where('email', $email)->first(); } public function delete($UnitId) { Unit::destroy($UnitId); } public function create($UnitDetails) { return Unit::create($UnitDetails); } public function update($UnitId, array $newDetails) { return Unit::whereId($UnitId)->update($newDetails); } public function pluck() { return Unit::pluck('title', 'id'); } }