for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types = 1);
namespace Thinktomorrow\ChiefSitestructure\Breadcrumbs;
use Illuminate\Http\Request;
use Thinktomorrow\Chief\Fields\Fields;
use Thinktomorrow\Chief\Urls\UrlHelper;
use Thinktomorrow\Chief\Management\Manager;
use Thinktomorrow\Chief\Fields\Types\SelectField;
use Thinktomorrow\ChiefSitestructure\SiteStructure;
use Thinktomorrow\Chief\Management\Assistants\Assistant;
class BreadcrumbAssistant implements Assistant
{
private $manager;
public function manager(Manager $manager)
$this->manager = $manager;
}
public static function key(): string
return 'breadcrumbs';
public function route($verb): ?string
return null;
public function fields(): Fields
return new Fields([
SelectField::make('parent_page')
->options(UrlHelper::allModelsExcept($this->manager->modelInstance()))
->selected(app(Breadcrumbs::class)->getParentForPage($this->manager->modelInstance()))
->grouped()
->label('De pagina waar deze pagina onder hoort.'),
]);
public function saveParentPageField($field, Request $request)
$field
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function saveParentPageField(/** @scrutinizer ignore-unused */ $field, Request $request)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
app(SiteStructure::class)->save($this->manager->existingModel()->flatreference()->get(), $request->input('parent_page') ?? null);
public function can($verb): bool
return true;
public function guard($verb): Assistant
$verb
public function guard(/** @scrutinizer ignore-unused */ $verb): Assistant
return $this;
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.