Skip to content

Instantly share code, notes, and snippets.

@anestan
Last active July 5, 2017 10:00
Show Gist options
  • Save anestan/6f2b325a68192409f96c991aa2d281e7 to your computer and use it in GitHub Desktop.
Save anestan/6f2b325a68192409f96c991aa2d281e7 to your computer and use it in GitHub Desktop.
Belajar Laravel

ini namanya RESTful routing

Route::get();
Route::post();
Route::put();
Route::patch();
Route::delete();
Route::any();

ini contoh routes dan panggil function

<?php

// app/Http/routes.php

Route::get('my/page', function () {
    return 'Hello world!';
});

function itu disebut Closure atau bisa disebut Anonymous Function


Untuk dapetin URL dari routes yang sudah di tentukan bisa pakai ini

misal routes nya

Route::get('master/machine', 'MasterController@machine');

lalu kalau mau dapet full url, misal untuk link gunakan ini (blade file)

{{ url('master/machine') }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment