34 lines
		
	
	
		
			980 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			980 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| use Illuminate\Http\Request;
 | |
| use Illuminate\Support\Facades\Route;
 | |
| use App\Article;
 | |
| use App\Http\Controllers\ArticlesController;
 | |
| use App\Http\Controllers\TopicsController;
 | |
| 
 | |
| /*
 | |
| |--------------------------------------------------------------------------
 | |
| | 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('home');
 | |
| });
 | |
| 
 | |
| Route::get('/article/{article:id}', [ArticlesController::class,'show'])->name('articles.show');
 | |
| Route::get('/topic/{topic:slug}', [TopicsController::class,'show'])->name('topics.show');
 | |
| 
 | |
| Route::get('/ogimage', function(Request $request) {
 | |
| 
 | |
|     $article = Article::findOrFail($request->query('id'));
 | |
| 
 | |
|     return view('ogimage', ['article' => $article]);
 | |
| });
 | |
| 
 |