diff --git a/app/Http/Controllers/AclController.php b/app/Http/Controllers/AclController.php index 2ddef40f..90d6b963 100755 --- a/app/Http/Controllers/AclController.php +++ b/app/Http/Controllers/AclController.php @@ -178,10 +178,7 @@ public function updateRole($id, Request $request) //Updating Role $role = Role::findOrFail($id); - $role->update(['name' => $request->name, - 'display_name' => $request->display_name, - 'description' => $request->description, - ]); + $role->update($request->only(['name', 'display_name', 'description'])); //Updating permissions for the role $DBpermissions = Permission_role::where('role_id', $id)->select('permission_id')->lists('permission_id'); @@ -248,11 +245,7 @@ public function createPermission() public function storePermission(Request $request) { - Permission::create(['name' => $request->name, - 'display_name' => $request->display_name, - 'description' => $request->description, - 'group_key' => $request->group_key, - ]); + Permission::create($request->only(['name', 'display_name', 'description', 'group_key'])); flash()->success('Permission was successfully created'); @@ -270,11 +263,7 @@ public function updatePermission($id, Request $request) { $permission = Permission::findOrFail($id); - $permission->update(['name' => $request->name, - 'display_name' => $request->display_name, - 'description' => $request->description, - 'group_key' => $request->group_key, - ]); + $permission->update($request->only(['name', 'display_name', 'description', 'group_key'])); flash()->success('Permission was successfully updated'); diff --git a/app/Http/Controllers/ExpensesController.php b/app/Http/Controllers/ExpensesController.php index 916cdb2e..7a94b4b0 100755 --- a/app/Http/Controllers/ExpensesController.php +++ b/app/Http/Controllers/ExpensesController.php @@ -65,12 +65,7 @@ public function create() */ public function store(Request $request) { - $expenseData = ['name' => $request->name, - 'category_id' => $request->category_id, - 'due_date' => $request->due_date, - 'repeat' => $request->repeat, - 'note' => $request->note, - 'amount' => $request->amount, ]; + $expenseData = $request->only(['name', 'category_id', 'due_date', 'repeat', 'note', 'amount',]); $expense = new Expense($expenseData); $expense->createdBy()->associate(Auth::user());