@@ -19,41 +19,41 @@ discard block |
||
| 19 | 19 | * Companies |
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | -Route::group(['namespace' => 'Companies', 'prefix' => 'companies'], function() { |
|
| 22 | +Route::group([ 'namespace' => 'Companies', 'prefix' => 'companies' ], function() { |
|
| 23 | 23 | |
| 24 | 24 | //\Auth |
| 25 | 25 | |
| 26 | - Route::group(['namespace' => 'Auth'], function() { |
|
| 27 | - Route::group(['prefix' => 'auth'], function () { |
|
| 26 | + Route::group([ 'namespace' => 'Auth' ], function() { |
|
| 27 | + Route::group([ 'prefix' => 'auth' ], function() { |
|
| 28 | 28 | // Authentication routes... |
| 29 | - Route::post('login', ['as' => 'companies.auth.login','uses'=>'AuthController@postLogin']); |
|
| 29 | + Route::post('login', [ 'as' => 'companies.auth.login', 'uses'=>'AuthController@postLogin' ]); |
|
| 30 | 30 | |
| 31 | 31 | // Registration routes... |
| 32 | - Route::post('register', ['as' => 'companies.auth.register', 'uses'=>'AuthController@postRegister']); |
|
| 32 | + Route::post('register', [ 'as' => 'companies.auth.register', 'uses'=>'AuthController@postRegister' ]); |
|
| 33 | 33 | |
| 34 | 34 | }); |
| 35 | 35 | |
| 36 | - Route::group(['prefix' => 'password'], function () { |
|
| 36 | + Route::group([ 'prefix' => 'password' ], function() { |
|
| 37 | 37 | // Password reset link request routes... |
| 38 | - Route::post('email', ['as' => 'companies.auth.email', 'uses'=>'PasswordController@postEmail']); |
|
| 38 | + Route::post('email', [ 'as' => 'companies.auth.email', 'uses'=>'PasswordController@postEmail' ]); |
|
| 39 | 39 | |
| 40 | 40 | // Password reset routes... |
| 41 | - Route::post('reset', ['as' => 'companies.auth.reset', 'uses'=>'PasswordController@postReset']); |
|
| 41 | + Route::post('reset', [ 'as' => 'companies.auth.reset', 'uses'=>'PasswordController@postReset' ]); |
|
| 42 | 42 | }); |
| 43 | 43 | }); |
| 44 | 44 | |
| 45 | - Route::group(['namespace' => 'Employees'], function() { |
|
| 46 | - Route::resource('employees', 'EmployeesController', ['except' => ['create', 'edit']]); |
|
| 45 | + Route::group([ 'namespace' => 'Employees' ], function() { |
|
| 46 | + Route::resource('employees', 'EmployeesController', [ 'except' => [ 'create', 'edit' ] ]); |
|
| 47 | 47 | }); |
| 48 | 48 | |
| 49 | - Route::group(['namespace' => 'Groups'], function() { |
|
| 50 | - Route::resource('groups', 'GroupsController', ['except' => ['create', 'edit']]); |
|
| 51 | - Route::resource('groups.employees', 'EmployeesController', ['only' => ['store', 'index', 'destroy']]); |
|
| 49 | + Route::group([ 'namespace' => 'Groups' ], function() { |
|
| 50 | + Route::resource('groups', 'GroupsController', [ 'except' => [ 'create', 'edit' ] ]); |
|
| 51 | + Route::resource('groups.employees', 'EmployeesController', [ 'only' => [ 'store', 'index', 'destroy' ] ]); |
|
| 52 | 52 | }); |
| 53 | 53 | |
| 54 | - Route::group(['namespace' => 'Company', 'prefix' => 'company'], function() { |
|
| 55 | - Route::get('/', ['as' => 'companies.company.index', 'uses' => 'CompanyController@index']); |
|
| 56 | - Route::put('/', ['as' => 'companies.company.update', 'uses' => 'CompanyController@update']); |
|
| 54 | + Route::group([ 'namespace' => 'Company', 'prefix' => 'company' ], function() { |
|
| 55 | + Route::get('/', [ 'as' => 'companies.company.index', 'uses' => 'CompanyController@index' ]); |
|
| 56 | + Route::put('/', [ 'as' => 'companies.company.update', 'uses' => 'CompanyController@update' ]); |
|
| 57 | 57 | }); |
| 58 | 58 | }); |
| 59 | 59 | |
@@ -61,46 +61,46 @@ discard block |
||
| 61 | 61 | /** |
| 62 | 62 | * Employees |
| 63 | 63 | */ |
| 64 | -Route::group(['namespace' => 'Employees', 'prefix' => 'employees'], function() { |
|
| 64 | +Route::group([ 'namespace' => 'Employees', 'prefix' => 'employees' ], function() { |
|
| 65 | 65 | |
| 66 | 66 | //\Auth |
| 67 | - Route::group(['namespace' => 'Auth'], function() { |
|
| 68 | - Route::group(['prefix' => 'auth'], function () { |
|
| 67 | + Route::group([ 'namespace' => 'Auth' ], function() { |
|
| 68 | + Route::group([ 'prefix' => 'auth' ], function() { |
|
| 69 | 69 | // Authentication routes... |
| 70 | - Route::post('login', ['as' => 'companies.auth.login', 'uses'=>'AuthController@postLogin']); |
|
| 70 | + Route::post('login', [ 'as' => 'companies.auth.login', 'uses'=>'AuthController@postLogin' ]); |
|
| 71 | 71 | |
| 72 | 72 | // Registration routes... |
| 73 | 73 | //Route::post('register', ['as' => 'companies.auth.register', 'uses'=>'AuthController@postRegister']); //the registration is managed by the company |
| 74 | 74 | |
| 75 | 75 | }); |
| 76 | 76 | |
| 77 | - Route::group(['prefix' => 'password'], function () { |
|
| 77 | + Route::group([ 'prefix' => 'password' ], function() { |
|
| 78 | 78 | // Password reset link request routes... |
| 79 | - Route::post('email', ['as' => 'companies.auth.email', 'uses'=>'PasswordController@postEmail']); |
|
| 79 | + Route::post('email', [ 'as' => 'companies.auth.email', 'uses'=>'PasswordController@postEmail' ]); |
|
| 80 | 80 | |
| 81 | 81 | // Password reset routes... |
| 82 | - Route::post('reset', ['as' => 'companies.auth.reset', 'uses'=>'PasswordController@postReset']); |
|
| 82 | + Route::post('reset', [ 'as' => 'companies.auth.reset', 'uses'=>'PasswordController@postReset' ]); |
|
| 83 | 83 | }); |
| 84 | 84 | }); |
| 85 | 85 | |
| 86 | - Route::group(['namespace' => 'Calendars'], function() { |
|
| 87 | - Route::resource('calendars', 'CalendarsController', ['except' => ['create', 'edit']]); |
|
| 88 | - Route::post('calendars/caldav', ['as' => 'employees.calendars.caldav','uses'=>'CalendarsController@storeCaldav']); |
|
| 89 | - Route::post('calendars/calendars', ['as' => 'employees.calendars.calendars','uses'=>'CalendarsController@getCalendars']); //TODO it's correct post? or not |
|
| 86 | + Route::group([ 'namespace' => 'Calendars' ], function() { |
|
| 87 | + Route::resource('calendars', 'CalendarsController', [ 'except' => [ 'create', 'edit' ] ]); |
|
| 88 | + Route::post('calendars/caldav', [ 'as' => 'employees.calendars.caldav', 'uses'=>'CalendarsController@storeCaldav' ]); |
|
| 89 | + Route::post('calendars/calendars', [ 'as' => 'employees.calendars.calendars', 'uses'=>'CalendarsController@getCalendars' ]); //TODO it's correct post? or not |
|
| 90 | 90 | }); |
| 91 | 91 | |
| 92 | - Route::group(['namespace' => 'Planners', 'prefix' => 'planners'], function() { |
|
| 93 | - Route::resource('groups', 'GroupsController', ['only' => ['index', 'show']]); |
|
| 94 | - Route::resource('groups.meetings', 'MeetingsController', ['except' => ['create', 'edit']]); |
|
| 95 | - Route::resource('groups.meetings.timeslots', 'MeetingTimeslotsController', ['except' => ['create', 'edit']]); |
|
| 92 | + Route::group([ 'namespace' => 'Planners', 'prefix' => 'planners' ], function() { |
|
| 93 | + Route::resource('groups', 'GroupsController', [ 'only' => [ 'index', 'show' ] ]); |
|
| 94 | + Route::resource('groups.meetings', 'MeetingsController', [ 'except' => [ 'create', 'edit' ] ]); |
|
| 95 | + Route::resource('groups.meetings.timeslots', 'MeetingTimeslotsController', [ 'except' => [ 'create', 'edit' ] ]); |
|
| 96 | 96 | }); |
| 97 | 97 | |
| 98 | - Route::group(['namespace' => 'Groups'], function() { |
|
| 99 | - Route::resource('groups', 'GroupsController', ['only' => ['index', 'show']]); |
|
| 98 | + Route::group([ 'namespace' => 'Groups' ], function() { |
|
| 99 | + Route::resource('groups', 'GroupsController', [ 'only' => [ 'index', 'show' ] ]); |
|
| 100 | 100 | }); |
| 101 | 101 | |
| 102 | - Route::group(['namespace' => 'Employee', 'prefix' => 'employee'], function() { |
|
| 103 | - Route::get('/', ['as' => 'employees.employee.index', 'uses' => 'EmployeeController@index']); |
|
| 104 | - Route::put('/', ['as' => 'employees.employee.update', 'uses' => 'EmployeeController@update']); |
|
| 102 | + Route::group([ 'namespace' => 'Employee', 'prefix' => 'employee' ], function() { |
|
| 103 | + Route::get('/', [ 'as' => 'employees.employee.index', 'uses' => 'EmployeeController@index' ]); |
|
| 104 | + Route::put('/', [ 'as' => 'employees.employee.update', 'uses' => 'EmployeeController@update' ]); |
|
| 105 | 105 | }); |
| 106 | 106 | }); |
| 107 | 107 | \ No newline at end of file |
@@ -2,15 +2,12 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace plunner\Http\Controllers\Employees\Planners; |
| 4 | 4 | |
| 5 | -use Illuminate\Http\Request; |
|
| 6 | -use plunner\Employee; |
|
| 7 | -use plunner\Http\Requests; |
|
| 8 | -use plunner\Meeting; |
|
| 5 | +use Illuminate\Support\Facades\Response; |
|
| 9 | 6 | use plunner\Group; |
| 10 | -use plunner\MeetingTimeslot; |
|
| 11 | 7 | use plunner\Http\Controllers\Controller; |
| 12 | 8 | use plunner\Http\Requests\Employees\MeetingTimeslotRequest; |
| 13 | -use Illuminate\Support\Facades\Response; |
|
| 9 | +use plunner\Meeting; |
|
| 10 | +use plunner\MeetingTimeslot; |
|
| 14 | 11 | |
| 15 | 12 | |
| 16 | 13 | class MeetingTimeslotsController extends Controller |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | public function __construct() |
| 22 | 22 | { |
| 23 | - config(['auth.model' => \plunner\Planner::class]); |
|
| 24 | - config(['jwt.user' => \plunner\Planner::class]); |
|
| 23 | + config([ 'auth.model' => \plunner\Planner::class ]); |
|
| 24 | + config([ 'jwt.user' => \plunner\Planner::class ]); |
|
| 25 | 25 | $this->middleware('jwt.authandrefresh:mode-en'); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | if ($meeting->group_id == $groupId) |
| 41 | 41 | return $meeting->timeslots; |
| 42 | - return Response::json(['error' => 'meeting->group_id <> groupId'], 403); |
|
| 42 | + return Response::json([ 'error' => 'meeting->group_id <> groupId' ], 403); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | if ($meeting->group_id == $groupId && $timeslot->meeting_id == $meetingId) |
| 63 | 63 | return $timeslot; |
| 64 | - return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403); |
|
| 64 | + return Response::json([ 'error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId' ], 403); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $timeslot = $meeting->timeslots()->create($input); |
| 84 | 84 | return $timeslot; |
| 85 | 85 | } |
| 86 | - return Response::json(['error' => 'meeting->group_id <> groupId'], 403); |
|
| 86 | + return Response::json([ 'error' => 'meeting->group_id <> groupId' ], 403); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $timeslot->update($input); |
| 108 | 108 | return $timeslot; |
| 109 | 109 | } |
| 110 | - return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403); |
|
| 110 | + return Response::json([ 'error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId' ], 403); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
@@ -131,6 +131,6 @@ discard block |
||
| 131 | 131 | $timeslot->delete(); |
| 132 | 132 | return $timeslot; |
| 133 | 133 | } |
| 134 | - return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403); |
|
| 134 | + return Response::json([ 'error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId' ], 403); |
|
| 135 | 135 | } |
| 136 | 136 | } |
@@ -37,8 +37,9 @@ discard block |
||
| 37 | 37 | $meeting = Meeting::findOrFail($meetingId); |
| 38 | 38 | $this->authorize($meeting); |
| 39 | 39 | |
| 40 | - if ($meeting->group_id == $groupId) |
|
| 41 | - return $meeting->timeslots; |
|
| 40 | + if ($meeting->group_id == $groupId) { |
|
| 41 | + return $meeting->timeslots; |
|
| 42 | + } |
|
| 42 | 43 | return Response::json(['error' => 'meeting->group_id <> groupId'], 403); |
| 43 | 44 | } |
| 44 | 45 | |
@@ -59,8 +60,9 @@ discard block |
||
| 59 | 60 | $timeslot = MeetingTimeslot::findOrFail($timeslotId); |
| 60 | 61 | $this->authorize($timeslot); |
| 61 | 62 | |
| 62 | - if ($meeting->group_id == $groupId && $timeslot->meeting_id == $meetingId) |
|
| 63 | - return $timeslot; |
|
| 63 | + if ($meeting->group_id == $groupId && $timeslot->meeting_id == $meetingId) { |
|
| 64 | + return $timeslot; |
|
| 65 | + } |
|
| 64 | 66 | return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403); |
| 65 | 67 | } |
| 66 | 68 | |
@@ -32,14 +32,14 @@ |
||
| 32 | 32 | * |
| 33 | 33 | * @var array |
| 34 | 34 | */ |
| 35 | - protected $fillable = ['time_start', 'time_end']; |
|
| 35 | + protected $fillable = [ 'time_start', 'time_end' ]; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * The attributes excluded from the model's JSON form. |
| 39 | 39 | * |
| 40 | 40 | * @var array |
| 41 | 41 | */ |
| 42 | - protected $hidden = ['pivot', 'meeting']; |
|
| 42 | + protected $hidden = [ 'pivot', 'meeting' ]; |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |