Add models and migrations for Anggota, Buku, Kategori, and Peminjaman
This commit is contained in:
30
app/Models/Anggota.php
Normal file
30
app/Models/Anggota.php
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user