clean tests & other things

This commit is contained in:
2020-03-25 20:11:29 +01:00
parent 11511039e9
commit 7e5d022aa2
27 changed files with 1497 additions and 187 deletions

52
app/Models/User.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
namespace App;
use App\Models\Memo;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Passport\HasApiTokens;
class User extends Authenticatable
{
use HasApiTokens, Notifiable;
/**
* 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',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
public function isAdmin(): bool
{
return $this->role === 2;
}
public function memos() : HasMany
{
return $this->hasMany(Memo::class);
}
}