Routes are defined in 'routes/web.php'. It is the endpoint that the user will call and then a certain value will be received by the user either in the form of UI or by the request to the call.
The basic way to create a route is as follows:

Route::get('/', function () {
      return "Hello World";
//    return view('welcome');
});

Route::get('/name', function () {
    return 'Diwash is don';
});

Route::match(['get', 'post'], '/getpost', function () {
    return 'getPost received';
});

Invoking a Controller directly via the route.
Furthermore, you can invoke the controller class if the route is hit. You can do this by specifying the controller by using the function name. Here, the Controller is the name of the controller, and the index is the name of the function inside of the controller.

Route::get('/controller_method', [\App\Http\Controllers\Controller::class, 'index']);

Parameterized Routes (requires compulsory parameter)
You can also pass parameters to the route and later use it as required.

Route::get('/user/{name}', function ($name) {
    return "Hello " . $name;
});

Parameterized Routes (Optional parameters)
You can also pass the optional parameter to the route. To do this, you need to use the '?' symbol.

Route::get('/names/{name?}', function ($name = '') {
    echo $name . ' hi bro....';
});

Route constraints

You can add route constraints/validation to the parameters the user passes. This way, you can detect errors early in the route. You can do this using regex.

Route::get('users/{id}', function ($id) {
    //
})->where('id', '[0-9]+');

Route::get('users/{username}', function ($username) {
    //
})->where('username', '[A-Za-z]+');

Route::get('posts/{id}/{slug}', function ($id, $slug) {
    //
})->where(['id' => '[0-9]+', 'slug' => '[A-Za-z]']);

There are also constraint helpers available.

Route::get('users/{id}/friends/{friendname}', function ($id, $friendname) {
    //
})->whereNumber('id')->whereAlpha('friendname');

Route::get('users/{name}', function ($name) {
    //
})->whereAlphaNumeric('name');

Route::get('users/{id}', function ($id) {
    //
})->whereUuid('id');

Route::get('users/{id}', function ($id) {
    //
})->whereUlid('id');

Route::get('friends/types/{type}', function ($type) {
    //
})->whereIn('type', ['acquaintance', 'bestie', 'frenemy']);

Defining routes name
You can also define route's name so that it will be easier to reference it. You can do so by:

Route::get('memebers/{id}', [\App\Http\Controllers\Controller::class, 'show'])->name('members.show');

Grouping Routes
You can group similar routes together so you can add the same middleware to them and also make it easier to maintain.

For same middleware

// Restring a group of routes to logged-in users only
Route::middleware('auth')->group(function () {
    Route::get('/dashboard', function () {
        return 'Dashbaord';
    });
    Route::get('/account', function () {
        return 'Account';
    });
});

Applying the same path prefix

// PATH PREFIXES
Route::prefix('dashboard')->group(function () {
    Route::get('/', function () {
        // Handles the path /dashboard
    });
    Route::get('users', function () {
        // Handles the path /dashboard/users
    });
});

Sub-domain routing
You can do the routing in various subdomains by the following:

Route::domain('api.myapp.com')->group(function () {
    Route::get('/', function () {
        return 'Hi there King... I bow before your greatness';
    });
});

// Parameterized subdomain routing
Route::domain('{account}.myapp.com')->group(function () {
    Route::get('/', function ($account) {
        //
    });
    Route::get('users/{id}', function ($account, $id) {
        //
    });
});

Fallback routes
If none of the routes match, then the fallback route will run.

Route::fallback(function () {
    // If non of the route matches then this route will run
    return 'bro? What are you looking for?';
});

Signed routes
Signed routes are used in order to send unique links to the user and can be used for purposes like resetting passwords, sending invitations, etc.

Route::get('invitations/{invitation}/{answer}', InvitationController::class, '__invoke')->name('invitations');  // Build a signed URL to access the route. The route must have a name

// Generate a normal linked
$var = URL::route('invitations', ['invitation' => 12345, 'answer' => 'yes']);

// Generate a signed link
$var = URL::signedRoute('invitations', ['invitation' => 12345, 'answer' => 'yes']);

// Generate an expiring (temporary) signed link
$var = URL::temporarySignedRoute('invitations', now()->addHour(4), ['invitation' => 12345, 'answer' => 'yes']);

InvitationController.php:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Routing\Exceptions\InvalidSignatureException;

class InvitationController extends Controller
{
    //
    public function __invoke(Request $request, $invitation, $answer)
    {
        if (!$request->hasValidSignature()) {
            throw new InvalidSignatureException();
        }

        // print the invitation and answer
        return "Invitation {$invitation} and answer {$answer}";
    }
}