One Hat Cyber Team
Your IP :
18.118.105.93
Server IP :
104.21.16.1
Server :
Linux agrigation-prod 5.15.0-67-generic #74-Ubuntu SMP Wed Feb 22 14:14:39 UTC 2023 x86_64
Server Software :
nginx/1.24.0
PHP Version :
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
forge
/
gftag.com
/
app
/
Http
/
Controllers
/
Back
/
View File Name :
ServiceController.php
<?php namespace App\Http\Controllers\Back; use App\{ Models\Service, Repositories\Back\ServiceRepository, Http\Requests\ImageStoreRequest, Http\Requests\ImageUpdateRequest, Http\Controllers\Controller }; use Illuminate\Http\Request; class ServiceController extends Controller { /** * Constructor Method. * * Setting Authentication * * @param \App\Repositories\Back\ServiceRepository $repository * */ public function __construct(ServiceRepository $repository) { $this->middleware('auth:admin'); $this->middleware('adminlocalize'); $this->repository = $repository; } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { return view('back.service.index',[ 'datas' => Service::orderBy('id','desc')->get() ]); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { return view('back.service.create'); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $request->validate([ 'title' => 'required|max:100', 'details' => 'required', 'photo' => 'required|image', ]); $this->repository->store($request); return redirect()->route('back.service.index')->withSuccess(__('New Service Added Successfully.')); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(Service $service) { return view('back.service.edit',compact('service')); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, Service $service) { $request->validate([ 'title' => 'required|max:100', 'details' => 'required', 'photo' => 'image', ]); $this->repository->update($service, $request); return redirect()->route('back.service.index')->withSuccess(__('Service Updated Successfully.')); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy(Service $service) { $this->repository->delete($service); return redirect()->route('back.service.index')->withSuccess(__('Service Deleted Successfully.')); } }