mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 05:14:04 +00:00
initial commit
This commit is contained in:
commit
1beb9dd34c
281 changed files with 56773 additions and 0 deletions
34
routes/web.php
Normal file
34
routes/web.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?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('/tips/{tip}', function (Tip $tip) {
|
||||
return view('tips.show', compact('tip'));
|
||||
})->name('tip.show');
|
||||
|
||||
Route::get('/threads/{thread}', function (Thread $thread) {
|
||||
return view('threads.show', [
|
||||
'thread' => $thread,
|
||||
'tips' => $thread->tips,
|
||||
]);
|
||||
})->name('thread.show');
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue