@@ -18,41 +18,41 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * Companies |
20 | 20 | */ |
21 | -Route::group(['namespace' => 'Companies', 'prefix' => 'companies'], function() { |
|
21 | +Route::group([ 'namespace' => 'Companies', 'prefix' => 'companies' ], function() { |
|
22 | 22 | |
23 | 23 | //\Auth |
24 | 24 | |
25 | - Route::group(['namespace' => 'Auth'], function() { |
|
26 | - Route::group(['prefix' => 'auth'], function () { |
|
25 | + Route::group([ 'namespace' => 'Auth' ], function() { |
|
26 | + Route::group([ 'prefix' => 'auth' ], function() { |
|
27 | 27 | // Authentication routes... |
28 | - Route::post('login', ['as' => 'companies.auth.login','uses'=>'AuthController@postLogin']); |
|
28 | + Route::post('login', [ 'as' => 'companies.auth.login', 'uses'=>'AuthController@postLogin' ]); |
|
29 | 29 | |
30 | 30 | // Registration routes... |
31 | - Route::post('register', ['as' => 'companies.auth.register', 'uses'=>'AuthController@postRegister']); |
|
31 | + Route::post('register', [ 'as' => 'companies.auth.register', 'uses'=>'AuthController@postRegister' ]); |
|
32 | 32 | |
33 | 33 | }); |
34 | 34 | |
35 | - Route::group(['prefix' => 'password'], function () { |
|
35 | + Route::group([ 'prefix' => 'password' ], function() { |
|
36 | 36 | // Password reset link request routes... |
37 | - Route::post('email', ['as' => 'companies.auth.email', 'uses'=>'PasswordController@postEmail']); |
|
37 | + Route::post('email', [ 'as' => 'companies.auth.email', 'uses'=>'PasswordController@postEmail' ]); |
|
38 | 38 | |
39 | 39 | // Password reset routes... |
40 | - Route::post('reset', ['as' => 'companies.auth.reset', 'uses'=>'PasswordController@postReset']); |
|
40 | + Route::post('reset', [ 'as' => 'companies.auth.reset', 'uses'=>'PasswordController@postReset' ]); |
|
41 | 41 | }); |
42 | 42 | }); |
43 | 43 | |
44 | - Route::group(['namespace' => 'Employees'], function() { |
|
45 | - Route::resource('employees', 'EmployeesController', ['except' => ['create', 'edit']]); |
|
44 | + Route::group([ 'namespace' => 'Employees' ], function() { |
|
45 | + Route::resource('employees', 'EmployeesController', [ 'except' => [ 'create', 'edit' ] ]); |
|
46 | 46 | }); |
47 | 47 | |
48 | - Route::group(['namespace' => 'Groups'], function() { |
|
49 | - Route::resource('groups', 'GroupsController', ['except' => ['create', 'edit']]); |
|
50 | - Route::resource('groups.employees', 'EmployeesController', ['only' => ['store', 'index', 'destroy']]); |
|
48 | + Route::group([ 'namespace' => 'Groups' ], function() { |
|
49 | + Route::resource('groups', 'GroupsController', [ 'except' => [ 'create', 'edit' ] ]); |
|
50 | + Route::resource('groups.employees', 'EmployeesController', [ 'only' => [ 'store', 'index', 'destroy' ] ]); |
|
51 | 51 | }); |
52 | 52 | |
53 | - Route::group(['namespace' => 'Company', 'prefix' => 'company'], function() { |
|
54 | - Route::get('/', ['as' => 'companies.company.index', 'uses' => 'CompanyController@index']); |
|
55 | - Route::put('/', ['as' => 'companies.company.update', 'uses' => 'CompanyController@update']); |
|
53 | + Route::group([ 'namespace' => 'Company', 'prefix' => 'company' ], function() { |
|
54 | + Route::get('/', [ 'as' => 'companies.company.index', 'uses' => 'CompanyController@index' ]); |
|
55 | + Route::put('/', [ 'as' => 'companies.company.update', 'uses' => 'CompanyController@update' ]); |
|
56 | 56 | }); |
57 | 57 | }); |
58 | 58 | |
@@ -60,44 +60,44 @@ discard block |
||
60 | 60 | /** |
61 | 61 | * Employees |
62 | 62 | */ |
63 | -Route::group(['namespace' => 'Employees', 'prefix' => 'employees'], function() { |
|
63 | +Route::group([ 'namespace' => 'Employees', 'prefix' => 'employees' ], function() { |
|
64 | 64 | |
65 | 65 | //\Auth |
66 | - Route::group(['namespace' => 'Auth'], function() { |
|
67 | - Route::group(['prefix' => 'auth'], function () { |
|
66 | + Route::group([ 'namespace' => 'Auth' ], function() { |
|
67 | + Route::group([ 'prefix' => 'auth' ], function() { |
|
68 | 68 | // Authentication routes... |
69 | - Route::post('login', ['as' => 'companies.auth.login', 'uses'=>'AuthController@postLogin']); |
|
69 | + Route::post('login', [ 'as' => 'companies.auth.login', 'uses'=>'AuthController@postLogin' ]); |
|
70 | 70 | |
71 | 71 | // Registration routes... |
72 | 72 | //Route::post('register', ['as' => 'companies.auth.register', 'uses'=>'AuthController@postRegister']); //the registration is managed by the company |
73 | 73 | |
74 | 74 | }); |
75 | 75 | |
76 | - Route::group(['prefix' => 'password'], function () { |
|
76 | + Route::group([ 'prefix' => 'password' ], function() { |
|
77 | 77 | // Password reset link request routes... |
78 | - Route::post('email', ['as' => 'companies.auth.email', 'uses'=>'PasswordController@postEmail']); |
|
78 | + Route::post('email', [ 'as' => 'companies.auth.email', 'uses'=>'PasswordController@postEmail' ]); |
|
79 | 79 | |
80 | 80 | // Password reset routes... |
81 | - Route::post('reset', ['as' => 'companies.auth.reset', 'uses'=>'PasswordController@postReset']); |
|
81 | + Route::post('reset', [ 'as' => 'companies.auth.reset', 'uses'=>'PasswordController@postReset' ]); |
|
82 | 82 | }); |
83 | 83 | }); |
84 | 84 | |
85 | - Route::group(['namespace' => 'Calendars'], function() { |
|
86 | - Route::resource('calendars', 'CalendarsController', ['except' => ['create', 'edit']]); |
|
87 | - Route::post('calendars/caldav', ['as' => 'employees.calendars.caldav','uses'=>'CalendarsController@storeCaldav']); |
|
88 | - Route::post('calendars/calendars', ['as' => 'employees.calendars.calendars','uses'=>'CalendarsController@getCalendars']); //TODO it's correct post? or not |
|
85 | + Route::group([ 'namespace' => 'Calendars' ], function() { |
|
86 | + Route::resource('calendars', 'CalendarsController', [ 'except' => [ 'create', 'edit' ] ]); |
|
87 | + Route::post('calendars/caldav', [ 'as' => 'employees.calendars.caldav', 'uses'=>'CalendarsController@storeCaldav' ]); |
|
88 | + Route::post('calendars/calendars', [ 'as' => 'employees.calendars.calendars', 'uses'=>'CalendarsController@getCalendars' ]); //TODO it's correct post? or not |
|
89 | 89 | }); |
90 | 90 | |
91 | - Route::group(['namespace' => 'Planners', 'prefix' => 'planners'], function() { |
|
92 | - Route::resource('groups', 'GroupsController', ['only' => ['index', 'show']]); |
|
91 | + Route::group([ 'namespace' => 'Planners', 'prefix' => 'planners' ], function() { |
|
92 | + Route::resource('groups', 'GroupsController', [ 'only' => [ 'index', 'show' ] ]); |
|
93 | 93 | }); |
94 | 94 | |
95 | - Route::group(['namespace' => 'Groups'], function() { |
|
96 | - Route::resource('groups', 'GroupsController', ['only' => ['index', 'show']]); |
|
95 | + Route::group([ 'namespace' => 'Groups' ], function() { |
|
96 | + Route::resource('groups', 'GroupsController', [ 'only' => [ 'index', 'show' ] ]); |
|
97 | 97 | }); |
98 | 98 | |
99 | - Route::group(['namespace' => 'Employee', 'prefix' => 'employee'], function() { |
|
100 | - Route::get('/', ['as' => 'employees.employee.index', 'uses' => 'EmployeeController@index']); |
|
101 | - Route::put('/', ['as' => 'employees.employee.update', 'uses' => 'EmployeeController@update']); |
|
99 | + Route::group([ 'namespace' => 'Employee', 'prefix' => 'employee' ], function() { |
|
100 | + Route::get('/', [ 'as' => 'employees.employee.index', 'uses' => 'EmployeeController@index' ]); |
|
101 | + Route::put('/', [ 'as' => 'employees.employee.update', 'uses' => 'EmployeeController@update' ]); |
|
102 | 102 | }); |
103 | 103 | }); |
104 | 104 | \ No newline at end of file |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | { |
11 | 11 | public function __construct() |
12 | 12 | { |
13 | - config(['auth.model' => \plunner\Employee::class]); |
|
14 | - config(['jwt.user' => \plunner\Employee::class]); |
|
13 | + config([ 'auth.model' => \plunner\Employee::class ]); |
|
14 | + config([ 'jwt.user' => \plunner\Employee::class ]); |
|
15 | 15 | $this->middleware('jwt.authandrefresh:mode-en'); |
16 | 16 | } |
17 | 17 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | public function update(EmployeeRequest $request) |
37 | 37 | { |
38 | 38 | $employee = \Auth::user(); |
39 | - $input = $request->only(['name', 'password']); |
|
39 | + $input = $request->only([ 'name', 'password' ]); |
|
40 | 40 | $employee->update($input); |
41 | 41 | return $employee; |
42 | 42 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | return [ |
35 | 35 | 'name' => 'required|min:1|max:255', |
36 | 36 | 'email' => 'required|email|max:255|unique:employees,email,'.$this->route('employees').',id,company_id,'.$this->user()->id, |
37 | - 'password' => ((\Route::current()->getName() == 'companies.employees.store')?'sometimes|':'').'required|confirmed|min:6', |
|
37 | + 'password' => ((\Route::current()->getName() == 'companies.employees.store') ? 'sometimes|' : '').'required|confirmed|min:6', |
|
38 | 38 | ]; |
39 | 39 | } |
40 | 40 | } |
@@ -50,19 +50,19 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @var array |
52 | 52 | */ |
53 | - protected $fillable = ['name', 'email', 'password']; |
|
53 | + protected $fillable = [ 'name', 'email', 'password' ]; |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * The attributes excluded from the model's JSON form. |
57 | 57 | * |
58 | 58 | * @var array |
59 | 59 | */ |
60 | - protected $hidden = ['password', 'remember_token', 'pivot']; |
|
60 | + protected $hidden = [ 'password', 'remember_token', 'pivot' ]; |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * @var array |
64 | 64 | */ |
65 | - protected $appends = ['is_planner']; |
|
65 | + protected $appends = [ 'is_planner' ]; |
|
66 | 66 | |
67 | 67 | public function getIsPlannerAttribute() |
68 | 68 | { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * to get all meetings where the user can go user groups with meetings |
99 | 99 | * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany |
100 | 100 | */ |
101 | - public function meetings(){ |
|
101 | + public function meetings() { |
|
102 | 102 | //TODO durign the inserting chek if the meeting is of a group of the user |
103 | 103 | return $this->belongsToMany(Meeting::class); |
104 | 104 | } |
@@ -114,16 +114,16 @@ discard block |
||
114 | 114 | public function getEmailForPasswordReset() |
115 | 115 | { |
116 | 116 | list(, $caller) = debug_backtrace(false); |
117 | - if(isset($caller['class'])) |
|
118 | - $caller = explode('\\', $caller['class']); |
|
117 | + if (isset($caller[ 'class' ])) |
|
118 | + $caller = explode('\\', $caller[ 'class' ]); |
|
119 | 119 | else |
120 | 120 | $caller = ''; |
121 | 121 | |
122 | 122 | //check if this function is called by email sender |
123 | - if ((count($caller) && $caller[count($caller) - 1] == 'PasswordBroker') || (defined('HHVM_VERSION') && $caller == '')) |
|
123 | + if ((count($caller) && $caller[ count($caller) - 1 ] == 'PasswordBroker') || (defined('HHVM_VERSION') && $caller == '')) |
|
124 | 124 | return $this->email; |
125 | 125 | //return unique identify for token repository |
126 | - return $this->email . $this->company->id; |
|
126 | + return $this->email.$this->company->id; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | public function belongsToGroup(Group $group) |
134 | 134 | { |
135 | 135 | $group = $this->groups()->where('id', $group->id)->first(); |
136 | - if(is_object($group) && $group->exists) |
|
136 | + if (is_object($group) && $group->exists) |
|
137 | 137 | return true; |
138 | 138 | return false; |
139 | 139 | } |