Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Laravel eloquent tricks

public function author()
{
    return $this->belongsTo(Author::class)->withDefault([
        'name' => 'Someone'
    ]);
}
Source by laravelproject.com #
 
PREVIOUS NEXT
Tagged: #Laravel #eloquent #tricks
ADD COMMENT
Topic
Name
9+1 =