29 lines
837 B
PHP
29 lines
837 B
PHP
<?php
|
|
|
|
use App\Models\Article;
|
|
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 and all of them will
|
|
| be assigned to the "web" middleware group. Make something great!
|
|
|
|
|
*/
|
|
|
|
Route::get('/', function () {
|
|
return view('home');
|
|
});
|
|
|
|
Route::get('/test-insert', function () {
|
|
return view('test-insert');
|
|
})->name('test-insert');
|
|
|
|
Route::get('/recent-articles', function () {
|
|
$all_articles = Article::where('published_at', '<', now())->limit(10)->get();
|
|
return view('all-articles', ['all_articles' => $all_articles]);
|
|
})->name('recent-articles');
|