Files
karudhaas/routes/web.php
2020-08-24 10:41:12 +05:00

60 lines
1.8 KiB
PHP

<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Article;
use App\Source;
use App\Http\Controllers\ArticlesController;
use App\Http\Controllers\TopicsController;
use App\Http\Controllers\SourcesController;
use App\Http\Controllers\MylistController;
use App\Topic;
/*
|--------------------------------------------------------------------------
| 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('/preview', function () {
return view('pages.preview');
});
Route::get('/download/android', function () {
return response()->download(public_path('app/karudhaas.apk'), 'karudhaas.apk', [
'Content-type' => 'application/x-binary'
]);
});
Route::get('/article/{article:id}', [ArticlesController::class, 'show'])->name('articles.show');
Route::get('/topic/{topic:slug}', [TopicsController::class, 'show'])->name('topics.show');
Route::get('/source/{source:slug}', [SourcesController::class, 'show'])->name('sources.show');
Route::get('/mylist', [MylistController::class, 'index'])->name('mylist.index');
Route::post('/mylist/{article:id}', [MylistController::class, 'store'])->name('mylist.store');
Route::get('/about', function () {
return view('pages.about', [
'sources' => Source::all(),
'total_topics' => Topic::count(),
'total_articles' => Article::count()
]);
});
Route::get('/ogimage', function (Request $request) {
$article = Article::findOrFail($request->query('id'));
return view('ogimage', ['article' => $article]);
});