Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function index(Request $req)
- {
- if ($req->has('search') && !empty($req->search)) {
- $validated = $req->validate([
- 'search' => 'alpha',
- ]);
- $auteurs = Auteur::where('nom', 'LIKE', '%' . $validated['search'] . '%')->paginate(5);
- $auteurs->appends($req->only('search'));
- return view('admin.auteurs.index', compact('auteurs'));
- }
- $auteurs = Auteur::paginate(5);
- return view('admin.auteurs.index', compact('auteurs'));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement