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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\SiteController;
use App\Http\Controllers\ProfileController;
use App\Http\Controllers\WritingController;
use App\Http\Controllers\LinkController;
use App\Http\Controllers\DashboardController;
use Illuminate\Http\Request;
Route::get('/', function () {
return view('home');
});
Route::get('/env', [SiteController::class, 'env']);
Route::get('/dq', [SiteController::class, 'duneQuote']);
Route::post('/f', [SiteController::class, 'uploadFiles']); //TODO later use file resource or FPR service
Route::get('/f/{path}', function($path){
$storpath = storage_path('app/public/uploads/' . $path);
if (!file_exists($storpath)){
return response()->json(['error' => 'file not found ' . $storpath]);
}
$mime = Storage::mimeType($storpath);
return response()->file($storpath, [
'Content-Type' => $mime,
'Content-Disposition' => 'inline; filename="'.$path.'"'
]);
});
Route::post('/import', [SiteController::class, 'importItems']);
Route::get('/mu/{path}', function($path){
$storpath = storage_path('app/public/band/' . $path);
if (!file_exists($storpath)){
return response()->json(['error' => 'file not found ' . $storpath]);
}
$mime = Storage::mimeType($storpath);
return response()->file($storpath, [
'Content-Type' => $mime,
'Content-Disposition' => 'inline; filename="'.$path.'"'
]);
});
Route::resource('w', WritingController::class);
Route::resource('l', LinkController::class);
Route::get('/test', [SiteController::class, 'test']);
Route::get('/4', [SiteController::class, 'search4chan']);
Route::get('/dashboard', function () {
return view('dashboard');
})->middleware(['auth', 'verified'])->name('dashboard');
Route::get('/admin', function(){});
Route::middleware('auth')->group(function () {
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard');
Route::get('/dashboard/stats', [DashboardController::class, 'statistics'])->name('dashboard.stats');
});
Route::post('/update-session', function(Request $req){
if ($req->input('key') && $req->input('value')){
session()->put($req->input('key'), $req->input('value'));
return redirect()->back();
}
});
require __DIR__.'/auth.php';
Route::get('/toy/{v}', function($v){
if (is_null($v)){
return view('toys.index');
}
return view('toys.'.$v);
});
Route::get('/{v}', function($v){
return view($v);
});
|