mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-31 13:41:09 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			552 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			552 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| namespace Laraspace;
 | |
| 
 | |
| use Illuminate\Database\Eloquent\Model;
 | |
| use Laraspace\Tax;
 | |
| 
 | |
| class TaxType extends Model
 | |
| {
 | |
|     protected $fillable = [
 | |
|         'name',
 | |
|         'percent',
 | |
|         'company_id',
 | |
|         'compound_tax',
 | |
|         'collective_tax',
 | |
|         'description'
 | |
|     ];
 | |
| 
 | |
|     protected $casts = [
 | |
|         'percent' => 'float'
 | |
|     ];
 | |
| 
 | |
|     public function taxes()
 | |
|     {
 | |
|         return $this->hasMany(Tax::class);
 | |
|     }
 | |
| 
 | |
|     public function scopeWhereCompany($query, $company_id)
 | |
|     {
 | |
|         $query->where('company_id', $company_id);
 | |
|     }
 | |
| }
 |