File: /home/imensosw/www/ezwork/app/Http/Controllers/ClientController.php
<?php
/**
* ClientController class file
*
* PHP Version 7.2
*
* @category Controller
* @package Ez
* @author Imenso Software <admin@imensosoftware.com>
* @license http://imensosoftware/license.php GNU Public License
* @link http://imensosoftware.com/recipes
*/
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Client;
/**
* ClientController class
*
* The class manage Client
*
* @category ClientController
* @package Ez
* @author Imenso Software <admin@imensosoftware.com>
* @license http://imensosoftware/license.php GNU Public License
* @link http://imensosoftware.com/recipes
*/
class ClientController extends Controller
{
/**
* GetClients function gets the client list and
* return it in json format.
*
* @param void
* @return json
*/
public function getClients(): \Illuminate\Http\JsonResponse
{
$clients = Client::get();
return response()->json(
[
'status' => 'success',
'clients' => $clients->toArray(),
],
200
);
}
// end getClients()
}
// end class