Skip to content

Commit

Permalink
Apply the "only" method to the providers controller
Browse files Browse the repository at this point in the history
  • Loading branch information
alextselegidis committed Jun 27, 2022
1 parent 680d01d commit 8fde7e5
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions application/controllers/Providers.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,23 @@ public function create()

$provider = request('provider');

$this->providers_model->only($provider, [
'first_name',
'last_name',
'email',
'alt_number',
'phone_number',
'address',
'city',
'state',
'zip_code',
'notes',
'is_private',
'id_roles',
'settings',
'services',
]);

$provider_id = $this->providers_model->save($provider);

$provider = $this->providers_model->find($provider_id);
Expand Down Expand Up @@ -167,6 +184,24 @@ public function update()

$provider = request('provider');

$this->providers_model->only($provider, [
'id',
'first_name',
'last_name',
'email',
'alt_number',
'phone_number',
'address',
'city',
'state',
'zip_code',
'notes',
'is_private',
'id_roles',
'settings',
'services',
]);

$provider_id = $this->providers_model->save($provider);

$provider = $this->providers_model->find($provider_id);
Expand Down

0 comments on commit 8fde7e5

Please sign in to comment.