<?php #CodeGenerator V3 Δ 0ea982d6d55938ecffafbcc8567745c0 Δ 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: 1.0.0
 * @generated   2026-04-07 01:48:22
 * @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\LocationType\Modals;


use BplanBase\Globals\Models\LocationType;
use BplanBase\Globals\Services\LocationTypeService;
use Livewire\Component;


/**
 * Livewire Component
 *
 * @version     1.0.0 / 2026-04-07
 * @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         LocationType
     */
    public LocationType $locationType;


    /**
     * @var         LocationTypeService $Service
     */
    protected LocationTypeService $_Service;


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


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


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


    /**
     *
     * @version     1.0.0 / 2026-04-07
     * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
     * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
     */
    public function create()
    {
        $this->validate();

        try {
            $attributes = [
                //
            ];
            $this->Service->create($attributes);

        } catch (\Throwable $th) {
            //LogHelper::logException($th);
        }
    } // create()


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

    } // boot()


    /**
     *
     * @return      void
     *
     * @version     1.0.0 / 2026-04-07
     * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
     * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
     */
    public function createLocationType()
    {
//        $this->validate([
//            'name' => 'required',
//            'email' => 'required|email:rfc,dns|unique:users,email',
//            'selectedRoles' => 'required|min:1',
//        ]);
//
//        try {
//            $UserService = new UserService();
//
//            $newUser = $UserService->create([
//                'name' => $this->name,
//                'email' => $this->email,
//            ]);
//            $roleUserService = new RoleUserService();
//
//            foreach ($this->selectedRoles as $roleIndex => $isRoleSelected) {
//                if($isRoleSelected) {
//                    $roleUserService->create([
//                        'user_id' => $newUser->id,
//                        'role_id' => $this->roles[$roleIndex]->id
//                    ]);
//                }
//            }
//            $User = auth()->user();
//
//            \AppLog::info('User '.$this->name.' ['.$this->email.'] created by ' . $User->name . ' ['.$User->email.']', prefix: self::$_logPrefix);
//
//            $this->dispatch('init-tippyjs');
//            $this->dispatch('user-created');
//
//        } catch (\Throwable $th) {
//            \AppLog::error($th, prefix: self::$_logPrefix);
//
//            $this->dangerBanner('Error when adding user. Check the logs for more information.');
//        }
    } // createLocationType()


    /**
     *
     * @version     1.0.0 / 2026-04-07
     * @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-04-07
     * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
     * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
     */
    public function render()
    {
        return view('globals::livewire.location-type.modals.create');

    } // render()


    /**
     *
     * @return      array
     *
     * @version     1.0.0 / 2026-04-07
     * @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 {}
