<?php

namespace App\Http\Controllers;

use App\Models\Redes;
use Illuminate\Http\Request;

class RedesController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *
     * @param  \App\Models\Redes  $redes
     * @return \Illuminate\Http\Response
     */
    public function show(Redes $redes)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  \App\Models\Redes  $redes
     * @return \Illuminate\Http\Response
     */
    public function edit()
    {
        $redes = Redes::find(1);
        return view('adm.redes.edit')->with('redes', $redes);
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\Redes  $redes
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request)
    {
        $redes_sociales = Redes::find(1);
        $redes_sociales->linkedin = $request->linkedin;
        $redes_sociales->facebook = $request->facebook;
        $redes_sociales->instagram = $request->instagram;
        $redes_sociales->twitter = $request->twitter;
        $redes_sociales->save();
        $redes = Redes::find(1);
        return redirect()->route('editarRedes')->with('redes', $redes);
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  \App\Models\Redes  $redes
     * @return \Illuminate\Http\Response
     */
    public function destroy(Redes $redes)
    {
        //
    }
}
