Using morphTo() on services, added Ezypay payment Import
This commit is contained in:
24
app/Models/Base/ServiceType.php
Normal file
24
app/Models/Base/ServiceType.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Base;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
use App\Traits\NextKey;
|
||||
|
||||
abstract class ServiceType extends Model
|
||||
{
|
||||
use NextKey;
|
||||
|
||||
public $timestamps = FALSE;
|
||||
public $dateFormat = 'U';
|
||||
|
||||
/**
|
||||
* @NOTE: The service_id column could be discarded, if the id column=service_id
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphOne
|
||||
*/
|
||||
public function service()
|
||||
{
|
||||
return $this->morphOne(Service::class,'type','model','id');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user