forked from eatvio/eatvio-infra
init commit
This commit is contained in:
184
app/Http/Controllers/UserDetailzController.php
Normal file
184
app/Http/Controllers/UserDetailzController.php
Normal file
@@ -0,0 +1,184 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\UserDetailz;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UserDetailzController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\UserDetailz $userDetailz
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(UserDetailz $userDetailz)
|
||||
{
|
||||
$regFormKeys = [
|
||||
'first_name' => __('reg_form.first_name'),
|
||||
'last_name' => __('reg_form.last_name'),
|
||||
'birthdate' => __('reg_form.date_of_birth'),
|
||||
'gender' => __('reg_form.gender'),
|
||||
'country' => __('reg_form.country'),
|
||||
'city' => __('reg_form.city'),
|
||||
'lang' => __('reg_form.talk_lang'),
|
||||
'weight' => __('reg_form.your_weight'),
|
||||
'chest_circumference' => __('reg_form.chest_circumference'),
|
||||
'waist_circumference' => __('reg_form.waist_circumference'),
|
||||
'hip_circumference' => __('reg_form.hip_circumference'),
|
||||
'blood_pressure_up' => __('reg_form.pressure_up'),
|
||||
'blood_pressure_down' => __('reg_form.pressure_down'),
|
||||
'has_hypo' => __('reg_form.tendency_to_be_hypo'),
|
||||
'has_hyper' => __('reg_form.prone_to_hypertension'),
|
||||
'about_alergy' => __('reg_form.has_alergy'),
|
||||
'about_taking_pils' => __('reg_form.take_pils'),
|
||||
'about_sport_hobbies' => __('reg_form.sport_hobbies'),
|
||||
'favorite_foods' => __('reg_form.favorite_foods'),
|
||||
'unfavorite_foods' => __('reg_form.unfavorite_foods'),
|
||||
'additional_info' => __('reg_form.optional_info')
|
||||
];
|
||||
|
||||
$userAttributes = json_decode(json_encode($userDetailz->user), true);
|
||||
$userDetailzAttributes = json_decode(json_encode($userDetailz), true);
|
||||
|
||||
return view(
|
||||
'profile.detailz_show',
|
||||
[
|
||||
'user' => $userDetailz->user,
|
||||
'userDetailz' => $userDetailz,
|
||||
'regFormKeys' => $regFormKeys,
|
||||
'userAttributes' => $userAttributes,
|
||||
'userDetailzAttributes' => $userDetailzAttributes
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Models\UserDetailz $userDetailz
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(UserDetailz $userDetailz)
|
||||
{
|
||||
$regFormKeys = [
|
||||
'first_name' => __('reg_form.first_name'),
|
||||
'last_name' => __('reg_form.last_name'),
|
||||
'birthdate' => __('reg_form.date_of_birth'),
|
||||
'gender' => __('reg_form.gender'),
|
||||
'country' => __('reg_form.country'),
|
||||
'city' => __('reg_form.city'),
|
||||
'lang' => __('reg_form.talk_lang'),
|
||||
'weight' => __('reg_form.your_weight'),
|
||||
'chest_circumference' => __('reg_form.chest_circumference'),
|
||||
'waist_circumference' => __('reg_form.waist_circumference'),
|
||||
'hip_circumference' => __('reg_form.hip_circumference'),
|
||||
'blood_pressure_up' => __('reg_form.pressure_up'),
|
||||
'blood_pressure_down' => __('reg_form.pressure_down'),
|
||||
'has_hypo' => __('reg_form.tendency_to_be_hypo'),
|
||||
'has_hyper' => __('reg_form.prone_to_hypertension'),
|
||||
'about_alergy' => __('reg_form.has_alergy'),
|
||||
'about_taking_pils' => __('reg_form.take_pils'),
|
||||
'about_sport_hobbies' => __('reg_form.sport_hobbies'),
|
||||
'favorite_foods' => __('reg_form.favorite_foods'),
|
||||
'unfavorite_foods' => __('reg_form.unfavorite_foods'),
|
||||
'additional_info' => __('reg_form.optional_info')
|
||||
];
|
||||
|
||||
$regFormTypes = [
|
||||
'first_name' => 'text',
|
||||
'last_name' => 'text',
|
||||
'birthdate' => 'date',
|
||||
'gender' => 'text',
|
||||
'country' => 'text',
|
||||
'city' => 'text',
|
||||
'lang' => 'text',
|
||||
'weight' => 'number',
|
||||
'chest_circumference' => 'number',
|
||||
'waist_circumference' => 'number',
|
||||
'hip_circumference' => 'number',
|
||||
'blood_pressure_up' => 'number',
|
||||
'blood_pressure_down' => 'number',
|
||||
'has_hypo' => 'text',
|
||||
'has_hyper' => 'text',
|
||||
'about_alergy' => 'text',
|
||||
'about_taking_pils' => 'text',
|
||||
'about_sport_hobbies' => 'text',
|
||||
'favorite_foods' => 'text',
|
||||
'unfavorite_foods' => 'text',
|
||||
'additional_info' => 'text',
|
||||
];
|
||||
|
||||
$userAttributes = json_decode(json_encode($userDetailz->user), true);
|
||||
$userDetailzAttributes = json_decode(json_encode($userDetailz), true);
|
||||
|
||||
return view(
|
||||
'profile.detailz_edit',
|
||||
[
|
||||
'user' => $userDetailz->user,
|
||||
'userDetailz' => $userDetailz,
|
||||
'regFormKeys' => $regFormKeys,
|
||||
'userAttributes' => $userAttributes,
|
||||
'userDetailzAttributes' => $userDetailzAttributes,
|
||||
'regFormTypes' => $regFormTypes,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Models\UserDetailz $userDetailz
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, UserDetailz $userDetailz)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\UserDetailz $userDetailz
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(UserDetailz $userDetailz)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user