One Hat Cyber Team
Your IP :
3.21.186.117
Server IP :
104.21.80.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 :
BrandController.php
<?php namespace App\Http\Controllers\Back; use App\{ Models\Brand, Repositories\Back\BrandRepository, Http\Requests\BrandRequest, Http\Controllers\Controller }; class BrandController extends Controller { /** * Constructor Method. * * Setting Authentication * * @param \App\Repositories\Back\BrandRepository $repository * */ public function __construct(BrandRepository $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.brand.index',[ 'datas' => Brand::orderBy('id','desc')->get() ]); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { return view('back.brand.create'); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(BrandRequest $request) { $this->repository->store($request); return redirect()->route('back.brand.index')->withSuccess(__('New Brand Added Successfully.')); } /** * Change the status for editing the specified resource. * * @param int $id * @param int $status * @return \Illuminate\Http\Response */ public function status($id,$status,$type) { Brand::find($id)->update([$type => $status]); return redirect()->route('back.brand.index')->withSuccess(__('Status Updated Successfully.')); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(Brand $brand) { return view('back.brand.edit',compact('brand')); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(BrandRequest $request, Brand $brand) { $this->repository->update($brand, $request); return redirect()->route('back.brand.index')->withSuccess(__('Brand Updated Successfully.')); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy(Brand $brand) { $this->repository->delete($brand); return redirect()->route('back.brand.index')->withSuccess(__('Brand Deleted Successfully.')); } }