chore: refactor account model (#3570)

This commit is contained in:
Regis Freyd
2020-02-13 10:48:51 -05:00
committed by GitHub
parent 2e8a597c27
commit 5bf26262dc
45 changed files with 837 additions and 696 deletions
@@ -2,14 +2,16 @@
namespace App\Http\Controllers\Contacts;
use Illuminate\View\View;
use App\Helpers\DateHelper;
use App\Helpers\FormHelper;
use Illuminate\Http\Request;
use App\Helpers\GendersHelper;
use App\Helpers\GenderHelper;
use App\Models\Contact\Contact;
use Illuminate\Support\Collection;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\RedirectResponse;
use App\Models\Relationship\Relationship;
use Illuminate\Support\Facades\Validator;
use App\Services\Contact\Contact\CreateContact;
@@ -26,7 +28,7 @@ class RelationshipsController extends Controller
*
* @param Contact $contact
*
* @return \Illuminate\View\View
* @return View
*/
public function create(Request $request, Contact $contact)
{
@@ -35,7 +37,7 @@ class RelationshipsController extends Controller
return view('people.relationship.new')
->withContact($contact)
->withPartner(new Contact)
->withGenders(GendersHelper::getGendersInput())
->withGenders(GenderHelper::getGendersInput())
->withRelationshipTypes($this->getRelationshipTypesList($contact))
->withDefaultGender(auth()->user()->account->default_gender_id)
->withDays(DateHelper::getListOfDays())
@@ -52,7 +54,7 @@ class RelationshipsController extends Controller
* @param Request $request
* @param Contact $contact
*
* @return \Illuminate\Http\RedirectResponse
* @return RedirectResponse
*/
public function store(Request $request, Contact $contact)
{
@@ -91,7 +93,7 @@ class RelationshipsController extends Controller
* @param Contact $contact
* @param Relationship $relationship
*
* @return \Illuminate\View\View
* @return View
*/
public function edit(Contact $contact, Relationship $relationship)
{
@@ -119,7 +121,7 @@ class RelationshipsController extends Controller
->withDay($day)
->withMonth($month)
->withAge($age)
->withGenders(GendersHelper::getGendersInput())
->withGenders(GenderHelper::getGendersInput())
->withHasBirthdayReminder($hasBirthdayReminder)
->withFormNameOrder(FormHelper::getNameOrderForForms(auth()->user()));
}
@@ -131,7 +133,7 @@ class RelationshipsController extends Controller
* @param Contact $contact
* @param Relationship $relationship
*
* @return \Illuminate\Http\RedirectResponse
* @return RedirectResponse
*/
public function update(Request $request, Contact $contact, Relationship $relationship)
{
@@ -219,7 +221,7 @@ class RelationshipsController extends Controller
* @param Contact $contact
* @param Relationship $relationship
*
* @return \Illuminate\Http\RedirectResponse
* @return RedirectResponse
*/
public function destroy(Contact $contact, Relationship $relationship)
{