����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 3.145.109.97 Web Server : LiteSpeed System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : gltevjme ( 1095) PHP Version : 7.0.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/gltevjme/gle.gltechlimited.com/app/Http/Controllers/ |
Upload File : |
<?php namespace App\Http\Controllers; use App\Config; use App\MovieComment; use App\MovieSubcomment; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class MovieCommentController extends Controller { public function store(Request $request, $id) { $config = Config::first(); if ($config->comments == 1 && $config->comments_approval == 1) { $status = 0; } else { $status = 1; } if (!is_null($request->email)) { $email = $request->email; } else { $email = Auth::user()->email; } $input = $request->all(); $input['movie_id'] = $id; $input['name'] = Auth::user()->name; $input['email'] = $email; $input['user_id'] = Auth::user()->id; $input['status'] = $status; $data = MovieComment::create($input); return back()->with('success',__('Your Movie Comment has been added')); } public function reply(Request $request, $id) { $user_id = Auth::user()->id; $input = $request->all(); $input['comment_id'] = $id; $input['user_id'] = $user_id; $data = MovieSubcomment::create($input); return back()->with('success', __('Your reply has been added')); } public function deletecomment($id) { $comment_delete = MovieComment::findOrFail($id); if (isset($comment_delete->subcomment)) { foreach ($comment_delete->subcomment as $sub) { $sub->delete(); } } $comment_delete->delete(); return back()->with('deleted', __('Comment has been deleted')); } public function deletesubcomment($cid) { $subcomment = MovieSubcomment::findOrFail($cid); $subcomment->delete(); return back()->with('deleted',__('SubComment has been deleted')); } }