added soft delete to settings table
This commit is contained in:
@ -76,7 +76,7 @@ class User extends Authenticatable implements HasLocalePreference
|
||||
|
||||
public function companies()
|
||||
{
|
||||
return $this->morphToMany('App\Models\Common\Company', 'user', 'user_companies', 'user_id', 'company_id');
|
||||
return $this->belongsToMany('App\Models\Common\Company', 'App\Models\Auth\UserCompany');
|
||||
}
|
||||
|
||||
public function contact()
|
||||
@ -86,7 +86,7 @@ class User extends Authenticatable implements HasLocalePreference
|
||||
|
||||
public function dashboards()
|
||||
{
|
||||
return $this->morphToMany('App\Models\Common\Dashboard', 'user', 'user_dashboards', 'user_id', 'dashboard_id');
|
||||
return $this->belongsToMany('App\Models\Common\Dashboard', 'App\Models\Auth\UserDashboard');
|
||||
}
|
||||
|
||||
/**
|
||||
|
31
app/Models/Auth/UserCompany.php
Normal file
31
app/Models/Auth/UserCompany.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Auth;
|
||||
|
||||
use App\Abstracts\Model;
|
||||
|
||||
class UserCompany extends Model
|
||||
{
|
||||
protected $table = 'user_companies';
|
||||
|
||||
protected $tenantable = false;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = ['user_id', 'company_id'];
|
||||
|
||||
/**
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Auth\User');
|
||||
}
|
||||
}
|
31
app/Models/Auth/UserDashboard.php
Normal file
31
app/Models/Auth/UserDashboard.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Auth;
|
||||
|
||||
use App\Abstracts\Model;
|
||||
|
||||
class UserDashboard extends Model
|
||||
{
|
||||
protected $table = 'user_dashboards';
|
||||
|
||||
protected $tenantable = false;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = ['user_id', 'company_id'];
|
||||
|
||||
/**
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Auth\User');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user