PHP code example of webappid / smartresponse

1. Go to this page and download the library: Download webappid/smartresponse library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

webappid / smartresponse example snippets



use WebAppId\SmartResponse\Response;
use WebAppId\SmartResponse\SmartResponse;

class SampleClass{
    public function getData(Request $request, SmartResponse $smartRespone, Response $response){
        $response->setView('test'); // ex: blade file name test.blade.php
        $response->setData($request);
        return $smartResponse->success($response);
    }
}