Add models and migrations for Anggota, Buku, Kategori, and Peminjaman

This commit is contained in:
2026-03-17 19:16:26 +07:00
parent 1aff175819
commit e8e28349fc
8 changed files with 242 additions and 0 deletions

30
app/Models/Anggota.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Anggota extends Model
{
use HasFactory, SoftDeletes;
protected $fillable = [
'nama',
'email',
'no_telepon',
'alamat',
'tanggal_bergabung',
'status',
];
protected $casts = [
'tanggal_bergabung' => 'date',
];
public function peminjamans()
{
return $this->hasMany(Peminjaman::class);
}
}