24 protected $fillable = [
'created_at',
'asset_type' ];
28 return [
'accessorylog',
'assetlog',
'licenselog',
'consumablelog' ];
34 return $this->belongsTo(
'\App\Models\Asset',
'asset_id')
41 return $this->belongsTo(
'\App\Models\Asset',
'asset_id')
42 ->where(
'action_type',
'=',
'uploaded')
49 return $this->belongsTo(
'\App\Models\License',
'asset_id')
56 return $this->belongsTo(
'\App\Models\Accessory',
'accessory_id')
63 return $this->belongsTo(
'\App\Models\Consumable',
'consumable_id')
70 return $this->belongsTo(
'\App\Models\User',
'user_id')
77 return $this->belongsTo(
'\App\Models\User',
'checkedout_to')
84 return $this->hasMany(
'\App\Models\ActionLog',
'thread_id');
90 return $this->belongsTo(
'\App\Models\ActionLog',
'thread_id');
99 $file = config(
'app.private_uploads') .
'/' . $type .
'/' . $this->filename;
111 $this->action_type = $actiontype;
130 return DB::table(
'asset_logs')
132 ->where(
'action_type',
'!=',
'uploaded')
133 ->orderBy(
'asset_id',
'asc')
134 ->orderBy(
'created_at',
'asc')
148 return DB::table(
'asset_logs')
149 ->select(DB::raw(
'asset_id, MAX(created_at) as last_created'))
150 ->where(
'action_type',
'=',
'checkout')
151 ->groupBy(
'asset_id')
167 return $query->where(
'action_type',
'=',
'checkout')
168 ->where(
'accepted_id',
'=', null);
Model for the Actionlog (the table that keeps a historical log of checkouts, checkins, and updates).
getListingOfActionLogsChronologicalOrder()
getListingOfActionLogsChronologicalOrder
logaction($actiontype)
Get the parent category name.
scopeCheckoutWithoutAcceptance($query)
scopeCheckoutWithoutAcceptance
getLatestCheckoutActionForAssets()
getLatestCheckoutActionForAssets
get_src($type= 'assets')
Check if the file exists, and if it does, force a download.