action btns icon widgets add

This commit is contained in:
2025-01-22 13:13:49 +03:00
parent 22f7ecff6a
commit 265300f345
9 changed files with 131 additions and 34 deletions

View File

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

View File

@ -0,0 +1,24 @@
<?php
namespace App\Widgets;
use Arrilot\Widgets\AbstractWidget;
class IconBtnDeleteWidget extends AbstractWidget
{
/**
* 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' => "fa-regular fa-trash-can",
'url' => $url,
'btn_type' => "danger",
'title' => "Удалить"
]))->run();
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Widgets;
use Arrilot\Widgets\AbstractWidget;
class IconBtnEditWidget extends AbstractWidget
{
/**
* 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' => "fa-solid fa-pen",
'url' => $url,
'btn_type' => "success",
'title' => "Редактировать"
]))->run();
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace App\Widgets;
use Arrilot\Widgets\AbstractWidget;
class IconBtnListWidget extends AbstractWidget
{
/**
* Treat this method as a controller action.
* Return view() or other content to display.
*/
public function run()
{
$url = $this->config['url'];
return (new ActionButtonWidget([
'label' => "fa-regular fa-rectangle-list",
'url' => $url,
'btn_type' => "primary",
'title' => "Список"
]))->run();
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace App\Widgets;
use Arrilot\Widgets\AbstractWidget;
class IconBtnViewWidget extends AbstractWidget
{
/**
* 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([
'btn_type' => "primary",
'label' => "fa-regular fa-eye",
'url' => $url,
'title' => "Просмотреть"
]))->run();
}
}