app/Http/Controllers/PeriodosController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $request->validate([
            'anio'=>'required',
        ]);
        $periodo = new Periodos();
        $periodo->anio = $request->get('anio');
        $periodo->save();
        return redirect('admin/periodos')->with('success', 'Periodo creado...!');
    }
public function store ( Request $ request ) { $ request -> validate ( [ 'anio' => 'required' , ] ) ; $ periodo = new Periodos ( ) ; $ periodo -> anio = $ request -> get ( 'anio' ) ; $ periodo -> save ( ) ; return redirect ( 'admin/periodos' ) -> with ( 'success' , 'Periodo creado...!' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .