Skip to content

Instantly share code, notes, and snippets.

@MaheKarim
Created September 16, 2019 17:22
Show Gist options
  • Save MaheKarim/13bc5329e1a0c7be166baab2c2898be1 to your computer and use it in GitHub Desktop.
Save MaheKarim/13bc5329e1a0c7be166baab2c2898be1 to your computer and use it in GitHub Desktop.
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Support\Facades\Hash;
class User extends Authenticatable implements MustVerifyEmail
{
use Notifiable;
protected $fillable = [
'name', 'email', 'password', 'phn_number', 'user_role',
];
protected $hidden = [
'password', 'remember_token',
];
protected $casts = [
'email_verified_at' => 'datetime',
];
public function setPasswordAttribute($password)
{
$this->attributes['password'] = bcrypt($password);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment