Viewing file: SocialController.php (2.18 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
namespace App\Http\Controllers\Back;
use App\{ Models\Social, Http\Controllers\Controller };
use Illuminate\Http\Request;
class SocialController extends Controller { /** * Constructor Method. * * Setting Authentication */ public function __construct() { $this->middleware('auth:admin'); $this->middleware('adminlocalize'); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { return view('back.social.index',[ 'datas' => Social::orderBy('id','desc')->get() ]); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { return view('back.social.create'); }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { Social::create($request->all()); return redirect()->route('back.social.index')->withSuccess(__('New Social Link Added Successfully.')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(Social $social) { return view('back.social.edit',compact('social')); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, Social $social) { $social->update($request->all()); return redirect()->route('back.social.index')->withSuccess(__('Social Link Updated Successfully.')); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy(Social $social) { $social->delete(); return redirect()->route('back.social.index')->withSuccess(__('Social Link Deleted Successfully.')); } }
|