Adopt Laravel coding style
Shift automatically applies the Laravel coding style - which uses the PSR-2 coding style as a base with some minor additions. You may customize the adopted coding style by adding your own [PHP CS Fixer][1] `.php_cs` config file to your project root. Feel free to use [Shift's Laravel ruleset][2] to help you get started. [1]: https://github.com/FriendsOfPHP/PHP-CS-Fixer [2]: https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200
This commit is contained in:
@@ -13,7 +13,7 @@ class Department extends SnipeModel
|
||||
* validation rules before attempting validation. If this property
|
||||
* is not set in the model it will default to true.
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $injectUniqueIdentifier = true;
|
||||
|
||||
@@ -47,17 +47,17 @@ class Department extends SnipeModel
|
||||
];
|
||||
|
||||
use Searchable;
|
||||
|
||||
|
||||
/**
|
||||
* The attributes that should be included when searching the model.
|
||||
*
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $searchableAttributes = ['name', 'notes'];
|
||||
|
||||
/**
|
||||
* The relations and their attributes that should be included when searching the model.
|
||||
*
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $searchableRelations = [];
|
||||
@@ -74,7 +74,6 @@ class Department extends SnipeModel
|
||||
return $this->belongsTo('\App\Models\Company', 'company_id');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Establishes the department -> users relationship
|
||||
*
|
||||
@@ -87,7 +86,6 @@ class Department extends SnipeModel
|
||||
return $this->hasMany('\App\Models\User', 'department_id');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Establishes the department -> manager relationship
|
||||
*
|
||||
@@ -111,7 +109,7 @@ class Department extends SnipeModel
|
||||
{
|
||||
return $this->belongsTo('\App\Models\Location', 'location_id');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Query builder scope to order on location name
|
||||
*
|
||||
@@ -137,6 +135,4 @@ class Department extends SnipeModel
|
||||
{
|
||||
return $query->leftJoin('users as department_user', 'departments.manager_id', '=', 'department_user.id')->orderBy('department_user.first_name', $order)->orderBy('department_user.last_name', $order);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user