added sender ID to the clients Tab in Show view plus bug fixes
This commit is contained in:
@@ -4,11 +4,29 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Models;
|
||||
#use Spatie\Activitylog\Traits\LogsActivity;
|
||||
//use Spatie\Activitylog\Traits\CausesActivity;
|
||||
#use Spatie\Activitylog\LogOptions;
|
||||
|
||||
class Client extends Model
|
||||
{
|
||||
#use LogsActivity;
|
||||
|
||||
protected $guarded = array('id');
|
||||
public $table = "clients";
|
||||
protected $appends = ['client_services'];
|
||||
/*
|
||||
protected static $logName = 'clients_log';
|
||||
protected static $logOnlyDirty = true;
|
||||
protected static $dontSubmitEmptyLogs = true;
|
||||
|
||||
|
||||
protected static $logUnguarded = true;
|
||||
public function getActivitylogOptions(): LogOptions{
|
||||
return LogOptions::defaults()
|
||||
->logUnguarded()->useLogName('client')->logOnlyDirty()->dontSubmitEmptyLogs();
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function getprogressIndicatorsAttribute($value){
|
||||
@@ -17,8 +35,8 @@ class Client extends Model
|
||||
$indicator_score = (count($current_indicator_count)/$general_indicators) * 100;
|
||||
return number_format($indicator_score);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function getOnboardingProgressStageAttribute($value){
|
||||
$onboarding_stage = json_decode($value, true);
|
||||
|
||||
@@ -55,8 +73,8 @@ class Client extends Model
|
||||
public function short_code_info(){
|
||||
return $this->hasMany('App\Models\ShortCode', 'client_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function getClientServicesAttribute(){
|
||||
$services = $this->service_info;
|
||||
$service_name_arr = [];
|
||||
@@ -66,5 +84,5 @@ class Client extends Model
|
||||
}
|
||||
return $service_name_arr;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,10 +3,17 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Spatie\Activitylog\Traits\LogsActivity;
|
||||
use Spatie\Activitylog\LogOptions;
|
||||
|
||||
class ClientNote extends Model
|
||||
{
|
||||
protected $guarded = array('id');
|
||||
protected static $logUnguarded = true;
|
||||
|
||||
public function getActivitylogOptions(): LogOptions{
|
||||
return LogOptions::defaults()->logUnguarded();
|
||||
}
|
||||
|
||||
public function client_info(){
|
||||
return $this->hasOne('App\Models\Client', 'id', 'client_id');
|
||||
@@ -14,5 +21,5 @@ class ClientNote extends Model
|
||||
public function created_by_info(){
|
||||
return $this->hasOne('App\Models\SystemUser', 'id', 'auth_user_id');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,6 @@ class ClientSupportFees extends Model
|
||||
}
|
||||
public function created_by_info(){
|
||||
// return $this->hasOne('App\Models\Account', 'id', 'auth_user_id');
|
||||
return $this->hasOne('App\Models\SystemUser', 'id', 'auth_user_id');
|
||||
return $this->hasOne('App\Models\SystemUser', 'id', 'user_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@ class LoggedUser extends Model
|
||||
|
||||
|
||||
public function auth_user_info(){
|
||||
return $this->hasOne('App\Models\Account', 'id', 'user_id');
|
||||
return $this->hasOne('App\Models\SystemUser', 'id', 'user_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,19 +3,35 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Spatie\Activitylog\Traits\LogsActivity;
|
||||
use Spatie\Activitylog\LogOptions;
|
||||
|
||||
class SenderId extends Model{
|
||||
use LogsActivity;
|
||||
|
||||
|
||||
protected $guarded = array('id');
|
||||
public $table = "sender_ids";
|
||||
protected static $logName = 'senderid_log';
|
||||
// protected static $causedBy = $user_model;
|
||||
protected static $logOnlyDirty = true;
|
||||
protected static $dontSubmitEmptyLogs = true;
|
||||
|
||||
|
||||
protected static $logUnguarded = true;
|
||||
public function getActivitylogOptions(): LogOptions{
|
||||
return LogOptions::defaults()
|
||||
->logUnguarded()->useLogName('senderid_log')->logOnlyDirty()->dontSubmitEmptyLogs();
|
||||
}
|
||||
|
||||
|
||||
public function modified_by_info(){
|
||||
return $this->hasOne('App\Models\StaffMember', 'id', 'last_modified_by');
|
||||
}
|
||||
public function network_info(){
|
||||
return $this->hasOne('App\Models\NetworkOps', 'id', 'netowkr_id');
|
||||
return $this->hasOne('App\Models\NetworkOps', 'id', 'network_id');
|
||||
}
|
||||
public function created_by_info(){
|
||||
return $this->hasOne('App\Models\StaffMember', 'id', 'created_by');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
24
app/Models/SystemCredential.php
Normal file
24
app/Models/SystemCredential.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SystemCredential extends Model{
|
||||
|
||||
protected $guarded = array('id');
|
||||
public $table = "sys_credentials";
|
||||
|
||||
public function modified_by_info(){
|
||||
return $this->hasOne('App\Models\SystemUser', 'id', 'last_modified_by_id');
|
||||
}
|
||||
public function network_info(){
|
||||
return $this->hasOne('App\Models\NetworkOps', 'id', 'network_id');
|
||||
}
|
||||
public function client_info(){
|
||||
return $this->hasOne('App\Models\Client', 'id', 'client_id');
|
||||
}
|
||||
public function created_by_info(){
|
||||
return $this->hasOne('App\Models\SystemUser', 'id', 'created_by_id');
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,21 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
// use Spatie\Activitylog\Traits\LogsActivity;
|
||||
use Spatie\Activitylog\Traits\CausesActivity;
|
||||
use Spatie\Activitylog\LogOptions;
|
||||
|
||||
class SystemUser extends Model
|
||||
{
|
||||
// use LogsActivity;
|
||||
use CausesActivity;
|
||||
protected $guarded = array('id');
|
||||
public $table = "auth_users";
|
||||
|
||||
protected static $logUnguarded = true;
|
||||
// public function getActivitylogOptions(): LogOptions{
|
||||
// return LogOptions::defaults()->logUnguarded();
|
||||
// }
|
||||
|
||||
public function designation_info(){
|
||||
return $this->hasOne('App\Models\Designation', 'id', 'designation');
|
||||
}
|
||||
|
||||
@@ -14,10 +14,13 @@ class UserActivity extends Model
|
||||
public function userInfo(){
|
||||
return $this->hasOne('App\Models\StaffMember', 'id', 'user_id');
|
||||
}
|
||||
public function userInfoSystem(){
|
||||
return $this->hasOne('App\Models\SystemUser', 'id', 'user_id');
|
||||
}
|
||||
public function getActivityTimeAttribute(){
|
||||
$created = $this->created_at;
|
||||
$parsed_created_date = Carbon::parse($created);
|
||||
$current_date = Carbon::parse(date('Y-m-d'));
|
||||
$current_date = Carbon::parse(date('Y-m-d'));
|
||||
$days = $parsed_created_date->diffForHumans();
|
||||
return $days;
|
||||
}
|
||||
|
||||
23
app/Models/Utility.php
Normal file
23
app/Models/Utility.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Spatie\Activitylog\Traits\LogsActivity;
|
||||
use Spatie\Activitylog\LogOptions;
|
||||
|
||||
|
||||
class Utility extends Model{
|
||||
|
||||
use LogsActivity;
|
||||
protected $guarded = ['id'];
|
||||
protected $table = "utility";
|
||||
protected static $logUnguarded = true;
|
||||
public function getActivitylogOptions(): LogOptions
|
||||
{
|
||||
return LogOptions::defaults()
|
||||
->logUnguarded();
|
||||
// ->logOnly(['name', 'type']);
|
||||
// Chain fluent methods for configuration options
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user