for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Xetaravel\Http\Controllers;
use Xetaravel\Models\Article;
use Xetaravel\Models\Comment;
use Illuminate\Support\Facades\Auth;
class PageController extends Controller
{
/**
* Show the home page.
*
* @return \Illuminate\Http\Response
*/
public function index()
$articles = Article::with('category', 'user')
->latest()
->limit(6)
->get();
$comments = Comment::with('user')
->whereHas('article', function ($query) {
$query->where('is_display', true);
})
->limit(4)
return view('page.index', ['articles' => $articles, 'comments' => $comments]);
}
* Display the terms page.
public function terms()
$this->breadcrumbs->addCrumb('Terms', route('page.terms'));
return view('page.terms', ['breadcrumbs' => $this->breadcrumbs]);
* Display the banished page.
public function banished()
if (!Auth::user()->hasRole('banished')) {
return redirect()
->route('page.index');
return view('page.banished');