Laravel_App/app/Widgets/IconBtnCreateWidget.php

35 lines
870 B
PHP

<?php
namespace App\Widgets;
use Arrilot\Widgets\AbstractWidget;
use itguild\forms\debug\Debug;
class IconBtnCreateWidget extends AbstractWidget
{
/**
* The configuration array.
*
* @var array
*/
protected $config = [];
/**
* Treat this method as a controller action.
* Return view() or other content to display.
*/
public function run(): \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application
{
$url = $this->config['url'];
return (new ActionButtonWidget([
// 'label' => "class='fa-regular fa-square-plus'",
'label' => "fa-regular fa-square-plus",
// 'label' => "Создать",
'url' => $url,
'btn_type' => "success",
'title' => "Создать"
]))->run();
}
}