You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
593 B

<?php
namespace App\Entities\Users;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;
protected $fillable = ['name', 'email', 'password', 'api_token'];
protected $hidden = ['password', 'remember_token', 'api_token'];
public function setPasswordAttribute($value)
{
$this->attributes['password'] = bcrypt($value);
}
public function nameLink()
{
return link_to_route('users.show', $this->name, [$this->id], ['target' => '_blank']);
}
}