Memperbarui UI/UX

This commit is contained in:
2026-06-07 23:32:06 +07:00
parent f7479770e6
commit 76a8782409
47 changed files with 4378 additions and 685 deletions
+26
View File
@@ -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');
}
}
+29
View File
@@ -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');
}
}
+18 -2
View File
@@ -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');
}
}
+19 -2
View File
@@ -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');
}
}
+6
View File
@@ -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.
*