for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Carbon\Carbon;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
Illuminate\Notifications\Notifiable
App\User
$email
$phone_number
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'biography', 'profile_picture', 'email', 'password', 'provider', 'provider_id'
];
* The attributes that should be hidden for arrays.
protected $hidden = [
'password', 'remember_token',
* The attributes that should be cast to native types.
protected $casts = [
'email_verified_at' => 'datetime',
protected $dates = [
'created_at',
'updated_at'
public function thread() {
return $this->hasMany('App\Thread', 'user_id');
}
* @param string $str
public function trimStr(string $str)
if(strlen($str) > 50) {
return substr($str, '0', '50')."...";
return $str;