Файловый менеджер - Редактировать - /home/clickysoft/public_html/travel-guru.clickysoft.net/app/Admin/TopTenDestinationController.php
Назад
<?php namespace App\Admin; use App\Http\Controllers\Controller; use App\Http\Requests\Admin\TopTenDestinationStoreRequest; use App\Http\Requests\Admin\TopTenDestinationUpdateRequest; use App\Interfaces\TopTenDestinationRepositoryInterface; use App\Models\Destination; use App\Models\TopTenDestination; class TopTenDestinationController extends Controller { private TopTenDestinationRepositoryInterface $topTenDestinationRepository; public function __construct(TopTenDestinationRepositoryInterface $TopTenDestinationRepository) { $this->topTenDestinationRepository = $TopTenDestinationRepository; } public function topTenDestinations() { if (request()->ajax()) { return $this->topTenDestinationRepository->getDataTable(); } return view('admin.top_ten_destinations.index'); } public function add() { $destinations = Destination::where('status', 1)->orderBy('title')->get(); return view('admin.top_ten_destinations.add', compact('destinations')); } public function addData(TopTenDestinationStoreRequest $request) { $this->topTenDestinationRepository->create($request); return redirect()->route('topTenDestinations')->with('success_msg', 'Top 10 destination successfully added.'); } public function update($id) { $topTenDestination = TopTenDestination::find($id); $destinations = Destination::where('status', 1) ->whereNotIn('id', $topTenDestination->destinations->pluck('id')->toArray()) ->orderBy('title') ->get(); return view('admin.top_ten_destinations.update', compact('topTenDestination', 'destinations')); } public function updateData($id, TopTenDestinationUpdateRequest $request) { return $this->topTenDestinationRepository->update($id, $request); } public function changeStatus($id) { return $this->topTenDestinationRepository->changeStatus($id); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка