Answers for "laravel find relation by id"

PHP
0

laravel relations find

/**
 * Get the user's largest order.
 */
public function largestOrder()
{
    return $this->hasOne(Order::class)->ofMany('price', 'max');
}
Posted by: Guest on June-10-2021
0

laravel relations find

/**
 * Get the user's oldest order.
 */
public function oldestOrder()
{
    return $this->hasOne(Order::class)->oldestOfMany();
}
Posted by: Guest on June-10-2021

Browse Popular Code Answers by Language