Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel search function

$users = User::has('posts')->withCount('posts')->orderBy('posts_count')->take(50)->get();

$userIndex = $users->search(function($user) {
    return $user->id === Auth::id();
});
 
PREVIOUS NEXT
Tagged: #laravel #search #function
ADD COMMENT
Topic
Name
3+5 =