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