1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 21:34:03 +00:00
laravel-tips/routes/web.php
Lars Klopstra 8623a25b79 wip
2021-04-07 18:31:59 +02:00

33 lines
984 B
PHP

<?php
use App\Models\Thread;
use App\Models\Tip;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| 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::middleware('static')->group(function () {
Route::get('/', function () {
return view('tips.index', ['tips' => Tip::all()]);
})->name('tip.index');
Route::get('/threads/{thread}', function (Thread $thread) {
return view('threads.show', [
'thread' => $thread,
'tips' => $thread->tips,
]);
})->name('thread.show');
Route::get('/{tip}', function (Tip $tip) {
return view('tips.show', compact('tip'));
})->name('tip.show');
});