<?php #CodeGenerator V3 Δ 77d78fda68019606590c5a46d105559f Δ DYNAMICALLY GENERATED FILE - Do not modify this line! Remove it completely to protect the file from changes.
/**
 * Livewire Component
 *
 * @version     1.0.$Revision:$
 * @version     SVN: $Id:$
 * @version     STUB: 2.0.0
 * @generated   2026-06-15 19:10:00
 * @package     bplan-base/globals
 * @subpackage  LivewireComponents
 * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
 * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
 * @copyright   Copyright (C) 2025, 2026 bplan-solutions GmbH & Co. KG <https://www.bplan-solutions.de/>
 * /Δ\
 */

namespace BplanBase\Globals\Livewire\Language\Modals;


use BplanBase\Globals\Models\Language;
use BplanBase\Globals\Services\LanguageService;
use Livewire\Component;


/**
 * Livewire Component
 *
 * @version     1.0.0 / 2026-06-15
 * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
 * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
 */
class Create extends Component
{


/* +++ TRAITS +++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */


/* +++ CLASS CONSTANTS +++ ++++++++++++++++++++++++++++++++++++++++++++++++++ */


/* +++ OBJECT MEMBERS +++ +++++++++++++++++++++++++++++++++++++++++++++++++++ */


    /**
     * @var    Language
     */
    public Language $language;


    /**
     * @var    LanguageService
     */
    protected LanguageService $_Service;


/* +++ CLASS MEMBERS +++ ++++++++++++++++++++++++++++++++++++++++++++++++++++ */


    /**
     * @var
     */
    private static $_logPrefix = 'Language/Modals/Create';


/* +++ OBJECT METHODS +++ +++++++++++++++++++++++++++++++++++++++++++++++++++ */


    /**
     *
     * @param       LanguageService $Service
     *
     * @version     1.0.0 / 2026-06-15
     * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
     * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
     */
    public function boot(LanguageService $Service)
    {
        $this->_Service = $Service;

    } // boot()


    /**
     *
     * @return      void
     *
     * @version     1.0.0 / 2026-06-15
     * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
     * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
     */
    public function createLanguage()
    {
        $this->authorize('language.create');

        $this->validate();

        try {
            $attributes = [
                //
            ];
            $this->_Service->create($attributes);
            $User = auth()->user();

            \AppLog::info('Language created by ['.$User->name.' ('.$User->email.')]', self::$_logPrefix);

            $this->dispatch('init-tippyjs');
            $this->dispatch('language-created');

        } catch (\Throwable $th) {
            $TraceCode = \TraceCode::capture();

            \AppLog::error($th, self::$_logPrefix, TraceCode: $TraceCode);

            $this->dangerBanner(__('bplan-base/globals::languages.error.create-error', ['trace-code' => $TraceCode]));
        }
    } // createLanguage()


    /**
     *
     * @version     1.0.0 / 2026-06-15
     * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
     * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
     */
    public function mount()
    {
        //
    } // mount()


    /**
     *
     * @version     1.0.0 / 2026-06-15
     * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
     * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
     */
    public function render()
    {
        return view('globals::livewire.language.modals.create');

    } // render()


    /**
     *
     * @return      array
     *
     * @version     1.0.0 / 2026-06-15
     * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
     * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
     */
    public function rules(): array
    {
        $rules = [];

        return $rules;

    } // rules()


/* +++ CLASS METHODS +++ ++++++++++++++++++++++++++++++++++++++++++++++++++++ */


} // class Create extends Component {}
