⚠️ These docs are for the latest version. If you are using an older version you can find the docs for previous releases here. To upgrade from1.x
to2.x
please take a look at the Upgrade Guide
Just run:
composer require jubeki/nova-card-linkable
After this the setup will be complete and you can use the components listed here.
To publish the config you can simply run:
php artisan vendor:publish --provider="Jubeki\Nova\Cards\Linkable\CardServiceProvider"
To upgrade from 1.x
to 2.x
please take a look at the Upgrade Guide
What is the difference between the card types?
- Linkable: Links to a page in your application and makes use of inertia links
- Linkable Away: Links to a page which is outside of your application
The Design is the same for all of them and most of the options are also the same, so they will be listed here. (The left linkable card has a hover effect applied)
// in app/Nova/Dashboards/Main.php
namespace App\Nova\Dashboards;
use Jubeki\Nova\Cards\Linkable\Linkable;
use Jubeki\Nova\Cards\Linkable\LinkableAway;
use Laravel\Nova\Cards\Help;
use Laravel\Nova\Dashboards\Main as Dashboard;
class Main extends Dashboard
{
/**
* Get the cards for the dashboard.
*
* @return array
*/
public function cards()
{
return [
(new Linkable)
->title('User Resource')
->url('/nova/resources/users')
->subtitle('Visit the index view of the User Resource'),
(new LinkableAway)
->title('Nova Card Linkable')
->url('https://github.com/Jubeki/Nova-Card-Linkable/')
->subtitle('Visit the GitHub Repository'),
new Help,
];
}
}
All options are chainable.
$linkable->title('Title of Card');
$linkable->subtitle('Subtitle of Card');
$linkable->url('https://github.com/Jubeki/Nova-Card-Linkable');
$linkable->theme([
'layout' => 'p-3 flex flex-col items-center justify-center h-full',
'colors' => 'text-90 hover:text-primary-600',
'title' => 'text-3xl font-light text-center',
'subtitle' => 'text-lg font-light text-center',
]);
only available for Jubeki\Nova\Cards\Linkable\LinkableAway
$linkable->target('_blank');