bbec276da8
* #355 Calculate distance button in add/edit Flight page * Styling * Move add/edit flight logic out of controller and into service layer * Styling * Formatting * Run styleci against modules dir * Styleci config * Style fixes in /modules
39 lines
823 B
PHP
39 lines
823 B
PHP
<?php
|
|
|
|
namespace Modules\Sample\Http\Controllers\Api;
|
|
|
|
use App\Contracts\Controller;
|
|
use Illuminate\Http\Request;
|
|
|
|
/**
|
|
* Class SampleController
|
|
*/
|
|
class SampleController extends Controller
|
|
{
|
|
/**
|
|
* Just send out a message
|
|
*
|
|
* @param Request $request
|
|
*
|
|
* @return \Illuminate\Http\JsonResponse
|
|
*/
|
|
public function index(Request $request)
|
|
{
|
|
return $this->message('Hello, world!');
|
|
}
|
|
|
|
/**
|
|
* @param Request $request
|
|
*
|
|
* @return \Illuminate\Http\JsonResponse
|
|
*/
|
|
public function hello(Request $request)
|
|
{
|
|
// Another way to return JSON, this for a custom response
|
|
// It's recommended to use Resources for responses from the database
|
|
return response()->json([
|
|
'name' => Auth::user()->name,
|
|
]);
|
|
}
|
|
}
|