<?php

namespace App\Http\Controllers\Cliente\Advisor;

use App\Models\Advisor;

class AdvisorIdController
{
    public function index($IdAdvisor)
    {
        $result = Advisor::where('IdAdvisor', $IdAdvisor) ->get();
        if (count($result)>0){
            
            foreach($result as $advisor) {
                $advisor->ImgAdvisor = config('app.PUBLIC_URL') . $advisor->ImgAdvisor;
            }
            return json_encode ( $result[0]);
        }
        else return json_encode (null);
    }
}
