Answers for "laravel get with relations"

PHP
0

laravel relations find

/**
 * Get the current pricing for the product.
 */
public function currentPricing()
{
    return $this->hasOne(Price::class)->ofMany([
        'published_at' => 'max',
        'id' => 'max',
    ], function ($query) {
        $query->where('published_at', '<', now());
    });
}
Posted by: Guest on June-10-2021

Code answers related to "laravel get with relations"

Browse Popular Code Answers by Language