1 |
54fa168c
|
Cajova-Houba
|
<?php
|
2 |
|
|
|
3 |
|
|
/*
|
4 |
|
|
|--------------------------------------------------------------------------
|
5 |
|
|
| Application Routes
|
6 |
|
|
|--------------------------------------------------------------------------
|
7 |
|
|
|
|
8 |
|
|
| Here is where you can register all of the routes for an application.
|
9 |
|
|
| It is a breeze. Simply tell Lumen the URIs it should respond to
|
10 |
|
|
| and give it the Closure to call when that URI is requested.
|
11 |
|
|
|
|
12 |
|
|
*/
|
13 |
|
|
|
14 |
|
|
class TestClass {
|
15 |
|
|
public $someInt = 10;
|
16 |
|
|
public $someDouble = 10.5478;
|
17 |
|
|
public $someString = 'Hell yeah bro!';
|
18 |
|
|
public $someArray = array( "a", "b", 6 => "c", "d", );
|
19 |
|
|
}
|
20 |
|
|
|
21 |
|
|
$router->get('/', function () use ($router) {
|
22 |
|
|
return $router->app->version();
|
23 |
|
|
});
|
24 |
|
|
|
25 |
|
|
$router->get('/hello', function () {
|
26 |
|
|
return "Hello world!";
|
27 |
|
|
});
|
28 |
|
|
|
29 |
|
|
$router->get('/class', function() {
|
30 |
|
|
return response()->json(new TestClass());
|
31 |
|
|
});
|
32 |
|
|
|
33 |
|
|
$router->get('/json', function () {
|
34 |
|
|
return response()->json(['name' => 'Abigail', 'state' => 'CA']);
|
35 |
|
|
});
|
36 |
|
|
|
37 |
|
|
$router->get('/controller', 'TestClassController@getTestClass');
|