<?php

namespace App\View\Components;

use Illuminate\View\Component;

class FormControlInput extends Component
{
    public $type;

    public $required;

    public $id;

    public $name;

    public $value;

    /**
     * Create a new component instance.
     *
     * @return void
     */
    public function __construct($name, $type = 'text', $id = '', $value = '', $required = false)
    {
        $this->id = $id;
        $this->name = $name;
        $this->required = $required;
        $this->type = $type;
        $this->value = $value;
    }

    /**
     * Get the view / contents that represent the component.
     *
     * @return \Illuminate\Contracts\View\View|\Closure|string
     */
    public function render()
    {
        return view('components.form-control-input');
    }
}
