Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

relationship on the base of condition in laravel

public function videos() {
    $instance =$this->hasMany('Video');
    $instance->getQuery()->where('available','=', 1);
    return $instance
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #relationship #base #condition #laravel
ADD COMMENT
Topic
Name
7+5 =