@@ -16,8 +16,8 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function index() |
| 18 | 18 | { |
| 19 | - $data['roles'] = Roles::all(); |
|
| 20 | - return view('roles.index', $data); |
|
| 19 | + $data['roles'] = Roles::all(); |
|
| 20 | + return view('roles.index', $data); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | class BackupController extends Controller |
| 11 | 11 | { |
| 12 | - public function __construct() |
|
| 12 | + public function __construct() |
|
| 13 | 13 | { |
| 14 | 14 | $this->middleware('auth'); |
| 15 | 15 | $this->middleware('lang'); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $data['MonthlyBackups'] = Config::get('laravel-backup.cleanup.defaultStrategy.keepMonthlyBackupsForMonths'); |
| 31 | 31 | $data['KeepYearlyBackups'] = Config::get('laravel-backup.cleanup.defaultStrategy.keepYearlyBackupsForYears'); |
| 32 | 32 | |
| 33 | - return view('settings.backups', $data); |
|
| 33 | + return view('settings.backups', $data); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | { |
| 11 | 11 | // TODO: Needs phpunit tests. -> create github issue |
| 12 | 12 | |
| 13 | - /** |
|
| 13 | + /** |
|
| 14 | 14 | * SettingsController constructor. |
| 15 | 15 | */ |
| 16 | 16 | public function __construct() |
@@ -26,17 +26,17 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function index() |
| 28 | 28 | { |
| 29 | - return view('settings.index'); |
|
| 29 | + return view('settings.index'); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * Get the email settings page. |
|
| 34 | - * |
|
| 35 | - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
| 36 | - */ |
|
| 37 | - public function email() |
|
| 38 | - { |
|
| 39 | - return view('settings.email'); |
|
| 40 | - } |
|
| 32 | + /** |
|
| 33 | + * Get the email settings page. |
|
| 34 | + * |
|
| 35 | + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
| 36 | + */ |
|
| 37 | + public function email() |
|
| 38 | + { |
|
| 39 | + return view('settings.email'); |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | 42 | } |
@@ -35,17 +35,17 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | public function edit_categories($id) |
| 37 | 37 | { |
| 38 | - $data['category'] = ProductsCategories::find($id); |
|
| 39 | - return view('products.edit_category', $data); |
|
| 38 | + $data['category'] = ProductsCategories::find($id); |
|
| 39 | + return view('products.edit_category', $data); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | public function remove_category($id) |
| 43 | 43 | { |
| 44 | - $category = ProductsCategories::find($id); |
|
| 45 | - $category->delete(); |
|
| 44 | + $category = ProductsCategories::find($id); |
|
| 45 | + $category->delete(); |
|
| 46 | 46 | |
| 47 | - session()->flash('message', trans('products.removed_category')); |
|
| 48 | - return redirect()->back(); |
|
| 47 | + session()->flash('message', trans('products.removed_category')); |
|
| 48 | + return redirect()->back(); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | public function store(Requests\ProductValidator $input) |
| 62 | 62 | { |
| 63 | 63 | $this->validate($input, [ |
| 64 | - 'name' => 'required', |
|
| 65 | - 'category' => 'required', |
|
| 66 | - ]); |
|
| 64 | + 'name' => 'required', |
|
| 65 | + 'category' => 'required', |
|
| 66 | + ]); |
|
| 67 | 67 | |
| 68 | 68 | $product = new Products(); |
| 69 | 69 | $product->name = $input->name; |
@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function saveCat(Request $input) |
| 87 | 87 | { |
| 88 | - $this->validate($input, [ |
|
| 88 | + $this->validate($input, [ |
|
| 89 | 89 | 'name' => 'required|unique:products_categories' |
| 90 | - ]); |
|
| 90 | + ]); |
|
| 91 | 91 | |
| 92 | 92 | $category = new ProductsCategories(); |
| 93 | 93 | $category->name = $input->name; |
@@ -100,10 +100,10 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | public function remove($id) |
| 102 | 102 | { |
| 103 | - $product = Products::find($id); |
|
| 104 | - $product->delete(); |
|
| 103 | + $product = Products::find($id); |
|
| 104 | + $product->delete(); |
|
| 105 | 105 | |
| 106 | - session()->flash('message', trans('products.removed')); |
|
| 107 | - return redirect()->back(); |
|
| 106 | + session()->flash('message', trans('products.removed')); |
|
| 107 | + return redirect()->back(); |
|
| 108 | 108 | } |
| 109 | 109 | } |
@@ -6,10 +6,10 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Segments extends Model |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * The database table used by the model. |
|
| 11 | - * |
|
| 12 | - * @var string |
|
| 13 | - */ |
|
| 14 | - protected $table = 'customers_segments'; |
|
| 9 | + /** |
|
| 10 | + * The database table used by the model. |
|
| 11 | + * |
|
| 12 | + * @var string |
|
| 13 | + */ |
|
| 14 | + protected $table = 'customers_segments'; |
|
| 15 | 15 | } |
@@ -10,12 +10,12 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class ProductsCategories extends Model |
| 12 | 12 | { |
| 13 | - /** |
|
| 14 | - * Model table. |
|
| 15 | - * |
|
| 16 | - * @var string |
|
| 17 | - */ |
|
| 18 | - protected $table = 'products_categories'; |
|
| 13 | + /** |
|
| 14 | + * Model table. |
|
| 15 | + * |
|
| 16 | + * @var string |
|
| 17 | + */ |
|
| 18 | + protected $table = 'products_categories'; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * Mass-assign fields |
@@ -8,27 +8,27 @@ |
||
| 8 | 8 | |
| 9 | 9 | class AssetsController extends Controller |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * AssetsController constructor. |
|
| 13 | - */ |
|
| 14 | - public function __construct() |
|
| 15 | - { |
|
| 16 | - $this->middleware('auth'); |
|
| 17 | - $this->middleware('lang'); |
|
| 18 | - } |
|
| 11 | + /** |
|
| 12 | + * AssetsController constructor. |
|
| 13 | + */ |
|
| 14 | + public function __construct() |
|
| 15 | + { |
|
| 16 | + $this->middleware('auth'); |
|
| 17 | + $this->middleware('lang'); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - public function index() |
|
| 21 | - { |
|
| 20 | + public function index() |
|
| 21 | + { |
|
| 22 | 22 | return view('assets.index'); |
| 23 | - } |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function edit() |
|
| 26 | - { |
|
| 25 | + public function edit() |
|
| 26 | + { |
|
| 27 | 27 | return view('assets.edit'); |
| 28 | - } |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - public function remove() |
|
| 31 | - { |
|
| 30 | + public function remove() |
|
| 31 | + { |
|
| 32 | 32 | |
| 33 | - } |
|
| 33 | + } |
|
| 34 | 34 | } |
@@ -8,29 +8,29 @@ |
||
| 8 | 8 | |
| 9 | 9 | class SegmentsController extends Controller |
| 10 | 10 | { |
| 11 | - public function __construct() |
|
| 12 | - { |
|
| 13 | - $this->middleware('auth'); |
|
| 14 | - $this->middleware('lang'); |
|
| 15 | - } |
|
| 16 | - |
|
| 17 | - public function index() |
|
| 18 | - { |
|
| 11 | + public function __construct() |
|
| 12 | + { |
|
| 13 | + $this->middleware('auth'); |
|
| 14 | + $this->middleware('lang'); |
|
| 15 | + } |
|
| 16 | + |
|
| 17 | + public function index() |
|
| 18 | + { |
|
| 19 | 19 | return view('segments.index'); |
| 20 | - } |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - public function store() |
|
| 23 | - { |
|
| 22 | + public function store() |
|
| 23 | + { |
|
| 24 | 24 | return view('segments.register'); |
| 25 | - } |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - public function edit() |
|
| 28 | - { |
|
| 27 | + public function edit() |
|
| 28 | + { |
|
| 29 | 29 | return view('segments.edit'); |
| 30 | - } |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - public function update() |
|
| 33 | - { |
|
| 32 | + public function update() |
|
| 33 | + { |
|
| 34 | 34 | |
| 35 | - } |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -64,36 +64,36 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | if ($user->is('Manager') || $user->is('Administrator')) |
| 66 | 66 | { |
| 67 | - $password = $faker->password; |
|
| 68 | - // Save the user to the database. |
|
| 69 | - $NewUser = User::create( |
|
| 67 | + $password = $faker->password; |
|
| 68 | + // Save the user to the database. |
|
| 69 | + $NewUser = User::create( |
|
| 70 | 70 | [ |
| 71 | - 'fname' => $input->fname, |
|
| 72 | - 'name' => $input->name, |
|
| 73 | - 'email' => $input->email, |
|
| 74 | - 'password' => \Hash::make($password), |
|
| 75 | - 'biography' => nl2br($input->biography), |
|
| 71 | + 'fname' => $input->fname, |
|
| 72 | + 'name' => $input->name, |
|
| 73 | + 'email' => $input->email, |
|
| 74 | + 'password' => \Hash::make($password), |
|
| 75 | + 'biography' => nl2br($input->biography), |
|
| 76 | 76 | ] |
| 77 | - )->id; |
|
| 78 | - // Assign the user to the selected department |
|
| 77 | + )->id; |
|
| 78 | + // Assign the user to the selected department |
|
| 79 | 79 | User::find($NewUser)->departments()->attach($input->department); |
| 80 | - // Assign the user to the selected role. |
|
| 80 | + // Assign the user to the selected role. |
|
| 81 | 81 | Bouncer::assign($input->role)->to($user); |
| 82 | - // Send a confirmation mail to the user. |
|
| 82 | + // Send a confirmation mail to the user. |
|
| 83 | 83 | Mail::send('emails.welcome', ['user' => $NewUser, 'password' => $password], function ($message) use ($user) |
| 84 | 84 | { |
| 85 | - $message->from(env('MAIL_USERNAME')); |
|
| 86 | - $message->to('[email protected]', 'John Smith')->subject('Welcome to Ring Me!'); |
|
| 85 | + $message->from(env('MAIL_USERNAME')); |
|
| 86 | + $message->to('[email protected]', 'John Smith')->subject('Welcome to Ring Me!'); |
|
| 87 | 87 | } |
| 88 | - ); |
|
| 89 | - session()->flash('message', 'The new user has been created and is assigned to his department and role.'); |
|
| 90 | - return redirect("staff"); |
|
| 91 | - } |
|
| 92 | - else |
|
| 93 | - { |
|
| 94 | - return redirect()->back(302); |
|
| 95 | - } |
|
| 96 | - } |
|
| 88 | + ); |
|
| 89 | + session()->flash('message', 'The new user has been created and is assigned to his department and role.'); |
|
| 90 | + return redirect("staff"); |
|
| 91 | + } |
|
| 92 | + else |
|
| 93 | + { |
|
| 94 | + return redirect()->back(302); |
|
| 95 | + } |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | 99 | * Update the staff member. |
@@ -128,10 +128,10 @@ discard block |
||
| 128 | 128 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
| 129 | 129 | */ |
| 130 | 130 | public function index() |
| 131 | - { |
|
| 131 | + { |
|
| 132 | 132 | $data["departments"] = Departments::all(); |
| 133 | - $data['users'] = User::paginate(15); |
|
| 134 | - return view('users/index', $data); |
|
| 133 | + $data['users'] = User::paginate(15); |
|
| 134 | + return view('users/index', $data); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | { |
| 172 | 172 | $id = auth()->user()->id; |
| 173 | 173 | $data['tokens'] = ApiKey::where('user_id', $id)->get(); |
| 174 | - return view('users/profile', $data); |
|
| 174 | + return view('users/profile', $data); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /** |
@@ -193,11 +193,11 @@ discard block |
||
| 193 | 193 | session()->flash('message', 'The user has been removed.'); |
| 194 | 194 | |
| 195 | 195 | return redirect()->to('/staff'); |
| 196 | - } |
|
| 197 | - else |
|
| 198 | - { |
|
| 196 | + } |
|
| 197 | + else |
|
| 198 | + { |
|
| 199 | 199 | return redirect()->back(); |
| 200 | - } |
|
| 200 | + } |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | public function get_roles() |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $data2 = []; |
| 207 | 207 | foreach($items as $role) |
| 208 | 208 | { |
| 209 | - $data2[] = [ |
|
| 209 | + $data2[] = [ |
|
| 210 | 210 | 'value' => $role["id"], |
| 211 | 211 | 'text' => $role["name"] |
| 212 | 212 | ]; |