app/Http/Controllers/BrandController.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)
    {
        $brand=new brand();
        $brand->brandname=$request->brandname;
        $brand->recharge_code=$request->recharge_code;
        $brand->cashback_percent=$request->cashback_percent;
        $rarefile = $request->file('brandlogo');
        if($rarefile!='')
        {
         $u=time().uniqid(rand());
        $raupload ="img/brandlogo";
        $uplogoimg=$u.$rarefile->getClientOriginalName();
        $success=$rarefile->move($raupload,$uplogoimg);
        $brand->brandlogo = $uplogoimg;
        }
        $brand->save();
        return back();
    }
public function store ( Request $ request ) { $ brand = new brand ( ) ; $ brand -> brandname = $ request -> brandname ; $ brand -> recharge_code = $ request -> recharge_code ; $ brand -> cashback_percent = $ request -> cashback_percent ; $ rarefile = $ request -> file ( 'brandlogo' ) ; if ( $ rarefile != '' ) { $ u = time ( ) . uniqid ( rand ( ) ) ; $ raupload = " img/brandlogo " ; $ uplogoimg = $ u . $ rarefile -> getClientOriginalName ( ) ; $ success = $ rarefile -> move ( $ raupload , $ uplogoimg ) ; $ brand -> brandlogo = $ uplogoimg ; } $ brand -> save ( ) ; return back ( ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .