63 lines
1.8 KiB
PHP
63 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Backpack\CRUD\CrudTrait;
|
|
|
|
class Folder extends Model
|
|
{
|
|
use CrudTrait;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| GLOBAL VARIABLES
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
|
|
protected $table = 'folders';
|
|
// protected $primaryKey = 'id';
|
|
public $timestamps = false;
|
|
// protected $guarded = ['id'];
|
|
protected $fillable = ['title','description','property_id','folder_table','total_price','choice_time','on_tv','on_radio','on_subtitle','on_web'];
|
|
// protected $hidden = [];
|
|
// protected $dates = [];
|
|
//json to array;
|
|
protected $casts = [
|
|
'folder_table'=>'array'
|
|
];
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| FUNCTIONS
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| RELATIONS
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
|
|
public function property(){
|
|
return $this->belongsTo('App\Models\PropertyType','property_id');
|
|
}
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| SCOPES
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| ACCESORS
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| MUTATORS
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
}
|