56 lines
1.2 KiB
PHP
Raw Normal View History

2021-07-09 23:36:41 +03:00
<?php
namespace App\View\Components\Transfers;
2022-06-01 10:15:55 +03:00
use App\Abstracts\View\Component;
use App\Traits\ViewComponents;
2021-07-09 23:36:41 +03:00
class Script extends Component
{
2022-06-01 10:15:55 +03:00
use ViewComponents;
public const OBJECT_TYPE = 'transfer';
public const DEFAULT_TYPE = 'transfer';
public const DEFAULT_PLURAL_TYPE = 'transfers';
public $model;
public $transfer;
2021-07-09 23:36:41 +03:00
/** @var string */
2022-06-01 10:15:55 +03:00
public $alias;
2021-07-09 23:36:41 +03:00
/** @var string */
2022-06-01 10:15:55 +03:00
public $folder;
2021-07-09 23:36:41 +03:00
2022-06-01 10:15:55 +03:00
/** @var string */
public $file;
2021-07-09 23:36:41 +03:00
/**
* Create a new component instance.
*
* @return void
*/
2022-06-01 10:15:55 +03:00
public function __construct(
$model = false, $transfer = false,
string $alias = '', string $folder = '', string $file = ''
) {
$this->model = ! empty($model) ? $model : $transfer;
$this->transfer = ! empty($model) ? $model : $transfer;
$this->alias = $this->getAlias($type, $alias);
$this->folder = $this->getScriptFolder($type, $folder);
$this->file = $this->getScriptFile($type, $file);
2021-07-09 23:36:41 +03:00
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|string
*/
public function render()
{
return view('components.transfers.script');
}
}