inital commit
This commit is contained in:
49
app/Models/AbrarPlanProject.php
Normal file
49
app/Models/AbrarPlanProject.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AbrarPlanProject extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that should be hidden for arrays.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [
|
||||
'province_id',
|
||||
'city_id',
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'project_type' => 'array',
|
||||
'project_start_latlng' => 'array',
|
||||
'project_end_latlng' => 'array'
|
||||
];
|
||||
|
||||
/**
|
||||
* Get all of the project's files.
|
||||
*/
|
||||
public function files()
|
||||
{
|
||||
return $this->morphMany('App\Models\ProjectFile', 'project_fileable');
|
||||
}
|
||||
|
||||
public function projectHistories()
|
||||
{
|
||||
return $this->hasMany('App\Models\AbrarPlanProjectHistory', 'project_id');
|
||||
}
|
||||
|
||||
public function province()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Province');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user