118 lines
2.6 KiB
PHP
118 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Prunable;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Language extends Model
|
|
{
|
|
use HasFactory;
|
|
use Prunable;
|
|
use SoftDeletes;
|
|
|
|
/** @var string */
|
|
protected $table = 'languages';
|
|
|
|
/** @var array<int,string> */
|
|
protected $fillable = [
|
|
'locale_name',
|
|
'iso_code',
|
|
'name',
|
|
'localized_name',
|
|
];
|
|
|
|
/**
|
|
|--------------------------------------------------------------------------
|
|
| Class Constants
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
//
|
|
|
|
/**
|
|
|--------------------------------------------------------------------------
|
|
| Custom/Private Methods
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
/**
|
|
* Get the prunable model query.
|
|
*
|
|
* @package App\Models\Language
|
|
* @since 1.0.0
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Builder
|
|
*/
|
|
public function prunable(): Builder
|
|
{
|
|
//return static::where('deleted_at', '<=', now()->subMonth());
|
|
}
|
|
|
|
/**
|
|
* Prepare the model for pruning.
|
|
*
|
|
* @package App\Models\Language
|
|
* @since 1.0.0
|
|
*
|
|
* @return void
|
|
*/
|
|
protected function pruning(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
|--------------------------------------------------------------------------
|
|
| Accessors
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
//
|
|
|
|
/**
|
|
|--------------------------------------------------------------------------
|
|
| Mutators
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
//
|
|
|
|
/**
|
|
|--------------------------------------------------------------------------
|
|
| Scopes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
//
|
|
|
|
/**
|
|
|--------------------------------------------------------------------------
|
|
| Relationships
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
/**
|
|
* User relationship.
|
|
*
|
|
* @package App\Models\Language
|
|
* @since 1.0.0
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
*/
|
|
public function users(): HasMany
|
|
{
|
|
return $this->hasMany(User::class);
|
|
}
|
|
}
|