-
Notifications
You must be signed in to change notification settings - Fork 0
/
web.php
31 lines (26 loc) · 933 Bytes
/
web.php
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
<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\ScaledImage404Controller;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
//список
Route::get('/', function () {
//return view('welcome');
$files=[]; //['0.jpg', '1.jpg', '2.jpg',...];
foreach(scandir(ScaledImage404Controller::fsPath()) as $f) {
if (('.' != $f{0}) && (!is_dir(ScaledImage404Controller::fsPath($f)))) $files[] = $f;
}
return view('index', ['files'=>$files]);
});
//карточка
Route::get('/card/{file}', function ($file) {
return view('card', ['file'=>$file]);
});