app/Http/Controllers/ClientChannelController.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)
    {   
        $clientChannel = new ClientChannel();
        $clientID            = $request->client;
        $channelID           = $request->clientChannel;
        $client_channel_name = $request->clientChannelName;
        $status              = $request->clientChannelStatusCode;
        $result = $clientChannel->addClientChannel($clientID, $channelID, $client_channel_name, $status);
        if($result) {
             \Session::flash('flash_message','New client channel created successfully.');
        } else {
             \Session::flash('error_message','Error in handling request.');
        }
        return redirect('client_channel');
    }
public function store ( Request $ request ) { $ clientChannel = new ClientChannel ( ) ; $ clientID = $ request -> client ; $ channelID = $ request -> clientChannel ; $ client_channel_name = $ request -> clientChannelName ; $ status = $ request -> clientChannelStatusCode ; $ result = $ clientChannel -> addClientChannel ( $ clientID , $ channelID , $ client_channel_name , $ status ) ; if ( $ result ) { \ Session :: flash ( 'flash_message' , 'New client channel created successfully.' ) ; } else { \ Session :: flash ( 'error_message' , 'Error in handling request.' ) ; } return redirect ( 'client_channel' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// instantiate model class // get params from post request // call function from model to add client to database // redirect to index after save