55 lines
1011 B
PHP
55 lines
1011 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\User;
|
|
use App\Models\Categories;
|
|
use App\Models\Suppliers;
|
|
use App\Models\Status;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use TarfinLabs\LaravelSpatial\Casts\LocationCast;
|
|
use TarfinLabs\LaravelSpatial\Traits\HasSpatial;
|
|
|
|
class Postulations extends Model
|
|
{
|
|
//
|
|
use HasSpatial;
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'category_id',
|
|
'address',
|
|
'int_number',
|
|
'references',
|
|
'appointment',
|
|
'amount',
|
|
'details',
|
|
'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->hasMany(Suppliers::class);
|
|
}
|
|
|
|
public function status()
|
|
{
|
|
return $this->belongsTo(Status::class);
|
|
}
|
|
}
|