for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of laravel.su package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace App\Http\Controllers;
use App\Models\Article;
use App\Models\User;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\View\View;
use Tymon\JWTAuth\Providers\JWT\JWTInterface;
* Class HomeController.
class HomeController extends Controller
{
* @return View
public function index(): View
return view('page.home.home', [
'articles' => Article::latestPublished()->take(11)->get(),
latestPublished()
App\Models\Article
scopeLatestPublished()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
'articlesCount' => Article::latestPublished()->count(),
]);
}
* @param JWTInterface $jwt
* @param Guard $guard
* @return \Illuminate\Contracts\View\Factory|View|\Illuminate\View\View
public function react(JWTInterface $jwt, Guard $guard): View
$user = User::guest();
if ($guard->check()) {
$user = $guard->user();
return view('layout.react', [
'token' => $jwt->encode([
'user' => [
'id' => $user->getAuthIdentifier(),
'password' => $user->getAuthPassword(),
],
'token' => $user->getRememberToken(),
]),
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.