Modified API and created its tests
This commit is contained in:
@@ -9,8 +9,16 @@ class AccessLog extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'siswa_id',
|
||||
];
|
||||
|
||||
protected $with = [ 'siswa' ];
|
||||
|
||||
protected $date = [
|
||||
'created_at', 'updated_at', 'deleted_at',
|
||||
];
|
||||
|
||||
public function siswa()
|
||||
{
|
||||
return $this->belongsTo('App\Siswa');
|
||||
|
||||
@@ -8,4 +8,17 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
class Siswa extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'nama', 'nisn', 'kelas', 'tempat_lahir', 'tanggal_lahir', 'lulus',
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at', 'updated_at', 'deleted_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'tanggal_lahir' => 'datetime:Y-m-d',
|
||||
'lulus' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user