Lesson list · Lesson 3 of 5
The Basics · Lesson 3 of 5
Routing Basics
How a URL reaches your code, and how to read values from it.
1 min 0 comments
A route connects a URL to the code that answers it. Parts of the URL in curly braces are passed along as parameters.
Route::get('/posts/{post}', [PostController::class, 'show']);Route model binding
Because the parameter is named post and type-hinted as a model, Laravel looks up the post for you and returns a 404 page if it does not exist.
Discussion
Log in to join the conversation. Log in
Rizky A. on the class page
Is this class enough to start building my own project?
Codesakura Author
Yes. After the last chapter you can build a simple CRUD app on your own.
Bagas P. in lesson What Is Laravel?
Clear and to the point. Looking forward to the next lesson!