<?php

namespace App\Http\Main\Users;

use Livewire\Component;
use App\Models\User;
use Illuminate\Support\Facades\Auth;

class Index extends Component
{
    public $phonne;

    
    protected function rules()
    {
       return ['phone'=>'required'];
    }
    public function updated(){
        $this->validate();
    }

    

    public function render()
    {
        if (auth()->check()){
            $id=auth()->user()->drives->first()->id;
                $home = '/users/drives/'.$id;
            redirect()->to($home);
        }else{
            
        }
        
        return view('main.users.index')->layout('layouts.app-users-index');
    }
}
