Projekt

Obecné

Profil

Stáhnout (484 Bajtů) Statistiky
| Větev: | Revize:
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Zdenda
5
 * Date: 16.4.2018
6
 * Time: 13:19
7
 */
8

    
9
namespace App\Http\Controllers;
10

    
11

    
12
use App\Model\Location;
13
use App\Model\Mesto;
14

    
15
class LocationController extends Controller
16
{
17
    /**
18
     * Vrati vsechna mesta.
19
     */
20
    public function getCities() {
21
        $towns = Mesto::with('zarizeni')->get();
22

    
23
        if ($towns == null || count($towns) == 0) {
24
            return response('Not fonud.', 404);
25
        }
26

    
27
        return $towns;
28
    }
29
}
(4-4/6)