Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel latest from relationship

/**
 * Get the user's most recent image.
 */
public function latestImage()
{
    return $this->morphOne(Image::class)->latestOfMany();
}
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #latest #relationship
ADD COMMENT
Topic
Name
8+9 =