Answers for "laravel not has"

PHP
3

laravel where has

use IlluminateDatabaseEloquentBuilder;

// Retrieve posts with at least one comment containing words like foo%...
$posts = AppPost::whereHas('comments', function (Builder $query) {
    $query->where('content', 'like', 'foo%');
})->get();

// Retrieve posts with at least ten comments containing words like foo%...
$posts = AppPost::whereHas('comments', function (Builder $query) {
    $query->where('content', 'like', 'foo%');
}, '>=', 10)->get();
Posted by: Guest on May-07-2020

Browse Popular Code Answers by Language