forked from eatvio/eatvio-infra
Merge pull request 'main' (#4) from eatvio/eatvio:main into main
Reviewed-on: maxxkim/eatvio#4
This commit is contained in:
@@ -4,18 +4,14 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\BlogPost;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
/* use Spatie\QueryBuilder\AllowedFilter; */
|
||||
/* use Spatie\QueryBuilder\QueryBuilder; */
|
||||
|
||||
class BlogPostController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): View
|
||||
{
|
||||
// if ($request->has('author')) {
|
||||
// $author = $request->get('author');
|
||||
@@ -31,31 +27,12 @@ class BlogPostController extends Controller
|
||||
return view('blog_post/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
public function create(): View
|
||||
{
|
||||
return view('blog_post/edit_form');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(BlogPost $blogPost)
|
||||
public function show(BlogPost $blogPost): View
|
||||
{
|
||||
$data['author'] = $blogPost->author()->first();
|
||||
$data['tags'] = $blogPost->tags()->get();
|
||||
@@ -67,34 +44,11 @@ class BlogPostController extends Controller
|
||||
->cooldown($expiresAt)
|
||||
->record();
|
||||
|
||||
echo view('blog_post/show', $data);
|
||||
return view('blog_post/show', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(BlogPost $blogPost)
|
||||
public function edit(BlogPost $blogPost): View
|
||||
{
|
||||
return view('blog_post/edit_form', ['blogPost' => $blogPost]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, BlogPost $blogPost)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(BlogPost $blogPost)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,29 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Calendar;
|
||||
use App\Models\Diary;
|
||||
use Carbon\Carbon;
|
||||
use Carbon\CarbonPeriod;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
|
||||
|
||||
class CalendarController extends Controller
|
||||
{
|
||||
public $weekStartsAt;
|
||||
public int $weekStartsAt;
|
||||
|
||||
public $weekEndsAt;
|
||||
public int $weekEndsAt;
|
||||
|
||||
public $startsAt;
|
||||
public Carbon $startsAt;
|
||||
|
||||
public $endsAt;
|
||||
public Carbon $endsAt;
|
||||
|
||||
public $gridStartsAt;
|
||||
public Carbon $gridStartsAt;
|
||||
|
||||
public $gridEndsAt;
|
||||
public Carbon $gridEndsAt;
|
||||
|
||||
public function __construct($initialYear = null, $initialMonth = null, $weekStartsAt = null)
|
||||
public function __construct(?int $initialYear = null, ?int $initialMonth = null, ?int $weekStartsAt = null)
|
||||
{
|
||||
$this->weekStartsAt = $weekStartsAt ?? Carbon::MONDAY;
|
||||
$this->weekEndsAt = $this->weekStartsAt === Carbon::MONDAY
|
||||
@@ -39,18 +39,13 @@ class CalendarController extends Controller
|
||||
$this->calculateGridStartsEnds();
|
||||
}
|
||||
|
||||
public function calculateGridStartsEnds()
|
||||
public function calculateGridStartsEnds(): void
|
||||
{
|
||||
$this->gridStartsAt = $this->startsAt->clone()->startOfWeek($this->weekStartsAt);
|
||||
$this->gridEndsAt = $this->endsAt->clone()->endOfWeek($this->weekEndsAt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
public function index(): View|ViewFactory
|
||||
{
|
||||
$curUser = Auth::user();
|
||||
$fullGridPeriod = CarbonPeriod::create(
|
||||
@@ -58,8 +53,9 @@ class CalendarController extends Controller
|
||||
'1 day',
|
||||
$this->gridEndsAt
|
||||
);
|
||||
|
||||
$filledDays = Diary::where('user_id', $curUser->id)
|
||||
->whereMonth('date', now()->month)
|
||||
->whereMonth('date', (string) now()->month)
|
||||
->get()
|
||||
->keyBy('date');
|
||||
|
||||
@@ -73,58 +69,4 @@ class CalendarController extends Controller
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Calendar $calendar)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Calendar $calendar)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, Calendar $calendar)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Calendar $calendar)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,67 +2,14 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Events\ChatMessageUpdated;
|
||||
use App\Models\Chat;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ChatMessage
|
||||
{
|
||||
public $id;
|
||||
|
||||
public $payload;
|
||||
|
||||
public function __construct($id, $payload)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->payload = $payload;
|
||||
}
|
||||
|
||||
public function someRandomFillFunction()
|
||||
{
|
||||
$users1 = User::all()->pluck('id');
|
||||
$users2 = User::all()->pluck('id');
|
||||
$faker = Faker\Factory::create();
|
||||
|
||||
$users1->each(
|
||||
function ($user1, $key) use ($faker, $users2) {
|
||||
$users2->each(
|
||||
function ($user2) use ($faker, $user1) {
|
||||
if ($user1 === $user2) {
|
||||
return;
|
||||
}
|
||||
$data1 = [
|
||||
'from_user_id' => $user2,
|
||||
'to_user_id' => $user1,
|
||||
'data' => $faker->text(),
|
||||
];
|
||||
|
||||
$data2 = [
|
||||
'from_user_id' => $user1,
|
||||
'to_user_id' => $user2,
|
||||
'data' => $faker->text(),
|
||||
];
|
||||
|
||||
$newMessage = (new Chat())->forceFill($data1);
|
||||
$newMessage->save();
|
||||
$newMessage = (new Chat())->forceFill($data2);
|
||||
$newMessage->save();
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class ChatController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
public function index(): View|ViewFactory
|
||||
{
|
||||
// $_ = "from_user_id to_user_id";
|
||||
$curUserId = Auth()->user()->id;
|
||||
@@ -96,32 +43,7 @@ class ChatController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
ChatMessageUpdated::dispatch(new ChatMessage(time(), 'some text '.md5(time())));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Models\Chat $chat
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(int $lastChatUser)
|
||||
public function show(int $lastChatUser): View|ViewFactory
|
||||
{
|
||||
$lastChatUser = User::find($lastChatUser);
|
||||
// $_ = "from_user_id to_user_id";
|
||||
@@ -149,34 +71,7 @@ class ChatController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(chat $chat)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, chat $chat)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(chat $chat)
|
||||
{
|
||||
}
|
||||
|
||||
private function makeChanName($from, $to)
|
||||
private function makeChanName(?int $from = null, ?int $to = null): string
|
||||
{
|
||||
return (int) $from < (int) $to
|
||||
? $from.'_'.$to
|
||||
|
||||
@@ -2,75 +2,12 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class ConsultantController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
public function index(): View
|
||||
{
|
||||
return view('consultant.list');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,43 +3,11 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Diary;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class ConsultantDiaryCommentController 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.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Diary $diary)
|
||||
public function show(Diary $diary): View
|
||||
{
|
||||
$data = [
|
||||
'daysCount' => 1,
|
||||
@@ -49,12 +17,7 @@ class ConsultantDiaryCommentController extends Controller
|
||||
return view('diary.consultant_comments', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Diary $diary)
|
||||
public function edit(Diary $diary): View
|
||||
{
|
||||
$curMeals = $diary->meals()->orderBy('type')->get();
|
||||
$typeNames = [
|
||||
@@ -75,23 +38,4 @@ class ConsultantDiaryCommentController extends Controller
|
||||
|
||||
return view('diary.consultant_comments_edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, Diary $diary)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\Diary $consultantDiaryComment
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Diary $diary)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,27 +3,18 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class ConsultantRequestFormController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
public function index(): View
|
||||
{
|
||||
return view('consultant.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
public function create(): View | RedirectResponse
|
||||
{
|
||||
$user = Auth::user();
|
||||
$state = $user->consultant_state;
|
||||
@@ -40,21 +31,7 @@ class ConsultantRequestFormController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(User $user)
|
||||
public function show(User $user): View
|
||||
{
|
||||
$requestData = $user->consultant_request;
|
||||
$medicalEducations = $requestData ? json_decode($requestData->completed_courses, true) : [];
|
||||
@@ -72,12 +49,7 @@ class ConsultantRequestFormController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(User $user)
|
||||
public function edit(User $user): View
|
||||
{
|
||||
// dd($user);
|
||||
// return redirect()->route('consultant_request.show', [$user]);
|
||||
@@ -91,22 +63,4 @@ class ConsultantRequestFormController extends Controller
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, User $user)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(User $user)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,17 +3,14 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Diary;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class DiaryController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
public function index(): RedirectResponse
|
||||
{
|
||||
/* return view('diary.index'); */
|
||||
$curDiary = $this->getCurrentDiary();
|
||||
@@ -22,32 +19,12 @@ class DiaryController extends Controller
|
||||
return redirect()->route('diary.edit', $curDiary);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
public function store(Request $request): void
|
||||
{
|
||||
dd($request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Diary $diary)
|
||||
public function show(Diary $diary): View
|
||||
{
|
||||
/* $curDiary = Diary::find($id); */
|
||||
$daysCount = Diary::where('user_id', auth()->id())->count();
|
||||
@@ -55,13 +32,7 @@ class DiaryController extends Controller
|
||||
return view('diary.show', ['curDiary' => $diary, 'daysCount' => $daysCount]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
public function edit(int $id): View
|
||||
{
|
||||
$curDiary = Diary::find($id);
|
||||
$daysCount = Diary::where('user_id', auth()->id())->count();
|
||||
@@ -76,13 +47,7 @@ class DiaryController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
public function update(Request $request, int $id): RedirectResponse
|
||||
{
|
||||
/* dd($request, $id, $request->input()); */
|
||||
$curDiary = Diary::find($id);
|
||||
@@ -95,17 +60,7 @@ class DiaryController extends Controller
|
||||
return redirect()->route('diary.show', $id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
}
|
||||
|
||||
private function getCurrentDiary()
|
||||
private function getCurrentDiary(): Diary
|
||||
{
|
||||
$curUserId = Auth::id();
|
||||
$curDiary = Diary::userToDayItem($curUserId)->first();
|
||||
@@ -117,14 +72,14 @@ class DiaryController extends Controller
|
||||
return $this->newDiary($curUserId);
|
||||
}
|
||||
|
||||
private function newDiary($curUserId)
|
||||
private function newDiary(int $curUserId): Diary
|
||||
{
|
||||
$curDiary = new Diary();
|
||||
$curDiary->date = now()->setTimezone('3')->format('Y-m-d');
|
||||
$curDiary->wakeup = '06:30';
|
||||
$curDiary->retire = '22:30';
|
||||
$curDiary->user_id = $curUserId;
|
||||
$curDiary->closed = false;
|
||||
$curDiary->closed = (int) false;
|
||||
$curDiary->comment = '';
|
||||
$curDiary->save();
|
||||
|
||||
|
||||
@@ -5,17 +5,13 @@ namespace App\Http\Controllers;
|
||||
use App\Models\Diet;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
use Spatie\QueryBuilder\AllowedFilter;
|
||||
use Spatie\QueryBuilder\QueryBuilder;
|
||||
|
||||
class DietController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): View
|
||||
{
|
||||
$hasTypes = [];
|
||||
if ($request->has('author')) {
|
||||
@@ -48,27 +44,17 @@ class DietController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
public function create(): View
|
||||
{
|
||||
return view('diet/edit_form');
|
||||
}
|
||||
|
||||
public function edit(Diet $diet)
|
||||
public function edit(Diet $diet): View
|
||||
{
|
||||
return view('diet/edit_form', ['diet' => $diet]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Diet $diet)
|
||||
public function show(Diet $diet): View
|
||||
{
|
||||
$expiresAt = now()->addHours(24);
|
||||
|
||||
|
||||
@@ -3,77 +3,15 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Services\FeedService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class FeedController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
public function index(): View | ViewFactory
|
||||
{
|
||||
$feed = (new FeedService())->showActualFeed();
|
||||
|
||||
return view('feed.index', ['posts' => $feed]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,71 +2,6 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Finance;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FinanceController 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.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Finance $finance)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Finance $finance)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, Finance $finance)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Finance $finance)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,16 +4,13 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Plan;
|
||||
use App\Models\User;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PlanController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): View|ViewFactory
|
||||
{
|
||||
if ($request->has('author')) {
|
||||
$author = $request->get('author');
|
||||
@@ -26,31 +23,12 @@ class PlanController extends Controller
|
||||
return view('plan/index', ['plans' => $plans]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
public function create(): View|ViewFactory
|
||||
{
|
||||
return view('plan/edit_form');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Plan $plan)
|
||||
public function show(Plan $plan): View|ViewFactory
|
||||
{
|
||||
$expiresAt = now()->addHours(24);
|
||||
|
||||
@@ -58,58 +36,11 @@ class PlanController extends Controller
|
||||
->cooldown($expiresAt)
|
||||
->record();
|
||||
|
||||
// $options1 = $this->unserializeOptions($plan->packet1_options);
|
||||
// $options2 = $this->unserializeOptions($plan->packet2_options);
|
||||
// $options3 = $this->unserializeOptions($plan->packet2_options);
|
||||
// $options1 = $plan->packet1_options;
|
||||
// $options2 = $plan->packet2_options;
|
||||
// $options3 = $plan->packet2_options;
|
||||
|
||||
return view(
|
||||
'plan/show',
|
||||
[
|
||||
'plan' => $plan,
|
||||
// 'options1' => $options1,
|
||||
// 'options2' => $options2,
|
||||
// 'options3' => $options3,
|
||||
]
|
||||
);
|
||||
return view('plan/show', ['plan' => $plan]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Plan $plan)
|
||||
public function edit(Plan $plan): View|ViewFactory
|
||||
{
|
||||
return view('plan/edit_form', ['plan' => $plan]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, Plan $plan)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Plan $plan)
|
||||
{
|
||||
}
|
||||
|
||||
private function unserializeOptions($str)
|
||||
{
|
||||
if (preg_match('/^".*"$/', $str)) {
|
||||
return json_decode(stripslashes(mb_substr($str, 1, -1)), true);
|
||||
}
|
||||
|
||||
return json_decode(stripslashes($str), true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,35 +3,22 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\ProductNutritionalValue;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class ProductNutritionalValueController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
public function index(): View|ViewFactory
|
||||
{
|
||||
return view('product_nutritional/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
public function create(): View|ViewFactory
|
||||
{
|
||||
return view('product_nutritional/create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(ProductNutritionalValue $productNutritionalValue)
|
||||
public function show(ProductNutritionalValue $productNutritionalValue): View|ViewFactory
|
||||
{
|
||||
return view(
|
||||
'product_nutritional/show',
|
||||
@@ -39,22 +26,8 @@ class ProductNutritionalValueController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(ProductNutritionalValue $productNutritionalValue)
|
||||
public function edit(ProductNutritionalValue $productNutritionalValue): View|ViewFactory
|
||||
{
|
||||
return view('product_nutritional/edit', ['productNutritionalValue' => $productNutritionalValue]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(ProductNutritionalValue $productNutritionalValue)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,18 +3,13 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\UserDetailz;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class ProfileController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
public function index(): View|ViewFactory
|
||||
{
|
||||
$user = Auth::user();
|
||||
$userPosts = $user
|
||||
@@ -41,30 +36,7 @@ class ProfileController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(User $user)
|
||||
public function show(User $user): View|ViewFactory
|
||||
{
|
||||
$expiresAt = now()->addHours(24);
|
||||
$userPosts = $user
|
||||
@@ -94,31 +66,4 @@ class ProfileController extends Controller
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(UserDetailz $userDetailz)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, UserDetailz $userDetailz)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(UserDetailz $userDetailz)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,35 +3,22 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Recipe;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class RecipeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
public function index(): View|ViewFactory
|
||||
{
|
||||
return view('recipe/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
public function create(): View|ViewFactory
|
||||
{
|
||||
return view('recipe/edit_form');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Recipe $recipe)
|
||||
public function show(Recipe $recipe): View|ViewFactory
|
||||
{
|
||||
$data = [
|
||||
'author' => $recipe->author()->first(),
|
||||
@@ -48,12 +35,7 @@ class RecipeController extends Controller
|
||||
return view('recipe/show', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Recipe $recipe)
|
||||
public function edit(Recipe $recipe): View|ViewFactory
|
||||
{
|
||||
return view('recipe/edit_form', ['recipe' => $recipe]);
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
|
||||
class RegistrationStartController extends Controller
|
||||
{
|
||||
public function start()
|
||||
public function start(): RedirectResponse
|
||||
{
|
||||
session()->flush();
|
||||
|
||||
|
||||
@@ -3,72 +3,13 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\UserDetailz;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class UserController 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.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(User $user)
|
||||
{
|
||||
/* return view('user.show', ['user' => $user]); */
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(UserDetailz $userDetailz)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, UserDetailz $userDetailz)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(UserDetailz $userDetailz)
|
||||
public function show(User $user): View|ViewFactory
|
||||
{
|
||||
return view('user.show', ['user' => $user]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,44 +3,12 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\UserDetailz;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
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.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Models\User $user
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(UserDetailz $userDetailz)
|
||||
public function show(UserDetailz $userDetailz): View|ViewFactory
|
||||
{
|
||||
$regFormKeys = [
|
||||
'first_name' => __('reg_form.first_name'),
|
||||
@@ -82,12 +50,7 @@ class UserDetailzController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(UserDetailz $userDetailz)
|
||||
public function edit(UserDetailz $userDetailz): View|ViewFactory
|
||||
{
|
||||
$regFormKeys = [
|
||||
'first_name' => __('reg_form.first_name'),
|
||||
@@ -152,22 +115,4 @@ class UserDetailzController extends Controller
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, UserDetailz $userDetailz)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(UserDetailz $userDetailz)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user