Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel where condition on relationship

AppRequest::where('id',4)
    ->whereHas('quotes', function ($query) {
        $query->where('status','=','3');
    })
    ->with('quotes','sourceTable','destinationTable')
    ->get(); 
Source by laracasts.com #
 
PREVIOUS NEXT
Tagged: #laravel #condition #relationship
ADD COMMENT
Topic
Name
5+2 =