Hmm....I can't really see anything except maybe calling paginate(25)
at the end instead of repeating it by building upon a single query:
public function index($label = 'false')
{
$search = Input::get('search');
$query = Appointment::query();
if(Input::has('search')) {
$query->where('appointment', 'LIKE', '%'. $search .'%');
} elseif($label !== 'false') {
$query->orderBy($order, $sort)->where('label', '=', $label);
}
$appointments = $query->paginate(25);
return view('appointments.index', compact('appointments', 'search', 'label'));
}
Awesome, thanks for your reply once again, I didn't know this either yet :)
Edit: And I see I am using two accounts on here.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community