%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/apache/htdocs/app/Models/
Upload File :
Create Path :
Current File : //usr/local/apache/htdocs/app/Models/Facture.php

<?php

namespace App\Models;

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

class Facture extends Model
{
    use HasFactory;
    
    protected $fillable = [
        'num_facture',
        'type',
        'date',
        'taux_id',
        'client_id',
    ];

    public function taux(){
        return $this->hasOne(Taux::class);
    }

    public function user() {
        return $this->hasOne(User::class, 'id' , 'client_id');
    }

    public function commande() { 
        return $this->hasOne(Commande::class, 'facture_id', 'id');
    }

    public function products() {
        return $this->hasMany(Product::class, 'facture_id', 'id')->whereNotIn('parent_id', [0]);
    }
}

Zerion Mini Shell 1.0