@@ -2,9 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Http\Controllers; |
| 4 | 4 | |
| 5 | -use App\Http\Requests; |
|
| 6 | -use Illuminate\Http\Request; |
|
| 7 | - |
|
| 8 | 5 | class HomeController extends Controller |
| 9 | 6 | { |
| 10 | 7 | /** |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | /** |
| 23 | 23 | * Show the application dashboard. |
| 24 | 24 | * |
| 25 | - * @return \Illuminate\Http\Response |
|
| 25 | + * @return \Illuminate\Http\RedirectResponse |
|
| 26 | 26 | */ |
| 27 | 27 | public function index() |
| 28 | 28 | { |
@@ -26,19 +26,19 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function index() |
| 28 | 28 | { |
| 29 | - $user = auth()->user(); |
|
| 29 | + $user = auth()->user(); |
|
| 30 | 30 | |
| 31 | - if(Bouncer::is($user)->a('Administrator', 'Manager')) { |
|
| 32 | - return redirect()->route('dashboard.administration'); |
|
| 33 | - } |
|
| 31 | + if(Bouncer::is($user)->a('Administrator', 'Manager')) { |
|
| 32 | + return redirect()->route('dashboard.administration'); |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - elseif(Bouncer::is($user)->an('Agent')) { |
|
| 35 | + elseif(Bouncer::is($user)->an('Agent')) { |
|
| 36 | 36 | return redirect()->route('dashboard.agent'); |
| 37 | - } |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - elseif(Bouncer::is($user)->an('Customer')) { |
|
| 40 | - return redirect('/'); |
|
| 41 | - } |
|
| 39 | + elseif(Bouncer::is($user)->an('Customer')) { |
|
| 40 | + return redirect('/'); |
|
| 41 | + } |
|
| 42 | 42 | return redirect('/'); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -50,25 +50,25 @@ discard block |
||
| 50 | 50 | public function administration() |
| 51 | 51 | { |
| 52 | 52 | |
| 53 | - if (\Auth::check()) { |
|
| 53 | + if (\Auth::check()) { |
|
| 54 | 54 | // The user is logged in... |
| 55 | 55 | |
| 56 | - $data["chart"] = Charts::create('percentage', 'justgage') |
|
| 57 | - ->setTitle('') |
|
| 58 | - ->setElementLabel('Open requests') |
|
| 59 | - ->setValues([1,0,2]) |
|
| 60 | - ->setResponsive(false) |
|
| 61 | - ->setHeight(250) |
|
| 62 | - ->setWidth(0); |
|
| 63 | - |
|
| 64 | - $data["overdue"] = Charts::create('percentage', 'justgage') |
|
| 65 | - ->setElementLabel('Overdue requests') |
|
| 66 | - ->setValues([65,0,100]) |
|
| 67 | - ->setResponsive(false) |
|
| 68 | - ->setHeight(300) |
|
| 69 | - ->setWidth(0); |
|
| 70 | - |
|
| 71 | - $data["assigned"] = Charts::create('percentage', 'justgage') |
|
| 56 | + $data["chart"] = Charts::create('percentage', 'justgage') |
|
| 57 | + ->setTitle('') |
|
| 58 | + ->setElementLabel('Open requests') |
|
| 59 | + ->setValues([1,0,2]) |
|
| 60 | + ->setResponsive(false) |
|
| 61 | + ->setHeight(250) |
|
| 62 | + ->setWidth(0); |
|
| 63 | + |
|
| 64 | + $data["overdue"] = Charts::create('percentage', 'justgage') |
|
| 65 | + ->setElementLabel('Overdue requests') |
|
| 66 | + ->setValues([65,0,100]) |
|
| 67 | + ->setResponsive(false) |
|
| 68 | + ->setHeight(300) |
|
| 69 | + ->setWidth(0); |
|
| 70 | + |
|
| 71 | + $data["assigned"] = Charts::create('percentage', 'justgage') |
|
| 72 | 72 | ->setTitle('') |
| 73 | 73 | ->setElementLabel('Tasks assigned') |
| 74 | 74 | ->setValues([10, 0, 2]) |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | public function agent() |
| 90 | 90 | { |
| 91 | 91 | |
| 92 | - if (\Auth::check()) { |
|
| 92 | + if (\Auth::check()) { |
|
| 93 | 93 | // The user is logged in... |
| 94 | 94 | |
| 95 | 95 | |
@@ -28,15 +28,15 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | $user = auth()->user(); |
| 30 | 30 | |
| 31 | - if(Bouncer::is($user)->a('Administrator', 'Manager')) { |
|
| 31 | + if (Bouncer::is($user)->a('Administrator', 'Manager')) { |
|
| 32 | 32 | return redirect()->route('dashboard.administration'); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - elseif(Bouncer::is($user)->an('Agent')) { |
|
| 35 | + elseif (Bouncer::is($user)->an('Agent')) { |
|
| 36 | 36 | return redirect()->route('dashboard.agent'); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - elseif(Bouncer::is($user)->an('Customer')) { |
|
| 39 | + elseif (Bouncer::is($user)->an('Customer')) { |
|
| 40 | 40 | return redirect('/'); |
| 41 | 41 | } |
| 42 | 42 | return redirect('/'); |
@@ -53,25 +53,25 @@ discard block |
||
| 53 | 53 | if (\Auth::check()) { |
| 54 | 54 | // The user is logged in... |
| 55 | 55 | |
| 56 | - $data["chart"] = Charts::create('percentage', 'justgage') |
|
| 56 | + $data[ "chart" ] = Charts::create('percentage', 'justgage') |
|
| 57 | 57 | ->setTitle('') |
| 58 | 58 | ->setElementLabel('Open requests') |
| 59 | - ->setValues([1,0,2]) |
|
| 59 | + ->setValues([ 1, 0, 2 ]) |
|
| 60 | 60 | ->setResponsive(false) |
| 61 | 61 | ->setHeight(250) |
| 62 | 62 | ->setWidth(0); |
| 63 | 63 | |
| 64 | - $data["overdue"] = Charts::create('percentage', 'justgage') |
|
| 64 | + $data[ "overdue" ] = Charts::create('percentage', 'justgage') |
|
| 65 | 65 | ->setElementLabel('Overdue requests') |
| 66 | - ->setValues([65,0,100]) |
|
| 66 | + ->setValues([ 65, 0, 100 ]) |
|
| 67 | 67 | ->setResponsive(false) |
| 68 | 68 | ->setHeight(300) |
| 69 | 69 | ->setWidth(0); |
| 70 | 70 | |
| 71 | - $data["assigned"] = Charts::create('percentage', 'justgage') |
|
| 71 | + $data[ "assigned" ] = Charts::create('percentage', 'justgage') |
|
| 72 | 72 | ->setTitle('') |
| 73 | 73 | ->setElementLabel('Tasks assigned') |
| 74 | -->setValues([10, 0, 2]) |
|
| 74 | +->setValues([ 10, 0, 2 ]) |
|
| 75 | 75 | ->setResponsive(false) |
| 76 | 76 | ->setHeight(250) |
| 77 | 77 | ->setWidth(0); |
@@ -30,13 +30,9 @@ |
||
| 30 | 30 | |
| 31 | 31 | if(Bouncer::is($user)->a('Administrator', 'Manager')) { |
| 32 | 32 | return redirect()->route('dashboard.administration'); |
| 33 | - } |
|
| 34 | - |
|
| 35 | - elseif(Bouncer::is($user)->an('Agent')) { |
|
| 33 | + } elseif(Bouncer::is($user)->an('Agent')) { |
|
| 36 | 34 | return redirect()->route('dashboard.agent'); |
| 37 | - } |
|
| 38 | - |
|
| 39 | - elseif(Bouncer::is($user)->an('Customer')) { |
|
| 35 | + } elseif(Bouncer::is($user)->an('Customer')) { |
|
| 40 | 36 | return redirect('/'); |
| 41 | 37 | } |
| 42 | 38 | return redirect('/'); |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | { |
| 55 | 55 | $router->group([ |
| 56 | 56 | 'namespace' => $this->namespace, 'middleware' => 'web', |
| 57 | - ], function ($router) { |
|
| 57 | + ], function($router) { |
|
| 58 | 58 | require app_path('Http/routes.php'); |
| 59 | 59 | }); |
| 60 | 60 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * @var array |
| 19 | 19 | */ |
| 20 | - protected static $supportedLanguages = ['nl', 'en', 'fr']; |
|
| 20 | + protected static $supportedLanguages = [ 'nl', 'en', 'fr' ]; |
|
| 21 | 21 | /** |
| 22 | 22 | * Handle an incoming request. |
| 23 | 23 | * |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | public function boot() |
| 16 | 16 | { |
| 17 | - Bouncer::seeder(function () { |
|
| 17 | + Bouncer::seeder(function() { |
|
| 18 | 18 | Bouncer::allow('available')->to(''); |
| 19 | 19 | Bouncer::allow('unavailable')->to(''); |
| 20 | 20 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function handle($request, Closure $next, $role) |
| 18 | 18 | { |
| 19 | - if (! auth()->user()->is($role)) { |
|
| 19 | + if (!auth()->user()->is($role)) { |
|
| 20 | 20 | return redirect()->back(302); |
| 21 | 21 | } |
| 22 | 22 | |
@@ -3,8 +3,6 @@ |
||
| 3 | 3 | namespace App\Http\Controllers; |
| 4 | 4 | |
| 5 | 5 | use App\Customer; |
| 6 | -use Illuminate\Http\Request; |
|
| 7 | - |
|
| 8 | 6 | use App\Http\Requests; |
| 9 | 7 | |
| 10 | 8 | class CustomersController extends Controller |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function index() |
| 29 | 29 | { |
| 30 | - $user = auth()->user(); |
|
| 30 | + $user = auth()->user(); |
|
| 31 | 31 | |
| 32 | - if ($user->is('Agent') || $user->is('Manager') || $user->is('Administrator')) { |
|
| 32 | + if ($user->is('Agent') || $user->is('Manager') || $user->is('Administrator')) { |
|
| 33 | 33 | $data['customers'] = Customer::orderBy('status' , 'asc')->paginate(15); |
| 34 | 34 | return view('customers/index', $data); |
| 35 | - } |
|
| 35 | + } |
|
| 36 | 36 | return redirect()->back(); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -65,9 +65,9 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | if (! $user->is('Guest') || ! $user->is('Agent') || ! $user->is('Manager') || ! $user->is('Administrator')) |
| 67 | 67 | { |
| 68 | - Customer::create($input->except('_token')); |
|
| 69 | - session()->flash('message', 'Customer created'); |
|
| 70 | - return redirect()->to('/customers'); |
|
| 68 | + Customer::create($input->except('_token')); |
|
| 69 | + session()->flash('message', 'Customer created'); |
|
| 70 | + return redirect()->to('/customers'); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | return redirect()->back(); |
@@ -84,10 +84,10 @@ discard block |
||
| 84 | 84 | $user = auth()->user(); |
| 85 | 85 | |
| 86 | 86 | if(! $user->is('Customer') || ! $user->is('Agent') || ! $user->is('Manager') || ! $user->is('Administrator')) { |
| 87 | - $data['customer'] = Customer::where('id', $id)->get(); |
|
| 88 | - return view('customers/edit', $data); |
|
| 87 | + $data['customer'] = Customer::where('id', $id)->get(); |
|
| 88 | + return view('customers/edit', $data); |
|
| 89 | 89 | |
| 90 | - } |
|
| 90 | + } |
|
| 91 | 91 | |
| 92 | 92 | return redirect()->back(); |
| 93 | 93 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $user = auth()->user(); |
| 31 | 31 | |
| 32 | 32 | if ($user->is('Agent') || $user->is('Manager') || $user->is('Administrator')) { |
| 33 | - $data['customers'] = Customer::orderBy('status' , 'asc')->paginate(15); |
|
| 33 | + $data[ 'customers' ] = Customer::orderBy('status', 'asc')->paginate(15); |
|
| 34 | 34 | return view('customers/index', $data); |
| 35 | 35 | } |
| 36 | 36 | return redirect()->back(); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $user = auth()->user(); |
| 47 | 47 | |
| 48 | 48 | if ($user->is('Guest') || $user->is('Agent') || $user->is('Manager') || $user->is('Administrator')) { |
| 49 | - $data['countries'] = Countries::all(); |
|
| 49 | + $data[ 'countries' ] = Countries::all(); |
|
| 50 | 50 | return view('customers/register', $data); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $user = auth()->user(); |
| 65 | 65 | |
| 66 | - if (! $user->is('Guest') || ! $user->is('Agent') || ! $user->is('Manager') || ! $user->is('Administrator')) |
|
| 66 | + if (!$user->is('Guest') || !$user->is('Agent') || !$user->is('Manager') || !$user->is('Administrator')) |
|
| 67 | 67 | { |
| 68 | 68 | Customer::create($input->except('_token')); |
| 69 | 69 | session()->flash('message', 'Customer created'); |
@@ -83,8 +83,8 @@ discard block |
||
| 83 | 83 | { |
| 84 | 84 | $user = auth()->user(); |
| 85 | 85 | |
| 86 | - if(! $user->is('Customer') || ! $user->is('Agent') || ! $user->is('Manager') || ! $user->is('Administrator')) { |
|
| 87 | - $data['customer'] = Customer::where('id', $id)->get(); |
|
| 86 | + if (!$user->is('Customer') || !$user->is('Agent') || !$user->is('Manager') || !$user->is('Administrator')) { |
|
| 87 | + $data[ 'customer' ] = Customer::where('id', $id)->get(); |
|
| 88 | 88 | return view('customers/edit', $data); |
| 89 | 89 | |
| 90 | 90 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * Store a newly created resource in storage. |
| 50 | 50 | * |
| 51 | 51 | * @param Requests\DepartmentsValidator $input |
| 52 | - * @return \Illuminate\Http\Response |
|
| 52 | + * @return \Illuminate\Http\RedirectResponse |
|
| 53 | 53 | */ |
| 54 | 54 | public function store(Requests\DepartmentsValidator $input) |
| 55 | 55 | { |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * |
| 87 | 87 | * @param Requests\DepartmentsValidator $input |
| 88 | 88 | * @param int $id the department id in the database. |
| 89 | - * @return \Illuminate\Http\Response |
|
| 89 | + * @return \Illuminate\Http\RedirectResponse |
|
| 90 | 90 | */ |
| 91 | 91 | public function update(Requests\DepartmentsValidator $input, $id) |
| 92 | 92 | { |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * Remove the specified resource from storage. |
| 99 | 99 | * |
| 100 | 100 | * @param int $id the department id in the database. |
| 101 | - * @return \Illuminate\Http\Response |
|
| 101 | + * @return \Illuminate\Http\RedirectResponse |
|
| 102 | 102 | */ |
| 103 | 103 | public function destroy($id) |
| 104 | 104 | { |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use App\Departments; |
| 6 | 6 | use Illuminate\Http\Request; |
| 7 | - |
|
| 8 | 7 | use App\Http\Requests; |
| 9 | 8 | |
| 10 | 9 | /** |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function index() |
| 34 | 34 | { |
| 35 | - $data['query'] = Departments::with('managers')->paginate(15); |
|
| 35 | + $data[ 'query' ] = Departments::with('managers')->paginate(15); |
|
| 36 | 36 | return view('departments.index', $data); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | public function search(Request $request) |
| 56 | 56 | { |
| 57 | 57 | $term = $request->get('name'); |
| 58 | - $data['query'] = Departments::where('name', 'LIKE', "%$term%")->with('managers')->paginate(15); |
|
| 58 | + $data[ 'query' ] = Departments::where('name', 'LIKE', "%$term%")->with('managers')->paginate(15); |
|
| 59 | 59 | return view('departments.index', $data); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | public function show($id) |
| 81 | 81 | { |
| 82 | - $data['query'] = Departments::find($id); |
|
| 82 | + $data[ 'query' ] = Departments::find($id); |
|
| 83 | 83 | return view('departments.specific', $data); |
| 84 | 84 | } |
| 85 | 85 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function edit($id) |
| 93 | 93 | { |
| 94 | - $data['query'] = Departments::find($id); |
|
| 94 | + $data[ 'query' ] = Departments::find($id); |
|
| 95 | 95 | return view('departments.update', $data); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -128,12 +128,12 @@ discard block |
||
| 128 | 128 | public function get_departments() |
| 129 | 129 | { |
| 130 | 130 | $items = Departments::all(); |
| 131 | - $data2 = []; |
|
| 131 | + $data2 = [ ]; |
|
| 132 | 132 | |
| 133 | - foreach($items as $department) { |
|
| 134 | - $data2[] = [ |
|
| 135 | - 'value' => $department["id"], |
|
| 136 | - 'text' => $department["name"] |
|
| 133 | + foreach ($items as $department) { |
|
| 134 | + $data2[ ] = [ |
|
| 135 | + 'value' => $department[ "id" ], |
|
| 136 | + 'text' => $department[ "name" ] |
|
| 137 | 137 | ]; |
| 138 | 138 | } |
| 139 | 139 | |
@@ -2,10 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Http\Controllers; |
| 4 | 4 | |
| 5 | -use App\User; |
|
| 6 | 5 | use Illuminate\Http\Request; |
| 7 | 6 | use Chrisbjr\ApiGuard\Models\ApiKey; |
| 8 | -use App\Http\Requests; |
|
| 9 | 7 | |
| 10 | 8 | class ApiKeyController extends Controller |
| 11 | 9 | { |
@@ -26,6 +26,6 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function rules() |
| 28 | 28 | { |
| 29 | - return ['password' => 'required|min:6|confirmed']; |
|
| 29 | + return [ 'password' => 'required|min:6|confirmed' ]; |
|
| 30 | 30 | } |
| 31 | 31 | } |