Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Menu model
- public function products(){
- return $this->belongsToMany('Product');
- }
- public static function getMenuWithProducts($month, $year){
- return self::
- where('month', '=', $month)
- ->where('year', '=', $year)
- ->with('products')
- ->get();
- }
- public static function getMenuWithProducts($month, $year){
- return self::
- where('month', '=', $month)
- ->where('year', '=', $year)
- ->with('products')
- ->with('producer')
- ->get();
- }
- BadMethodCallException
- Call to undefined method IlluminateDatabaseQueryBuilder::producer()
- public function products(){
- return $this->belongsToMany('Product');
- }
- public function producer()
- {
- return $this->belongsTo('Producer');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement