Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Novalinkresource Laravel Package

ericlagarda/novalinkresource

NovalinkResource gives Laravel apps a clean base API Resource for turning Eloquent models into consistent JSON responses, with helpers for relationships, includes, pagination, and field filtering so your endpoints stay predictable and easy to maintain.

View on GitHub
Deep Wiki
Context7

Getting Started

Requirements: Laravel with Laravel Nova (this package was built against Nova 1.x/2.x), plus its published assets. It is a Nova tool, not a model-backed resource.

1. Install

composer require ericlagarda/novalinkresource

2. Publish anything it ships (config/views/assets — check the package's ToolServiceProvider for tags):

php artisan vendor:publish --provider="EricLagarda\NovaLinkResource\ToolServiceProvider"

3. Register the tool in app/Providers/NovaServiceProvider.php. It belongs in tools(), not resources():

public function tools()
{
    return [
        new \EricLagarda\NovaLinkResource\NovaLinkResource,
    ];
}

4. Define your first link. Create a small class (conventionally in app/Nova or app/Nova/Links) extending the package's abstract link class and describing the target:

namespace App\Nova\Links;

use EricLagarda\NovaLinkResource\LinkResource;

class Documentation extends LinkResource
{
    public $label  = 'Documentation';
    public $url    = 'https://nova.laravel.com';
    public $icon   = 'document-text';
    public $target = '_blank';
}

Register that class wherever the package expects link definitions (either via the tool constructor or the published config — check config/novalinkresource.php after publishing; that file is the authoritative place to look).

Where to look first: vendor/ericlagarda/novalinkresource/src/ — the abstract link class (for the exact properties/overridable methods) and the tool class (for registration shape). Then the README, then the published config.

First use case: external dashboards. Add links to Horizon, Telescope, Mailhog, your status page, or your API docs so the team stops bookmarking URLs. This is the lowest-risk, highest-value use and doesn't touch Eloquent at all.

After any change: php artisan config:clear && php artisan view:clear, then hard-refresh Nova.

Implementation Patterns

Pure external links. The simplest pattern: $url, $label, $icon, $target = '_blank'. Group several together as a "Support" or "Ops" cluster in the sidebar so they read as a block instead of scattered icons.

Shortcuts to resources you've hidden from the sidebar. Nova auto-generates a sidebar entry for every resource in Nova::resources(). If a resource is infrequently used, remove it from the sidebar (or restrict it via $displayInNavigation = false) and add a LinkResource that deep-links to it. Build the URL from Nova::path() / route() rather than hardcoding /nova/..., so a customized config('nova.path') still works:

public $url = '/nova/resources/users';
// better:
public function url()
{
    return Nova::path().'/resources/users';
}

Environment-aware targets. Pull URLs from config so staging points at staging tools and production at production tools:

public function url()
{
    return config('services.docs.url');
}

Per-user visibility. Link classes aren't policies, so gate visibility yourself — either filter the array in tools() or override the authorization hook (authorizedToSee / canSee) on the link class:

public function authorizedToSee(Request $request)
{
    return $request->user()->isAdmin();
}

Do this once at the top level if you have several admin-only links, rather than per-link.

Localization. Use __('Support') etc. for $label; sidebar labels are one of the first things that look wrong in a multilingual Nova.

Controlling order. Nova's sidebar generally follows registration order. Sort your array explicitly in tools() (or the config file) rather than relying on filesystem/class discovery order.

Composing with Nova's own menu. If a link duplicates something Nova already renders (e.g. a resource), hide one of the two — duplicated labels in the sidebar are the #1 complaint with this pattern.

Gotchas and Tips

The package is stale. Last release was February 2019. Nova 3 and 4 reworked tool bootstrapping, asset compilation (laravel-mix → Vite), and icon sets (Font Awesome → Heroicons). Expect at minimum broken icons and possibly a non-loading tool on modern Nova. Test on a throwaway branch before committing; if it breaks, forking and vendoring a patched copy is realistic given the size of the codebase (~a few hundred lines).

Icon names are version-specific. $icon = 'book' from the 2019 Font Awesome set will silently render nothing on Nova 4. Look at vendor/laravel/nova/resources/js/components/Icons/ in your installed Nova to get valid names.

Nova's modern menus can supersede this. Newer Nova versions ship Nova::mainMenu() / Nova::userMenu(). If you're on Nova 4, a five-line custom tool that calls MenuSection::make()->add(MenuItem::externalLink(...)) may be less maintenance than this package. Evaluate the built-in path before adopting.

Assets not published = invisible tool. If nothing appears at all, check public/vendor/novalinkresource exists and that the provider's boot() actually called Nova::script()/Nova::style(). php artisan nova:publish fixes a stale asset manifest.

Labels. If the link text defaults to the class basename (e.g. Documentation from Documentation.php), set an explicit $label anyway — it keeps names decoupled from namespace/class refactors.

target="_blank" without rel. If the package passes $target straight through to the anchor tag, you get reverse-tabnabbing exposure on external links. Inspect the rendered HTML; if rel="noopener noreferrer" is missing, patch the Blade view (publish views first) or set it via whatever rel/attribute hook the class exposes.

Debugging checklist: php artisan route:list | grep nova to confirm the URL you're linking to exists; inspect the sidebar's rendered HTML in devtools; dd() inside the tool's boot() to confirm registration; check storage/logs/laravel.log for provider errors that Nova swallows into a blank sidebar.

Ordering surprises after caching. If you use config:cache in production, any closure-based link definitions in the config file will fail to serialize. Prefer class references over closures in the config.

Extension points: the abstract link class is the seam — override url(), label(), icon(), target(), and the visibility method to derive links dynamically (e.g. a link whose URL depends on the current team). Because the package is small and unmaintained, treat those method signatures as frozen and wrap your own base class around it, so a future replacement is a one-file change.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin