Model for Asset Maintenances. More...

Inheritance diagram for App\Models\AssetMaintenance:
App\Models\ICompanyableChild

Public Member Functions

 getCompanyableParents ()
 
 asset ()
 asset Get asset for this improvement More...
 
 supplier ()
 
 scopeDeleted ($query)
 

BEGIN QUERY SCOPES

More...
 
 scopeTextSearch ($query, $search)
 Query builder scope to search on text. More...
 

Static Public Member Functions

static getImprovementOptions ()
 getImprovementOptions More...
 

Protected Attributes

 $dates = [ 'deleted_at' ]
 
 $table = 'asset_maintenances'
 
 $rules
 

Detailed Description

Model for Asset Maintenances.

Version
v1.0

Definition at line 14 of file AssetMaintenance.php.

Member Function Documentation

App\Models\AssetMaintenance::asset ( )

asset Get asset for this improvement

Returns
mixed
Author
Vincent Sposato vince.nosp@m.nt.s.nosp@m.posat.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om
Version
v1.0

Definition at line 66 of file AssetMaintenance.php.

67  {
68 
69  return $this->belongsTo('\App\Models\Asset', 'asset_id')
70  ->withTrashed();
71  }
App\Models\AssetMaintenance::getCompanyableParents ( )

Implements App\Models\ICompanyableChild.

Definition at line 36 of file AssetMaintenance.php.

37  {
38  return [ 'asset' ];
39  }
static App\Models\AssetMaintenance::getImprovementOptions ( )
static

getImprovementOptions

Returns
array
Author
Vincent Sposato vince.nosp@m.nt.s.nosp@m.posat.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om
Version
v1.0

Definition at line 48 of file AssetMaintenance.php.

49  {
50 
51  return [
52  Lang::get('admin/asset_maintenances/general.maintenance') => Lang::get('admin/asset_maintenances/general.maintenance'),
53  Lang::get('admin/asset_maintenances/general.repair') => Lang::get('admin/asset_maintenances/general.repair'),
54  Lang::get('admin/asset_maintenances/general.upgrade') => Lang::get('admin/asset_maintenances/general.upgrade')
55  ];
56  }
App\Models\AssetMaintenance::scopeDeleted (   $query)


BEGIN QUERY SCOPES

Query builder scope for Deleted assets

Parameters
Illuminate\Database\Query\Builder$queryQuery builder instance
Returns
Illuminate Modified query builder

Definition at line 94 of file AssetMaintenance.php.

95  {
96 
97  return $query->whereNotNull('deleted_at');
98  }
App\Models\AssetMaintenance::scopeTextSearch (   $query,
  $search 
)

Query builder scope to search on text.

Parameters
Illuminate\Database\Query\Builder$queryQuery builder instance
text$searchSearch term
Returns
Illuminate Modified query builder

Definition at line 108 of file AssetMaintenance.php.

109  {
110 
111  return $query->where(function ($query) use ($search) {
112 
113  $query->where('title', 'LIKE', '%'.$search.'%')
114  ->orWhere('notes', 'LIKE', '%'.$search.'%')
115  ->orWhere('asset_maintenance_type', 'LIKE', '%'.$search.'%')
116  ->orWhere('cost', 'LIKE', '%'.$search.'%')
117  ->orWhere('start_date', 'LIKE', '%'.$search.'%')
118  ->orWhere('completion_date', 'LIKE', '%'.$search.'%');
119  });
120  }
App\Models\AssetMaintenance::supplier ( )

Definition at line 73 of file AssetMaintenance.php.

74  {
75 
76  return $this->belongsTo('\App\Models\Supplier', 'supplier_id')
77  ->withTrashed();
78  }

Member Data Documentation

App\Models\AssetMaintenance::$dates = [ 'deleted_at' ]
protected

Definition at line 20 of file AssetMaintenance.php.

App\Models\AssetMaintenance::$rules
protected
Initial value:
= [
'asset_id' => 'required|integer'

Definition at line 24 of file AssetMaintenance.php.

App\Models\AssetMaintenance::$table = 'asset_maintenances'
protected

Definition at line 21 of file AssetMaintenance.php.


The documentation for this class was generated from the following file: