-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·43 lines (37 loc) · 1.12 KB
/
index.php
File metadata and controls
executable file
·43 lines (37 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
use App\Routes\Route;
// Replace this with `require 'vendor/autoload.php';`
// when using this package in another project or when Composer is available.
spl_autoload_register(function (string $class) {
$namespaces = [
'App\\Routes\\' => __DIR__ . '/app/',
];
foreach ($namespaces as $namespace => $baseDir) {
if (!str_starts_with($class, $namespace)) {
continue;
}
$relativeClass = str_replace($namespace, '', $class);
$file = $baseDir . str_replace('\\', '/', $relativeClass) . '.php';
if (file_exists($file)) {
require_once $file;
}
}
});
try {
Route::configure(__DIR__, [
'routes/web.php',
])->routes(function($routes) {
// Use this callback to inspect or debug the registered routes.
// Append `?debug=1` to the URL to print the route definitions.
if (isset($_GET['debug'])) {
echo '<pre>';
print_r($routes);
echo '</pre>';
}
})->captured(function ($content) {
echo $content;
});
} catch (Throwable $exception) {
var_dump($exception->getMessage());
// Handle errors here (e.g., logging, reporting, or sending automated error notifications).
}