⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.45
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
dnc
/
@core
/
app
/
Http
/
Controllers
/
View File Name :
PricePlanController.php
<?php namespace App\Http\Controllers; use App\Language; use App\PricePlan; use Illuminate\Http\Request; class PricePlanController extends Controller { public function __construct() { $this->middleware('auth:admin'); } public function index(){ $variant = (get_static_option('home_page_variant') == '06')? 'two' : 'one' ; $all_price_plan = PricePlan::where('variant',$variant)->get()->groupBy('lang'); $all_languages = Language::all(); $home_page_variant = get_static_option('home_page_variant'); return view('backend.pages.price-plan')->with([ 'all_price_plan' => $all_price_plan, 'all_languages' => $all_languages, 'home_page_variant' => $home_page_variant ]); } public function store(Request $request){ $this->validate($request,[ 'title' => 'required|string|max:191', 'price' => 'required|string|max:191', 'type' => 'required|string|max:191', 'btn_text' => 'required|string|max:191', 'btn_url' => 'nullable|string|max:191', 'features' => 'required|string', 'lang' => 'required|string', 'image' => 'required|string' ]); PricePlan::create([ 'title' => $request->title, 'price' => $request->price, 'type' => $request->type , 'btn_text' => $request->btn_text, 'btn_url' => $request->btn_url, 'features' => $request->features, 'lang' => $request->lang , 'image' => $request->image, 'variant' =>(get_static_option('home_page_variant') == '06')? 'two' : 'one' ]); return redirect()->back()->with(['msg' => __('New Price Plan Added'),'type' => 'success']); } public function update(Request $request){ $this->validate($request,[ 'title' => 'required|string|max:191', 'price' => 'required|string|max:191', 'type' => 'required|string|max:191', 'btn_text' => 'required|string|max:191', 'btn_url' => 'nullable|string|max:191', 'features' => 'required|string', 'lang' => 'required|string', 'image' => 'required|string' ]); PricePlan::find($request->id)->update($request->all()); return redirect()->back()->with(['msg' => __('Price Plan Updated'),'type' => 'success']); } public function delete($id){ PricePlan::find($id)->delete(); return redirect()->back()->with(['msg' => __('Delete Success'),'type' => 'danger']); } public function bulk_action(Request $request){ $all = PricePlan::find($request->ids); foreach($all as $item){ $item->delete(); } return response()->json(['status' => 'ok']); } }