This commit is contained in:
2020-09-17 09:00:08 +08:00
commit 6366331f55
714 changed files with 167687 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Http\Controllers;
use App\Models\Article;
use App\Models\Category;
class ArticleController extends Controller
{
public function show(Article $article)
{
if ($article->url) {
return redirect($article->url);
}
$category = $article->category;
$parent = $category->getTop();
return view('articles.show', compact('article', 'category', 'parent'));
}
}