->schema(function ($record) { $userCargoFormulario = DB::table('user_cargo_formulario as ucf') ->join('cargo_formulario as cf','ucf.cargo_formulario_id','=','cf.id') ->where('ucf.user_id', auth()->id())->get('tipo_id')->toArray(); // dd($userCargoFormulario); if($userCargoFormulario[0]->tipo_id == 3){ return [ TextInput::make('resposta')] ; //change to array here } })