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