![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/demo.cartinsight.co/Corals/core/Foundation/Exceptions/ |
<?php namespace Corals\Foundation\Exceptions; use Facade\IgnitionContracts\Solution; use Facade\IgnitionContracts\BaseSolution; use Facade\IgnitionContracts\ProvidesSolution; use Illuminate\Support\Str; /** * Exception that is thrown if the user attempts to register two breadcrumbs with the same name. * * @see \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::register() */ class DuplicateBreadcrumbException extends BreadcrumbsException implements ProvidesSolution { private $name; public function __construct($name) { parent::__construct("Breadcrumb name \"{$name}\" has already been registered"); $this->name = $name; } public function getSolution(): Solution { // Determine the breadcrumbs file name(s) $files = (array)config('breadcrumbs.files'); $basePath = base_path() . DIRECTORY_SEPARATOR; foreach ($files as &$file) { $file = Str::replaceFirst($basePath, '', $file); } if (count($files) === 1) { $description = "Look in `$files[0]` for multiple breadcrumbs named `{$this->name}`."; } else { $description = "Look in the following files for multiple breadcrumbs named `{$this->name}`:\n\n- `" . implode("`\n -`", $files) . '`'; } $links = []; $links['Defining breadcrumbs'] = 'https://github.com/davejamesmiller/laravel-breadcrumbs#defining-breadcrumbs'; $links['Laravel Breadcrumbs documentation'] = 'https://github.com/davejamesmiller/laravel-breadcrumbs#laravel-breadcrumbs'; return BaseSolution::create('Remove the duplicate breadcrumb') ->setSolutionDescription($description) ->setDocumentationLinks($links); } }