File: /home/imensosw/www/ezwork/app/Http/Controllers/CountryController.php
<?php
/**
* CountryController 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 App\Models\Country;
use Illuminate\Http\Request;
/**
* CountryController class
*
* The class manage Country
*
* @category CountryController
* @package Ez
* @author Imenso Software <admin@imensosoftware.com>
* @license http://imensosoftware/license.php GNU Public License
* @link http://imensosoftware.com/recipes
*/
class CountryController extends Controller
{
/**
* GetCountries function gets the country list and
* return it in json format.
*
* @param void
* @return json
*/
public function getCountries(): \Illuminate\Http\JsonResponse
{
$countrys = Country::get();
return response()->json(
[
'status' => 'success',
'countrys' => $countrys->toArray(),
],
200
);
}
// end getCountries()
}
// end class