<?php #CodeGenerator V3 Δ f04be414f3dd18ee9036d5bc40a625e5 Δ 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\Country\Modals;


use BplanBase\Globals\Models\Country;
use BplanBase\Globals\Services\CountryService;
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         Country
     */
    public Country $country;


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


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


    /**
     * @var
     */
    private static $_logPrefix = 'Country/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       CountryService $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(CountryService $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 createCountry()
    {
//        $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.');
//        }
    } // createCountry()


    /**
     *
     * @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.country.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 {}
