Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/inventory.corals.io/vendor/yajra/laravel-datatables-html/src/Html/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/inventory.corals.io/vendor/yajra/laravel-datatables-html/src/Html/HasEditor.php
<?php

namespace Yajra\DataTables\Html;

use Yajra\DataTables\Html\Editor\Editor;

trait HasEditor
{
    /**
     * Collection of Editors.
     *
     * @var null|Editor
     */
    protected $editors = [];

    /**
     * Attach multiple editors to builder.
     *
     * @param array|mixed ...$editors
     * @return $this
     * @see https://editor.datatables.net/
     * @throws \Exception
     */
    public function editors(...$editors)
    {
        if (is_array($editors[0])) {
            $editors = $editors[0];
        }

        foreach ($editors as $editor) {
            $this->editor($editor);
        }

        return $this;
    }

    /**
     * Integrate with DataTables Editor.
     *
     * @param array|Editor $fields
     * @return $this
     * @see https://editor.datatables.net/
     * @throws \Exception
     */
    public function editor($fields)
    {
        $this->setTemplate($this->config->get('datatables-html.editor', 'datatables::editor'));

        $editor = $this->newEditor($fields);

        $this->editors[] = $editor;

        return $this;
    }

    /**
     * @param array|Editor $fields
     * @return array|Editor
     * @throws \Exception
     */
    protected function newEditor($fields)
    {
        if ($fields instanceof Editor) {
            $editor = $fields;
        } else {
            $editor = new Editor;
            $editor->fields($fields);
        }

        if (! $editor->table) {
            $editor->table('#' . $this->getTableAttribute('id'));
        }

        if (! $editor->ajax) {
            $editor->ajax($this->getAjaxUrl());
        }

        return $editor;
    }

    /**
     * @return array|null
     */
    public function getEditors()
    {
        return $this->editors;
    }
}

Spamworldpro Mini