chore: refactor account model (#3570)
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user