48 lines
		
	
	
		
			743 B
		
	
	
	
		
			PHP
		
	
	
	
		
		
			
		
	
	
			48 lines
		
	
	
		
			743 B
		
	
	
	
		
			PHP
		
	
	
	
|  | <?php | ||
|  | 
 | ||
|  | /** | ||
|  |  * Created by Reliese Model. | ||
|  |  */ | ||
|  | 
 | ||
|  | namespace App\Models; | ||
|  | 
 | ||
|  | use Illuminate\Database\Eloquent\Collection; | ||
|  | use Illuminate\Database\Eloquent\Model; | ||
|  | 
 | ||
|  | /** | ||
|  |  * Class Currency | ||
|  |  *  | ||
|  |  * @property int $id | ||
|  |  * @property string $code | ||
|  |  * @property int $numeric | ||
|  |  * @property string $symbol | ||
|  |  * @property string $name_en | ||
|  |  * @property string $name_fr | ||
|  |  *  | ||
|  |  * @property Collection|Country[] $countries | ||
|  |  * | ||
|  |  * @package App\Models | ||
|  |  */ | ||
|  | class Currency extends Model | ||
|  | { | ||
|  | 	protected $table = 'currencies'; | ||
|  | 	public $timestamps = false; | ||
|  | 
 | ||
|  | 	protected $casts = [ | ||
|  | 		'numeric' => 'int' | ||
|  | 	]; | ||
|  | 
 | ||
|  | 	protected $fillable = [ | ||
|  | 		'code', | ||
|  | 		'numeric', | ||
|  | 		'symbol', | ||
|  | 		'name_en', | ||
|  | 		'name_fr' | ||
|  | 	]; | ||
|  | 
 | ||
|  | 	public function countries() | ||
|  | 	{ | ||
|  | 		return $this->hasMany(Country::class, 'idCurrency'); | ||
|  | 	} | ||
|  | } |