}
public function links()
+ {
+ return self::getLinks();
+ }
+
+ public static function getLinks()
{
$classes = collect([
Poll::class => 'Sondage',
- LaboArticle::class => 'Article Labo',
+ LaboArticle::class => 'Actu Labo',
SocialArticle::class => 'Article réseaux sociaux',
AdCampaign::class => 'Campagnes'
]);
- return $classes->map(function ($label, $class) {
+ return collect([[
+ 'name' => 'Liens',
+ 'specialLinks' => self::getIndexLinks()
+ ]])->merge($classes->map(function ($label, $class) {
return [
'name' => $label,
'specialLinks' => self::getLinksForClass($class, 5)
];
- })->values();
+ })->values());
}
return $items->map(fn($item) => ['name' => mb_strimwidth($item->title, 0, 35, '…'), 'href' => $item->url]);
}
+ public static function getIndexLinks()
+ {
+ $links = collect([
+ 'Accueil' => route('home'),
+ 'Inscription découverte' => route('discover.register'),
+ 'Form. Contact' => route('contact.index'),
+ 'Actus Labo' => route('actus-labos.index'),
+ 'Article réseaux sociaux' => route('actus-labos.index'),
+ 'Campagnes' => route('com-campaign.index')
+ ]);
+
+ return $links->map(fn($route, $label) => ['name' => $label, 'href' => $route])->values();
+ }
+
}
namespace App\Nova;
+use App\Http\Controllers\Admin\UnlayerController;
use IDF\NovaUnlayerField\Unlayer;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Boolean;
'projectId' => config('services.unlayer.projectId'),
'templateId' => $this->design === null ? 20390 : null,
'locale' => app()->getLocale(),
- 'specialLinks' => [
- [
- 'name' => 'Home',
- 'href' => route('home'),
- ],
- [
- 'name' => 'Contact',
- 'href' => route('contact.index')
- ],
- ],
+ 'specialLinks' => UnlayerController::getLinks(),
'tools' => [
'menu' => [
'enabled' => false,