first commit
This commit is contained in:
53
app/Models/Postulations.php
Normal file
53
app/Models/Postulations.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?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 Grimzy\LaravelMysqlSpatial\Eloquent\SpatialTrait;
|
||||
|
||||
class Postulations extends Model
|
||||
{
|
||||
//
|
||||
use SpatialTrait;
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'category_id',
|
||||
'address',
|
||||
'int_number',
|
||||
'references',
|
||||
'appointment',
|
||||
'amount',
|
||||
'details',
|
||||
'status_id',
|
||||
];
|
||||
|
||||
protected $spatialFields = [
|
||||
'location',
|
||||
];
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user