PHP code example of evandarwin / laravel-jsend

1. Go to this page and download the library: Download evandarwin/laravel-jsend 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/ */

    

evandarwin / laravel-jsend example snippets




return array(
  // ...

  'providers' => array(
    // ...
    'EvanDarwin\JSend\Laravel\ServiceProvider'
  ),

  // ...
);



class YourController extends Controller
{
    public function testStatus()
    {
        return jsend()->success()
                      ->code(100)
                      ->message("Success")
                      ->data(['allGood' => true])
                      ->get();
    }
}
sh
$ php artisan vendor:publish