⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
crm.dev-unit.com
/
app
/
Http
/
Controllers
/
View File Name :
TaxRateController.php
<?php namespace App\Http\Controllers; use App\Http\Requests\CreateTaxRateRequest; use App\Http\Requests\UpdateTaxRateRequest; use App\Models\TaxRate; use App\Repositories\TaxRateRepository; use Exception; use Illuminate\Contracts\View\Factory; use Illuminate\Http\JsonResponse; use Illuminate\View\View; class TaxRateController extends AppBaseController { /** @var TaxRateRepository */ private $taxRateRepository; public function __construct(TaxRateRepository $taxRateRepo) { $this->taxRateRepository = $taxRateRepo; } /** * Display a listing of the TaxRate. * * @return Factory|View */ public function index() { return view('tax_rates.index'); } /** * Store a newly created TaxRate in storage. * * @param CreateTaxRateRequest $request * @return JsonResponse */ public function store(CreateTaxRateRequest $request) { $input = $request->all(); $taxRate = $this->taxRateRepository->create($input); activity()->performedOn($taxRate)->causedBy(getLoggedInUser()) ->useLog('New Tax Rate created.')->log($taxRate->name.' Tax Rate created.'); return $this->sendSuccess(__('messages.tax_rate.tax_rate_saved_successfully')); } /** * Show the form for editing the specified TaxRate. * * @param TaxRate $taxRate * @return JsonResponse */ public function edit(TaxRate $taxRate) { return $this->sendResponse($taxRate, 'Tax Rate retrieved successfully.'); } /** * Update the specified TaxRate in storage. * * @param TaxRate $taxRate * @param UpdateTaxRateRequest $request * @return JsonResponse */ public function update(TaxRate $taxRate, UpdateTaxRateRequest $request) { $input = $request->all(); $taxRate = $this->taxRateRepository->update($input, $taxRate->id); activity()->performedOn($taxRate)->causedBy(getLoggedInUser()) ->useLog('Tax Rate updated.')->log($taxRate->name.' Tax Rate updated.'); return $this->sendSuccess(__('messages.tax_rate.tax_rate_updated_successfully')); } /** * Remove the specified TaxRate from storage. * * @param TaxRate $taxRate * @return JsonResponse * * @throws Exception */ public function destroy(TaxRate $taxRate) { $taxRate->delete(); return $this->sendSuccess('Tax Rate deleted successfully.'); } }