How do I get the currently logged-in user?
How do I get the currently logged-in user ID in the controller class?

Controllers have a currentUser method:
public function filtrer($firstLetter='', $nbr_ligne='') {
  $current_user_id = $this-&gt;currentUser()-&gt;id();
}