for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use jeremykenedy\LaravelRoles\Traits\HasRoleAndPermission;
class User extends Authenticatable
{
use HasRoleAndPermission;
jeremykenedy\LaravelRole...ts\HasRoleAndPermission
App\Models\User
$model
$slug
$level
use Notifiable;
Illuminate\Notifications\Notifiable
$email
$phone_number
use SoftDeletes;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';
* The attributes that are not mass assignable.
* @var array
protected $guarded = ['id'];
* The attributes that are mass assignable.
protected $fillable = [
'name',
'email',
'password',
];
* The attributes that should be hidden for arrays.
protected $hidden = [
'remember_token',
* Typecasted dates.
protected $dates = [
'created_at',
'updated_at',
'deleted_at',
* The attributes that should be cast to native types.
protected $casts = [
'name' => 'string',
'email' => 'string',
'email_verified_at' => 'datetime',
'password' => 'string',
* Scope a query the user names.
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
public function scopeUserNames($query)
return $query->select('name')
return $query->select('n...>orderBy('name', 'asc')
Illuminate\Database\Query\Builder
Illuminate\Database\Eloquent\Builder
->distinct()
->orderBy('name', 'asc');
}