mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-31 05:31:10 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			460 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			460 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace Crater;
 | |
| 
 | |
| use Illuminate\Database\Eloquent\Model;
 | |
| 
 | |
| class PaymentMethod extends Model
 | |
| {
 | |
|     protected $fillable = ['name', 'company_id'];
 | |
| 
 | |
|     public function payments()
 | |
|     {
 | |
|         return $this->hasMany(Payment::class);
 | |
|     }
 | |
| 
 | |
|     public function company()
 | |
|     {
 | |
|         return $this->belongsTo(Company::class);
 | |
|     }
 | |
| 
 | |
|     public function scopeWhereCompany($query, $company_id)
 | |
|     {
 | |
|         $query->where('company_id', $company_id);
 | |
|     }
 | |
| }
 |