Clean up User model
MODIFY
app/User.php
app/User.php
@@ -5,46 +5,42 @@ namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
+use App\Earning;
+use App\Spending;
+use App\Tag;
+use App\Budget;
+use App\Currency;
+
class User extends Authenticatable {
use Notifiable;
public $timestamps = false;
- /**
- * The attributes that are mass assignable.
- *
- * @var array
- */
protected $fillable = [
'name', 'email', 'password',
];
- /**
- * The attributes that should be hidden for arrays.
- *
- * @var array
- */
protected $hidden = [
'password', 'remember_token',
];
public function earnings() {
- return $this->hasMany('App\Earning');
+ return $this->hasMany(Earning::class);
}
public function spendings() {
- return $this->hasMany('App\Spending');
+ return $this->hasMany(Spending::class);
}
public function tags() {
- return $this->hasMany('App\Tag');
+ return $this->hasMany(Tag::class);
}
public function budgets() {
- return $this->hasMany('App\Budget');
+ return $this->hasMany(Budget::class);
}
public function currency() {
- return $this->belongsTo('App\Currency');
+ return $this->belongsTo(Currency::class);
}
}

Clean up User model