Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel model relationships with two columns match

Compoships adds support for multi-columns relationships in Laravel 5's Eloquent.

https://github.com/topclaudy/compoships

It allows you to specify relationships using the following syntax:

public function b()
{
    return $this->hasMany('B', ['key1', 'key2'], ['key1', 'key2']);
}
where both columns have to match.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #model #relationships #columns #match
ADD COMMENT
Topic
Name
3+3 =