for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace Bantenprov\YankesInfoKamar\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* The InfoKamarModel class.
*
* @package Supriyanih\InfoKamar
* @author supriyanih <[email protected]>
*/
class Kelasrawat extends Model
{
* Table name.
* @var string
use SoftDeletes;
protected $table = 'kelas_rawat_inap';
* The attributes that are mass assignable.
* @var mixed
protected $fillable = ['kode_kelas','nama_kelas'];
* The attributes that should be hidden for arrays.
* @var array
protected $hidden = ['deleted_at'];
protected static function boot()
parent::boot();
static::deleting(function($kelas_rawat_inap) {
foreach ($kelas_rawat_inap->kelas()->get() as $kls) {
$kls->delete();
}
});
public function kelas()
return $this->hasMany('Bantenprov\YankesInfoKamar\Models\Ruangrawat','id');