app/Http/Controllers/soporte/ClienteController.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(StoreCliente $request)
    {
        try {
            $cliente = Cliente::Create($request->all());
            if ($request->ffoto) {
                $image = $request->file('ffoto')->store('public/image');
                $url = Storage::url($image);
                $cliente->ffoto = $url;
            }
            if ($request->fcedula1) {
                $cedula1 = $request->file('fcedula1')->store('public/cedula1');
                $urll = Storage::url($cedula1);
                $cliente->fcedula1 = $urll;
            }
            if ($request->fcedula2) {
                $cedula2 = $request->file('fcedula2')->store('public/cedula2');
                $urlll = Storage::url($cedula2);
                $cliente->fcedula2 = $urlll;
            }
            $cliente->save();
            return redirect()->route('clientes.index');
        } catch (\Exception $exception) {
            return  redirect()->back()->with('error', "Error" . $exception->getMessage());
        }
    }
public function store ( StoreCliente $ request ) { try { $ cliente = Cliente :: Create ( $ request -> all ( ) ) ; if ( $ request -> ffoto ) { $ image = $ request -> file ( 'ffoto' ) -> store ( 'public/image' ) ; $ url = Storage :: url ( $ image ) ; $ cliente -> ffoto = $ url ; } if ( $ request -> fcedula1 ) { $ cedula1 = $ request -> file ( 'fcedula1' ) -> store ( 'public/cedula1' ) ; $ urll = Storage :: url ( $ cedula1 ) ; $ cliente -> fcedula1 = $ urll ; } if ( $ request -> fcedula2 ) { $ cedula2 = $ request -> file ( 'fcedula2' ) -> store ( 'public/cedula2' ) ; $ urlll = Storage :: url ( $ cedula2 ) ; $ cliente -> fcedula2 = $ urlll ; } $ cliente -> save ( ) ; return redirect ( ) -> route ( 'clientes.index' ) ; } catch ( \ Exception $ exception ) { return redirect ( ) -> back ( ) -> with ( 'error' , " Error " . $ exception -> getMessage ( ) ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .
//  $request->foto=$url;