mirror of
https://github.com/rekywhyd/WebGIS_PengentasanKemiskinan.git
synced 2026-07-10 19:33:07 +00:00
Memperbarui UI/UX
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LaporanWarga extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'nama_calon',
|
||||
'jumlah_tanggungan',
|
||||
'alamat',
|
||||
'deskripsi',
|
||||
'foto',
|
||||
'status_laporan',
|
||||
'id_tempat_ibadah',
|
||||
];
|
||||
|
||||
public function tempat_ibadah()
|
||||
{
|
||||
return $this->belongsTo(TempatIbadah::class, 'id_tempat_ibadah');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LogDistribusi extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'log_distribusi';
|
||||
|
||||
protected $fillable = [
|
||||
'id_penerima',
|
||||
'tanggal_diterima',
|
||||
'status',
|
||||
'foto_penyerahan',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'tanggal_diterima' => 'datetime',
|
||||
];
|
||||
|
||||
public function penerimaBantuan()
|
||||
{
|
||||
return $this->belongsTo(PenerimaBantuan::class, 'id_penerima');
|
||||
}
|
||||
}
|
||||
@@ -17,14 +17,30 @@ class PenerimaBantuan extends Model
|
||||
'nomor_kk',
|
||||
'nama_kepala_keluarga',
|
||||
'jumlah_tanggungan',
|
||||
'foto_kondisi_rumah',
|
||||
'foto',
|
||||
'lat',
|
||||
'lng',
|
||||
'alamat'
|
||||
'alamat',
|
||||
'jarak_ke_penyalur',
|
||||
'dokumen_laporan',
|
||||
'status_persetujuan',
|
||||
'alasan_penolakan',
|
||||
'tanggal_pencairan_terakhir',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'tanggal_pencairan_terakhir' => 'datetime',
|
||||
];
|
||||
|
||||
public function tempat_ibadah()
|
||||
{
|
||||
return $this->belongsTo(TempatIbadah::class, 'id_tempat_ibadah');
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function logDistribusi()
|
||||
{
|
||||
return $this->hasMany(LogDistribusi::class, 'id_penerima');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,15 +14,32 @@ class TempatIbadah extends Model
|
||||
protected $fillable = [
|
||||
'nama_tempat',
|
||||
'jenis_tempat_ibadah',
|
||||
'kontak_person',
|
||||
'nama_pengurus',
|
||||
'kontak_pengurus',
|
||||
'radius_meter',
|
||||
'lat',
|
||||
'lng',
|
||||
'alamat'
|
||||
'alamat',
|
||||
'password',
|
||||
'kode_lapor',
|
||||
];
|
||||
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($tempatIbadah) {
|
||||
if (empty($tempatIbadah->kode_lapor)) {
|
||||
$tempatIbadah->kode_lapor = \Illuminate\Support\Str::random(10);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function penerima_bantuan()
|
||||
{
|
||||
return $this->hasMany(PenerimaBantuan::class, 'id_tempat_ibadah');
|
||||
}
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany(User::class, 'id_tempat_ibadah');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,14 @@ class User extends Authenticatable
|
||||
'email',
|
||||
'password',
|
||||
'role',
|
||||
'id_tempat_ibadah',
|
||||
];
|
||||
|
||||
public function tempatIbadah()
|
||||
{
|
||||
return $this->belongsTo(TempatIbadah::class, 'id_tempat_ibadah');
|
||||
}
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user