Skip to content

Commit

Permalink
Small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
GeniJaho committed Mar 13, 2024
1 parent d3a42f1 commit 819a32e
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 12 deletions.
14 changes: 14 additions & 0 deletions app/Http/Controllers/DocsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace App\Http\Controllers;

use Inertia\Inertia;
use Inertia\Response;

class DocsController extends Controller
{
public function __invoke(): Response
{
return Inertia::render('Docs');
}
}
14 changes: 14 additions & 0 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace App\Http\Controllers;

use Inertia\Inertia;
use Inertia\Response;

class HomeController extends Controller
{
public function __invoke(): Response
{
return Inertia::render('Home');
}
}
7 changes: 7 additions & 0 deletions app/Http/Controllers/UploadPhotosController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@
use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\UploadedFile;
use Inertia\Inertia;
use Inertia\Response;

class UploadPhotosController extends Controller
{
public function show(): Response
{
return Inertia::render('Upload');
}

public function store(
StorePhotosRequest $request,
ExtractsExifFromPhoto $extractExif,
Expand Down
18 changes: 6 additions & 12 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
use App\Http\Controllers\Auth\TwitterController;
use App\Http\Controllers\BulkPhotoItemsController;
use App\Http\Controllers\CopyPhotoItemController;
use App\Http\Controllers\DocsController;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\PhotoItemsController;
use App\Http\Controllers\PhotoItemTagsController;
use App\Http\Controllers\PhotosController;
use App\Http\Controllers\PhotoTagsController;
use App\Http\Controllers\UploadPhotosController;
use App\Http\Controllers\UserSettingsController;
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;

/*
|--------------------------------------------------------------------------
Expand All @@ -25,12 +26,8 @@
|
*/

Route::get('/', function () {
return Inertia::render('Home');
})->name('home');
Route::get('/docs/en/', function () {
return Inertia::render('Docs');
})->name('docs');
Route::get('/', HomeController::class)->name('home');
Route::get('/docs/en/', DocsController::class)->name('docs');

Route::get('/auth/google/redirect', [GoogleController::class, 'redirect'])->name('auth.google.redirect');
Route::get('/auth/google/callback', [GoogleController::class, 'callback']);
Expand All @@ -44,9 +41,8 @@
config('jetstream.auth_session'),
'verified',
])->group(function () {
Route::get('/upload', function () {
return Inertia::render('Upload');
})->name('upload');
Route::get('/upload', [UploadPhotosController::class, 'show'])->name('upload');
Route::post('/upload', [UploadPhotosController::class, 'store']);

Route::get('/my-photos', [PhotosController::class, 'index'])->name('my-photos');
Route::get('/photos/{photo}', [PhotosController::class, 'show'])->name('photos.show');
Expand All @@ -64,7 +60,5 @@

Route::post('/photo-items/{photoItem}/copy', CopyPhotoItemController::class);

Route::post('/upload', [UploadPhotosController::class, 'store']);

Route::post('/settings', [UserSettingsController::class, 'update'])->name('user-settings.update');
});

0 comments on commit 819a32e

Please sign in to comment.