⚝
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 :
TagController.php
<?php namespace App\Http\Controllers; use App\Http\Requests\CreateTagRequest; use App\Http\Requests\UpdateTagRequest; use App\Models\Tag; use App\Repositories\TagRepository; use Exception; use Illuminate\Contracts\View\Factory; use Illuminate\Http\JsonResponse; use Illuminate\View\View; class TagController extends AppBaseController { /** @var TagRepository */ private $tagRepository; public function __construct(TagRepository $tagRepo) { $this->tagRepository = $tagRepo; } /** * Display a listing of the Tag. * * @return Factory|View */ public function index() { return view('tags.index'); } /** * Store a newly created Tag in storage. * * @param CreateTagRequest $request * @return JsonResponse */ public function store(CreateTagRequest $request) { $input = $request->all(); $tag = $this->tagRepository->create($input); activity()->performedOn($tag)->causedBy(getLoggedInUser()) ->useLog('New Tag created.')->log($tag->name.' Tag created.'); return $this->sendResponse($tag, __('messages.tag.tag_saved_successfully')); } /** * @param Tag $tag * @return mixed */ public function show(Tag $tag) { return $this->sendResponse($tag, 'Tag retrieved successfully.'); } /** * Show the form for editing the specified Tag. * * @param Tag $tag * @return JsonResponse */ public function edit(Tag $tag) { return $this->sendResponse($tag, 'Tag retrieved successfully.'); } /** * Update the specified Tag in storage. * * @param UpdateTagRequest $request * @param Tag $tag * @return JsonResponse */ public function update(UpdateTagRequest $request, Tag $tag) { $input = $request->all(); $tag = $this->tagRepository->update($input, $tag->id); activity()->performedOn($tag)->causedBy(getLoggedInUser()) ->useLog('Tag updated.')->log($tag->name.' Tag updated.'); return $this->sendSuccess(__('messages.tag.tag_updated_successfully')); } /** * Remove the specified Tag from storage. * * @param Tag $tag * @return JsonResponse * * @throws Exception */ public function destroy(Tag $tag) { activity()->performedOn($tag)->causedBy(getLoggedInUser())->useLog('Tag deleted.')->log($tag->name.' Tag deleted.'); $tag->delete(); return $this->sendSuccess('Tag deleted successfully.'); } }