app/Http/Controllers/ModeloController.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)
    {
        $modelo = $request->input('modelo', null);
        $m = new Modelo();
        $m->nombre = $modelo;
        $m->save();
        $respuesta = [
            'status' => 'correcto',
            'mensaje'=>'Modelo agregado correctamente',
            'modelo'=>$modelo
        ];
        return \response()->json($respuesta,200);
    }
public function store ( Request $ request ) { $ modelo = $ request -> input ( 'modelo' , null ) ; $ m = new Modelo ( ) ; $ m -> nombre = $ modelo ; $ m -> save ( ) ; $ respuesta = [ 'status' => 'correcto' , 'mensaje' => 'Modelo agregado correctamente' , 'modelo' => $ modelo ] ; return \ response ( ) -> json ( $ respuesta , 200 ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .