for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Xetaravel\Http\Controllers\Shop;
use Xetaravel\Models\ShopCategory;
use Illuminate\Http\Request;
class CategoryController extends Controller
{
public function __construct()
parent::__construct();
$this->breadcrumbs->removeListElementClasses('breadcrumb');
$this->breadcrumbs->addCrumb('Blog', route('blog.article.index'));
}
/**
* Show the article by his id.
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
*/
public function show(Request $request, $slug, $id)
$slug
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function show(Request $request, /** @scrutinizer ignore-unused */ $slug, $id)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$request
public function show(/** @scrutinizer ignore-unused */ Request $request, $slug, $id)
$category = ShopCategory::with('items')
->where('id', $id)
->first();
if (is_null($category)) {
return redirect()
->route('shop.article.index')
->with('danger', 'This category doesn\'t exist or has been deleted !');
$articles = $category->articles()->paginate(config('xetaravel.pagination.blog.article_per_page'));
$this->breadcrumbs->addCrumb("Category : " . e($category->title), $category->category_url);
return view(
'Blog::category.show',
['articles' => $articles, 'category' => $category, 'breadcrumbs' => $this->breadcrumbs]
);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.