aboutsummaryrefslogtreecommitdiff
path: root/app/Models
diff options
context:
space:
mode:
Diffstat (limited to 'app/Models')
-rw-r--r--app/Models/Currency.php14
-rw-r--r--app/Models/Rates.php23
2 files changed, 37 insertions, 0 deletions
diff --git a/app/Models/Currency.php b/app/Models/Currency.php
new file mode 100644
index 0000000..f64bf15
--- /dev/null
+++ b/app/Models/Currency.php
@@ -0,0 +1,14 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Currency extends Model
+{
+ protected $connection = 'sqlite';
+ protected $table = 'currency';
+ protected $fillable = [
+ 'name', 'unit', 'description'
+];
+};
diff --git a/app/Models/Rates.php b/app/Models/Rates.php
new file mode 100644
index 0000000..5cabf1e
--- /dev/null
+++ b/app/Models/Rates.php
@@ -0,0 +1,23 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Rates extends Model
+{
+ protected $connection = 'sqlite';
+
+ protected $fillable = [
+ 'currency', 'relative', 'value'
+ ];
+
+ public function currency()
+ {
+ return $this->belongsTo(Currency::class, 'currency_id');
+ }
+ public function relative()
+ {
+ return $this->belongsTo(Currency::class, 'relative_id');
+ }
+}