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);
|
||||
}
|
||||
}
|
||||
42
app/Models/CountryLocale.php
Normal file
42
app/Models/CountryLocale.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class CountryLocale
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $slug
|
||||
* @property string $i18n
|
||||
* @property bool $enabled
|
||||
* @property string|null $deleted_at
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class CountryLocale extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $table = 'country_locales';
|
||||
|
||||
protected $casts = [
|
||||
'enabled' => 'bool'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'slug',
|
||||
'i18n',
|
||||
'enabled'
|
||||
];
|
||||
}
|
||||
45
app/Models/User.php
Normal file
45
app/Models/User.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens, HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user