HEX
Server: LiteSpeed
System: Linux s1296.sgp1.mysecurecloudhost.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: bishwesh (1878)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/bishwesh/internstolearn.com/app/User.php
<?php

namespace App;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

use App\Models\Profile;
use App\Models\Internship;

class User extends \TCG\Voyager\Models\User implements MustVerifyEmail
{
    use Notifiable;
    protected $primaryKey = 'id';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password', 'user_type'
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];

    //user has one profile
    public function profile()
    {
        return $this->hasOne(Profile::class);
    }

    /**
     * Many to many relationship with internships
     */
    public function internships()
    {
        return $this->belongsToMany(Internship::class);
    }

    /**
     * Many to many relationshipt with events
     */
    public function events()
    {
        return $this->belongsToMany('App\Models\Event');
    }

    //user has one profile
    public function company()
    {
        return $this->hasOne(Models\Company::class);
    }
}