first commit
This commit is contained in:
64
app/Models/Category.php
Normal file
64
app/Models/Category.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class Category
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $country_locale_id
|
||||
* @property string|null $name
|
||||
* @property string $short_name
|
||||
* @property string|null $slug
|
||||
* @property bool $enabled
|
||||
* @property bool $is_top
|
||||
* @property int $_lft
|
||||
* @property int $_rgt
|
||||
* @property int|null $parent_id
|
||||
* @property string|null $deleted_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @property CountryLocale $country_locale
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Category extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $table = 'categories';
|
||||
|
||||
protected $casts = [
|
||||
'country_locale_id' => 'int',
|
||||
'enabled' => 'bool',
|
||||
'is_top' => 'bool',
|
||||
'_lft' => 'int',
|
||||
'_rgt' => 'int',
|
||||
'parent_id' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'country_locale_id',
|
||||
'name',
|
||||
'short_name',
|
||||
'slug',
|
||||
'enabled',
|
||||
'is_top',
|
||||
'_lft',
|
||||
'_rgt',
|
||||
'parent_id'
|
||||
];
|
||||
|
||||
public function country_locale()
|
||||
{
|
||||
return $this->belongsTo(CountryLocale::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user