Laravel_App/app/Widgets/ActionButtonWidget.php

36 lines
873 B
PHP
Raw Normal View History

2025-01-20 16:57:48 +03:00
<?php
namespace App\Widgets;
use Arrilot\Widgets\AbstractWidget;
use itguild\forms\debug\Debug;
class ActionButtonWidget 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
{
$label = $this->config['label'];
$btn_type = $this->config['btn_type'];
$url = $this->config['url'];
$title = $this->config['title'] ?? '';
return view('widgets.action_button_widget', [
'label' => $label,
'btn_type' => $btn_type,
'url' => $url,
'title' => $title
]);
}
}