Solution for "where not has laravel"

use Illuminate\Database\Eloquent\Builder; // Retrieve posts with at least one comment containing words like foo%... $posts = App\Post::whereHas('comments', function (Builder $query) { $query->where('content', 'like', 'foo%'); })->get(); // Retrieve posts with at least ten comments containing words like foo%... $posts = App\Post::whereHas('comments', function (Builder $query) { $query->where('content', 'like', 'foo%'); }, '>=', 10)->get();

laravel where has

$roles = App\User::find(1)->roles()->orderBy('name')->get();

eloquent relationships

Similar codes for "where not has laravel"


Latest 'PHP' questions

Added before "where not has laravel"