first commit
This commit is contained in:
40
Modules/Admin/app/Models/District.php
Normal file
40
Modules/Admin/app/Models/District.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?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),
|
||||
// );
|
||||
// }
|
||||
|
||||
}
|
Reference in New Issue
Block a user