示例#1
0
 | Here is where you can register all of the routes for an application.
 | It's a breeze. Simply tell Laravel the URIs it should respond to
 | and give it the Closure to execute when that URI is requested.
 |
*/
Route::get('/', 'CampionatiController@index');
// Provide controller methods with object instead of ID
Route::model('campionati', 'Campionato');
Route::model('giornate', 'Giornata');
Route::model('squadre', 'Squadra');
Route::model('partite', 'Partita');
Route::bind('campionati', function ($value) {
    return Campionato::where('id', $value)->first();
});
Route::bind('squadre', function ($value) {
    return Squadra::whereId($value)->first();
});
Route::bind('giornate', function ($value) {
    return Giornata::whereId($value)->first();
});
Route::bind('partite', function ($value) {
    return Partita::whereId($value)->first();
});
Route::resource('campionati', 'CampionatiController');
Route::resource('giornate', 'GiornateController');
Route::resource('squadre', 'SquadreController');
Route::resource('partite', 'PartiteController');
Route::get('/importCalendar', function () {
    $importCalendar = new ImportCalendar();
    $result = $importCalendar->importCalendarFromFile();
    echo 'Result ->' . $result, '<br>';