Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

valentin_vranic's avatar

valentin_vranic was awarded Best Answer+1000 XP

1mo ago

Passing only an ID vs passing the entire object

Firstly the issue title and your real question I think is a bit misleading, thus I don't see the real relation between them (at first look).

IMO I would pass the object if it't not so heavy, and a simple model, and use #[Locked] on it in child, to prevent any malicious data manipulation between queries. And as a mandatory step, when looping the over parent property of child components, passing the :key on it to keep track of them.

IDK what the pivot datas consists and what losing them actually means. That's correct that the action is isolated for a component. But I'm not sure that refreshing the parent makes it efficient.

Providing some essential code would help a lot.

valentin_vranic's avatar

valentin_vranic started a new conversation+100 XP

3mos ago

Sharing experience

Probably it's supposed to be a blog post, but I find it well to place it here too.

So my first, real "wtf" moment after so many "wow"s regarding of capabilities of AI agents, and the development with them.

So long story short. Together with my teammate , we started working on a dashboard for our customers, with many things in plan from our PM, and superiors, but nothing was clearly defined in the beginning, rather as we moved forward new tasks arose. We used AI for development clearly, but in kind of Developer Driven mode, putting together our stuffs, using agents to help our process.

After 3 weeks, we came to present our first phase achievement. After presentation one of our colleagues, who is not particularly a tech-dev guy, mostly a project manager came up with his dashboard, which he put together totally with claude code, also in 3 weeks. Nobody knows about that. And we were amazed too, how much things he put in, with totally user friendly approach. Kind of like almost production ready dashboard, even added couple of special complex functionalities which were amazing. So the CEO was amazed too, that a non dev guy was able to put this together.

Yes, it's a bit buggy, and have couple of security issues. It combines couple of different languagess/frameworks (python, nextjs, go...), for me not so familiar ones. But the boss was amazed. And I had some really mixed feelings about it, mostly like my work is not good enough, not fast enough, although I did everything as I wanted. We spoke to him about our approach using AI for development, and for later issues, when real problems will arise, with scalability and fixing issues in general. But probably soon, that will be managed by ai too. But summa summarum we switched to this project, and will continue to develop it. IDK what will be the end of this project, and will it break in the future, but currently here we are.

I'm not waiting for help, or any guidance, only wanted to share my thoughts. Please feel free to share yours too.

Thanks all,

Val

valentin_vranic's avatar

valentin_vranic wrote a reply+100 XP

3mos ago

Laravel external MCP tool listing

So, finally, I was able to come up with a working solution. Hopefully someone facing some same kind of issues will find it helpful.

  private function checkSSEServer(McpServer $server, array $headers): array
    {
        try {
            $response = Http::timeout(10)
                ->withHeaders($headers)
                ->get($server->url);

            $body = $response->body();
            $endpoint = $this->extractSseEndpoint($body, $server->url);

            $sessionId = $this->extractSessionId($endpoint);
            $requestHeaders = $sessionId ? array_merge($headers, ['Mcp-Session-Id' => $sessionId]) : $headers;

            return $this->requestToolsList($endpoint, $requestHeaders);
}

So, it's not handling when it's unsuccessful, only to show what is my workflow for it. McpServer is only my model consisting some props like name, url, etc...

valentin_vranic's avatar

valentin_vranic started a new conversation+100 XP

3mos ago

Laravel external MCP tool listing

Hi all!

I'm facing an issue for a while. Firstly it was the lack of understanding of MCP-s, secondly the understanding of capabilities of Laravel and MCP-s.

So as I know, the MCP-s are not kind of REST endpoint(s) as I thought in the beginning, but an SSE (server-sent-events). Which is a new for me.

So my starting approach was to just send a tools-list method to the url, but later realised that it does need an open session connection to the MCP itself and then can only happen the query.

So my question is, is there any solutions to this in laravel? A lightweight approach for a quick MCP client which only lists the tools of a certain MCP server? I'm building a workflow app, where one of the features would be that users can add/pick MCP servers and list their tools to visually see them.

Thanks in advance, Val

valentin_vranic's avatar

valentin_vranic liked a comment+100 XP

4mos ago

Error After update to livewire 4 Livewire\Exceptions\RootTagMissingFromViewException vendor/livewire/livewire/src/Drawer/Utils.php:20

Hi @silveira, I've read about a similar issue in another post when upgrading to Livewire 4 and Filament. They fixed it by deleting the node_modules directory and installed the nodes packages again. I suggest giving it a try.

valentin_vranic's avatar

valentin_vranic wrote a reply+100 XP

4mos ago

Problem with foreach - array offset on null

Do you have a public property defined with the name resourceTypes above int he code? Ensure that only the #[Computed] is present, thus the public property will override it.

valentin_vranic's avatar

valentin_vranic liked a comment+100 XP

4mos ago

Passing only an ID vs passing the entire object

Providing some essential code would help a lot.

@valentin_vranic This.

valentin_vranic's avatar

valentin_vranic wrote a reply+100 XP

5mos ago

Passing only an ID vs passing the entire object

Firstly the issue title and your real question I think is a bit misleading, thus I don't see the real relation between them (at first look).

IMO I would pass the object if it't not so heavy, and a simple model, and use #[Locked] on it in child, to prevent any malicious data manipulation between queries. And as a mandatory step, when looping the over parent property of child components, passing the :key on it to keep track of them.

IDK what the pivot datas consists and what losing them actually means. That's correct that the action is isolated for a component. But I'm not sure that refreshing the parent makes it efficient.

Providing some essential code would help a lot.

valentin_vranic's avatar

valentin_vranic wrote a reply+100 XP

5mos ago

On Laravel 12 + Livewire starter kit - where do I change where users are redirected to if they're authenticated and trying to access guest routes?

For that purpose you can change the

public string const HOME = '/'; in app/Providers/RouteServiceProvider.php

EDIT:

My bad, the code above is for laravel 11x.

Here's the docs for 12, which could help: https://laravel.com/docs/12.x/authentication#redirecting-authenticated-users

valentin_vranic's avatar

valentin_vranic liked a comment+100 XP

5mos ago

config/database.php Laravel11 -> Laravel12

Why you can't just set write credentials same as read? In worst case you get error of wrong privileges, but you don't plan to execute write queries on that database anyway, so no harm there.

valentin_vranic's avatar

valentin_vranic wrote a reply+100 XP

5mos ago

config/database.php Laravel11 -> Laravel12

Hm. Firstly, it has to be an array.

If empty array then: Undefined array key "host".

Or in third case, getting this error: Database hosts array is empty.

This is kind of strange a bit to me. And have a feeling that I'm missing something.

valentin_vranic's avatar

valentin_vranic started a new conversation+100 XP

5mos ago

config/database.php Laravel11 -> Laravel12

I have an application, where I connect to multiple db-s. I have In 8 connections 3 where read & write credentials are separately defined, and the rest where only the read were defined and write was left empty.

This worked under laravel 11. After I've upgraded to version 12 I'm getting

SQLSTATE[HY000] [2002] No such file or directory for those connections where the write is left empty like above.

My question is what happened in the upgrade? Does anyone had some similar issues?

And yeah, why don't I write it into single dimension without read, write in this second scenario, even if it works like that? Because I wanted to keep the structure.

Probably I will if there's no other solution.

NOTE: maybe it's not in the upgrade, but on system I use it. On live test server (debian 12) everything seems okay yet. But in my local env, macos under Herd, it got broken.

Thanks in advance,

Val