PATH:
home
/
lab2454c
/
sothebry.softkinesis.com
/
backups
/
backup
/
core
/
app
/
Http
/
Controllers
/
Admin
<?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Models\FaqContent; class FaqContentController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $data['pageTitle'] = 'FAQ List'; $data['faqContents'] = FaqContent::all(); return view('admin.frontend.faqContent.index', $data); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $data['pageTitle'] = 'Add FAQ'; return view('admin.frontend.faqContent.create', $data); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $values = $request->validate([ 'question'=> 'required|string|max:300', 'answer'=> 'required|string|max:500', ]); $faqContent = new FaqContent(); $faqContent->fill($values); $faqContent->save(); $notify[] = ['success', 'FAQ has been Added']; return redirect()->route('admin.frontend.faqContent.index')->withNotify($notify); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(FaqContent $faqContent) { $data['pageTitle'] = 'Edit Moment Content'; $data['faqContent'] = $faqContent; return view('admin.frontend.faqContent.edit', $data); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, FaqContent $faqContent) { $changed = false; $values = $request->validate([ 'question'=> 'required|string|max:300', 'answer'=> 'required|string|max:500', ]); $faqContent->fill($values); if ($faqContent->isDirty()) { $changed = true; $faqContent->save(); } if (! $changed) { $notify[] = ['warning', 'No changes done to save']; return redirect()->route('admin.frontend.faqContent.index')->withNotify($notify); } $notify[] = ['success', 'FAQ has been Updated']; return redirect()->route('admin.frontend.faqContent.index')->withNotify($notify); } }
[-] SubcategoryController.php
[edit]
[-] CategoryController.php
[edit]
[-] FrontendController.php
[edit]
[-] PageBuilderController.php
[edit]
[-] WithdrawalController.php
[edit]
[-] SupportTicketController.php
[edit]
[-] SpecificationController.php
[edit]
[-] AdvertisementController.php
[edit]
[+]
..
[-] HomeImageController.php
[edit]
[-] DepositController.php
[edit]
[-] ProductContentController.php
[edit]
[-] ExtensionController.php
[edit]
[-] MomentContentController.php
[edit]
[-] DynamicPageController.php
[edit]
[-] ManageUsersController.php
[edit]
[-] ReportController.php
[edit]
[-] GatewayController.php
[edit]
[-] EmailTemplateController.php
[edit]
[-] FaqContentController.php
[edit]
[-] OrderController.php
[edit]
[-] BrandController.php
[edit]
[-] ManualGatewayController.php
[edit]
[-] AdminController.php
[edit]
[+]
Auth
[-] LanguageController.php
[edit]
[-] WithdrawMethodController.php
[edit]
[-] FashionNftController.php
[edit]
[-] GeneralSettingController.php
[edit]
[-] ProductController.php
[edit]
[-] SmsTemplateController.php
[edit]