First commit
This commit is contained in:
64
app/Models/CurrentContracts.php
Normal file
64
app/Models/CurrentContracts.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use App\Models\Categories;
|
||||
use App\Models\Suppliers;
|
||||
use App\Models\Coupon;
|
||||
use App\Models\Status;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use TarfinLabs\LaravelSpatial\Casts\LocationCast;
|
||||
use TarfinLabs\LaravelSpatial\Traits\HasSpatial;
|
||||
|
||||
class CurrentContracts extends Model
|
||||
{
|
||||
//
|
||||
use HasSpatial;
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'supplier_id',
|
||||
'category_id',
|
||||
'address',
|
||||
'int_number',
|
||||
'references',
|
||||
'appointment',
|
||||
'amount',
|
||||
'details',
|
||||
'code',
|
||||
'coupon_id',
|
||||
'transaction_id',
|
||||
'status_id',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'location' => LocationCast::class
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function categories()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Categories', 'category_id');
|
||||
}
|
||||
|
||||
public function suppliers()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Suppliers', 'supplier_id');
|
||||
}
|
||||
|
||||
public function coupon()
|
||||
{
|
||||
return $this->belongsTo(Coupon::class);
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->belongsTo(Status::class);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user