Showing UI components
In adition to display plain text, you can also display some UI components like avatars, badges or icons, some of these components have different variants, you can customize these varians with the laravel-views.php
config file.
Avatar
Shows an 32x32 rounded image
use LaravelViews\Facades\UI
public function row($model)
{
return [
UI::avatar($model->avatar_url)
];
}
Badges
Shows a colored badge with a text, it is gray by default
UI::badge('My title');
UI::badge('My title', 'info');
UI::badge('My title', 'success');
UI::badge('My title', 'warning');
UI::badge('My title', 'danger');
Link
Shows a simple link to navigate to another route.
UI::link('My link title', 'my-route-to-navigate');
Icons
Shows a feather icon with a custom variant, it is important to set a valid feather icon.
UI::icon('check');
UI::icon('check', 'info');
UI::icon('check', 'success');
UI::icon('check', 'danger');
UI::icon('check', 'warning');