<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Currency
 *
 * @property int $id
 * @property string $name
 * @property string $abbr
 * @property \Carbon\Carbon|null $created_at
 * @property \Carbon\Carbon|null $updated_at
 * @property \Carbon\Carbon|null $deleted_at
 * @method static bool|null forceDelete()
 * @method static \Illuminate\Database\Query\Builder|\App\Currency onlyTrashed()
 * @method static bool|null restore()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Currency whereAbbr($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Currency whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Currency whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Currency whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Currency whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Currency whereUpdatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Currency withTrashed()
 * @method static \Illuminate\Database\Query\Builder|\App\Currency withoutTrashed()
 * @mixin \Eloquent
 * @property int $default
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\UserCurrency[] $userCurrencies
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Currency whereDefault($value)
 */
class Currency extends Model
{
    use SoftDeletes;

    protected $fillable = ['name', 'abbr'];

    public function userCurrencies() {
        return $this->hasMany('App\UserCurrency');
    }

    protected $dates = ['deleted_at'];
}
