<?php

namespace App\Http\Livewire;

use Livewire\Component;

class Setting extends Component
{

    public $type = 'anagrafica';

    public function mount()
    {

        if(\Auth::user()->level != env('LEVEL_ADMIN', 0))
            return redirect()->to('/dashboard');

        if (isset($_GET["type"]))
            $this->type = $_GET["type"];
    }

    public function render()
    {
        return view('livewire.settings');
    }

    public function change($type)
    {
        $this->type = $type;
    }

}
