wire-elements / spotlight

Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.
MIT License
911 stars 71 forks source link

Langs support #75

Closed rudolfbruder closed 2 years ago

rudolfbruder commented 2 years ago

Hi,

Is there any way how to use laravel langs and their values in defining for the command name and description?

For me this does not work:

image

Thank you!

jacotijssen commented 2 years ago

Instead of using the name property, you can use the getName method. So remove the protected string $name = "..." and replace it with something like this:

Schermafbeelding 2022-05-12 om 00 01 05
PhiloNL commented 2 years ago

Haven't tested this but I think you can do:

class ShowJobsTable extends SpotlightCommand
{
    protected string $name;

    public function __construct()
    {
        $this->name = Lang::get('something');
    }
}

Replacing the getName method like @jacotijssen mentioned is also possible.

rudolfbruder commented 2 years ago

Thanks works!