Update Master Data
This commit is contained in:
+1
-18
@@ -10,35 +10,18 @@ use Laravel\Sanctum\HasApiTokens;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||
use HasFactory, Notifiable, HasApiTokens;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
'email_verified_at',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\wilayah;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DesaKelurahan extends Model
|
||||
{
|
||||
protected $table = 'master_desa_kelurahan';
|
||||
|
||||
protected $fillable = [
|
||||
'kode_desa_kelurahan',
|
||||
'nama_desa_kelurahan',
|
||||
'path',
|
||||
'kecamatan_id',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Wilayah;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class KabupatenKota extends Model
|
||||
{
|
||||
protected $table = 'master_kabupaten_kota';
|
||||
|
||||
protected $fillable = [
|
||||
'kode_kabupaten_kota',
|
||||
'nama_kabupaten_kota',
|
||||
'path',
|
||||
'provinsi_id',
|
||||
];
|
||||
|
||||
public function provinsi()
|
||||
{
|
||||
return $this->belongsTo(Provinsi::class, 'provinsi_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Wilayah;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Kecamatan extends Model
|
||||
{
|
||||
protected $table = 'master_kecamatan';
|
||||
|
||||
protected $fillable = [
|
||||
'kode_kecamatan',
|
||||
'nama_kecamatan',
|
||||
'path',
|
||||
'kabupaten_kota_id',
|
||||
];
|
||||
|
||||
public function kabupatenKota()
|
||||
{
|
||||
return $this->belongsTo(KabupatenKota::class, 'kabupaten_kota_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Wilayah;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Provinsi extends Model
|
||||
{
|
||||
protected $table = 'master_provinsi';
|
||||
|
||||
protected $fillable = [
|
||||
'kode_provinsi',
|
||||
'nama_provinsi',
|
||||
'path',
|
||||
'iso',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user