laravel latest from relationship code example
Example: laravel latest from relationship
/**
* Get the user's most recent image.
*/
public function latestImage()
{
return $this->morphOne(Image::class)->latestOfMany();
}
/**
* Get the user's most recent image.
*/
public function latestImage()
{
return $this->morphOne(Image::class)->latestOfMany();
}