2017-01-30 21:40:43 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Requests;
|
2016-05-01 15:04:55 +03:00
|
|
|
|
2017-01-30 18:05:31 +02:00
|
|
|
class VendorRequest extends EntityRequest
|
|
|
|
|
{
|
2016-05-01 15:04:55 +03:00
|
|
|
protected $entityType = ENTITY_VENDOR;
|
|
|
|
|
|
|
|
|
|
public function entity()
|
|
|
|
|
{
|
|
|
|
|
$vendor = parent::entity();
|
|
|
|
|
|
|
|
|
|
// eager load the contacts
|
2016-05-05 10:15:51 +03:00
|
|
|
if ($vendor && ! $vendor->relationLoaded('vendor_contacts')) {
|
2016-05-04 15:16:49 +03:00
|
|
|
$vendor->load('vendor_contacts');
|
2016-05-01 15:04:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $vendor;
|
|
|
|
|
}
|
2017-01-30 18:05:31 +02:00
|
|
|
}
|