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();
        $channelName = $request->channelName;
        $channelCode = $request->channelCode;
        $status      = $request->channelStatusCode;
        $result = $channel->addChannel($channelName, $status, $channelCode);
        if($result) {
             \Session::flash('flash_message','New channel created successfully.');
        } else {
             \Session::flash('error_message','Error in handling request.');
        }
        return redirect('channels');
    }
public function store ( Request $ request ) { $ channel = new Channel ( ) ; $ channelName = $ request -> channelName ; $ channelCode = $ request -> channelCode ; $ status = $ request -> channelStatusCode ; $ result = $ channel -> addChannel ( $ channelName , $ status , $ channelCode ) ; if ( $ result ) { \ Session :: flash ( 'flash_message' , 'New channel created successfully.' ) ; } else { \ Session :: flash ( 'error_message' , 'Error in handling request.' ) ; } return redirect ( 'channels' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// get params from post request // call function from model to save data // redirect to index after save