add workflow actions for manipulating server_state

This commit is contained in:
Arno Kaimbacher 2019-02-21 14:07:00 +01:00
parent b7b04a61d6
commit c86c9fe9f4
14 changed files with 141 additions and 24 deletions

View file

@ -7,6 +7,7 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
use Zizaco\Entrust\Traits\EntrustUserTrait;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Collection;
use App\Models\Dataset;
class User extends Authenticatable
{
@ -39,12 +40,19 @@ class User extends Authenticatable
*/
protected $hidden = ['password', 'remember_token'];
public function datasets()
{
//model, foreign key on the User model is account_id, local id of user
return $this->hasMany(Dataset::class, 'account_id', 'id');
}
public function setPasswordAttribute($password)
{
if ($password) {
$this->attributes['password'] = app('hash')->needsRehash($password) ? Hash::make($password) : $password;
}
}
public function getAvatarUrl()
{