my-website/app/Http/Controllers/HomeController.php

26 lines
599 B
PHP

<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class HomeController extends BaseController {
use AuthorizesRequests, ValidatesRequests;
function index(\Illuminate\Http\Request $r) {
$example = $r->get("name") ?? "John";
return view("home", [
"any_name" => $example,
]);
}
function about(\Illuminate\Http\Request $r) {
return view("about");
}
}