Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel search multiple tables

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

PREVIOUS NEXT
Code Example
Php :: Create a table with PHP in html 
Php :: php radians to degrees 
Php :: javascript function in php json_encode 
Php :: plesk web config file laravel 
Php :: dispatch job with queue name in laravel 
Php :: laravel auth 
Php :: create a laravel project 
Php :: laravel phpdoc collection of model 
Php :: laravel validation numeric vs integer 
Php :: laravel collection sum 
Php :: Use DateTime() and DateInterval() Objects for PHP 5.3 and Above and Calculate the Difference Between Two Dates Using PHP 
Php :: symfony messenger conf 
Php :: cmd disable wifi driver 
Php :: run laravel seeder 
Php :: wordpress enable post thumbnail 
Php :: laravel modules 
Php :: route() and with() in laravel 
Php :: get id from current url for php 
Php :: drupal 9 custom blocks dependency injection 
Php :: php variable as javascript function parameter in echo 
Php :: replace twig 
Php :: laravel access request in provider 
Php :: array_merge in php 
Php :: laravel if else condition in blade file 
Php :: active page in laravel 
Php :: add custom shortcode in contact form 7 
Php :: php artisan vendor:publish --provider="MaatwebsiteExcelExcelServiceProvider 
Php :: comment split une chaine de caratere en php 
Php :: laravel collection last 
Php :: custom fields wordpress 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =