/nova-greeter

A Laravel Nova card to greet your users

Primary LanguageVueMIT LicenseMIT

A Laravel Nova card to greet your users

Latest Version on Packagist Total Downloads

This Laravel Nova package adds a customizable greeting card to your dashboard.

basic

Installation

You can install the package via composer:

composer require oriondevelops/nova-greeter

Usage

Register the card in your preferred dashboard:

use Orion\NovaGreeter\GreeterCard;

// ...

public function cards()
{
    return [
        // ...
        GreeterCard::make()
            ->user(name: 'John Doe', title: 'The King in the North')
            ->avatar(url: 'https://ui-avatars.com/api/?size=300&color=7F9CF5&background=EBF4FF&name=John+Doe'),
    ];
}

Message

->message(text: 'Welcome back,')

Button

->button(name: 'Call To Action', target: '/nova/resources/users')

Avatar

->avatar(url: $avatarUrl ?? $placeholderAvatarUrl)

Example

example

GreeterCard::make()
    ->user(name: 'ORION', title: 'Admin')
    ->message(text: 'Welcome back,')
    ->button(name: 'See users', target: '/nova/resources/users')
    ->avatar(url: 'https://avatars.githubusercontent.com/u/39307250')
    ->width('1/2'),

Localization

The translation file can be published using the following command:

php artisan vendor:publish --provider="Orion\NovaGreeter\CardServiceProvider"

Credits

License

The MIT License (MIT). Please see License File for more information.