Inheritance diagram for App\Models\Depreciation:

Public Member Functions

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

Protected Attributes

 $rules
 
 $injectUniqueIdentifier = true
 
 $fillable = ['name','months']
 

Detailed Description

Definition at line 7 of file Depreciation.php.

Member Function Documentation

App\Models\Depreciation::has_licenses ( )

Definition at line 39 of file Depreciation.php.

40  {
41  return $this->hasMany('\App\Models\License', 'depreciation_id')->count();
42  }
App\Models\Depreciation::has_models ( )

Definition at line 34 of file Depreciation.php.

35  {
36  return $this->hasMany('\App\Models\AssetModel', 'depreciation_id')->count();
37  }
App\Models\Depreciation::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 52 of file Depreciation.php.

53  {
54 
55  return $query->where(function ($query) use ($search) {
56 
57  $query->where('name', 'LIKE', '%'.$search.'%')
58  ->orWhere('months', 'LIKE', '%'.$search.'%');
59  });
60  }

Member Data Documentation

App\Models\Depreciation::$fillable = ['name','months']
protected

Definition at line 30 of file Depreciation.php.

App\Models\Depreciation::$injectUniqueIdentifier = true
protected

Definition at line 22 of file Depreciation.php.

App\Models\Depreciation::$rules
protected
Initial value:
= array(
'name' => 'required|min:3|max:255|unique:depreciations,name',
'months' => 'required|min:1|max:240|integer',
)

Definition at line 10 of file Depreciation.php.


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