July 2018
Intermediate to advanced
420 pages
8h 46m
English
The one-to-many relationship will be applied between Bike and Items, which means that one bike will have many custom items.
Still in the project/app/Bike.app file, let's add the one-to-many relationship between the Item and Bike models.
Add the following code immediately after the builder() function:
public function items() { return $this->hasMany('App\Item');}
Read now
Unlock full access