41 lines
848 B
PHP
41 lines
848 B
PHP
<?php
|
|
|
|
namespace Modules\Admin\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Casts\Attribute;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Modules\Admin\Database\factories\DistrictFactory;
|
|
|
|
class District extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = "tbl_districts";
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*/
|
|
protected $fillable = [
|
|
'name',
|
|
'province_id',
|
|
'status',
|
|
'description',
|
|
'remarks',
|
|
'createdBy',
|
|
'updatedBy',
|
|
];
|
|
|
|
protected function province(){
|
|
return $this->belongsTo(Province::class,'province_id');
|
|
}
|
|
|
|
// protected function name(): Attribute
|
|
// {
|
|
// return Attribute::make(
|
|
// get: fn($value) => strtolower($value),
|
|
// );
|
|
// }
|
|
|
|
}
|