<?php

namespace App\Http\Controllers;

use App\Models\Cliente;
use Exception;
use Illuminate\Http\Request;

class ClienteController extends Controller
{


    public function status(){
        return ['status'=>'Ok'];
    }
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *
     * @param  \App\Models\Cliente  $cliente
     * @return \Illuminate\Http\Response
     */
    public function show(Cliente $cliente)
    {
        // try{

        //     $cliente=Cliente::join('users','clientes.usuario_id','=','users.id')->join('pessoas','pessoas.id','=','users.pessoa_id')->select('clientes.*','pessoas.nome')->orderBy('pessoas.nome','Asc')->get();

        //     $count=0;
        //     foreach($cliente as $cli){

        //         // $cli->getUser;
        //         $data[] = array("id" => $cli->id,
        //             "numero" => $cli->numerocliente,
        //             // "user" =>$cli->getUser,
        //             "nome" =>$cli->nome,
        //             // "deps" => $cli->getDepartamento,
        //         );
        //         $count++;
        //     }
        //     return $cliente->toJson();
        // } catch(Exception){

        // }

    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  \App\Models\Cliente  $cliente
     * @return \Illuminate\Http\Response
     */
    public function edit(Cliente $cliente)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\Cliente  $cliente
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, Cliente $cliente)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  \App\Models\Cliente  $cliente
     * @return \Illuminate\Http\Response
     */
    public function destroy(Cliente $cliente)
    {
        //
    }
}
