Root Zanli
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
o5t6x7pgljbm
/
public_html
/
app
/
Models
/
Filename :
User.php
back
Copy
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Foundation\Auth\User as Authenticatable; use App\Models\UserSetting; use Illuminate\Database\Eloquent\Casts\Attribute; use Config; class User extends Authenticatable { use SoftDeletes; protected $table = 'users'; protected $primaryKey = 'user_id'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'full_name', 'user_name', 'email', 'mobile', 'profile_pic', 'password', 'coins_for_college_role_id', 'otp', 'facebook_id', 'google_id', 'apple_id', 'api_token', 'device_type', 'device_token', 'is_email_verified', 'active_group_id', 'is_active', 'created_at', 'updated_at', 'deleted_at' ]; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'password', 'deleted_at' ]; protected function profilePic(): Attribute { return Attribute::make( get: fn (string $value) => Config::get('constants.app.api-profile-pic-url').$value, ); } public function setting() { return $this->hasOne('App\Models\UserSetting', 'user_id'); } }