dimanche 24 février 2019

How to pass parameter in Laravel Relationship Function within blade?

Student model - It has many fees

class student extends Model{
    public function fees($round){
        return $this->hasMany(fee::class)->where('payment_round','=',$round);
    }
}

Fee.blade.php

@foreach($student->fees("parameter") as $fee)
    
@endforeach

How I can pass a parameter to $student->fees("parameter")



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2H0vljl
via IFTTT

Aucun commentaire:

Enregistrer un commentaire