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

arozhnov's avatar

arozhnov wrote a comment+100 XP

3mos ago

The Laracasts Snippet: Ep 10, I'm Done

You described exactly my way of thinking about AI programming. In the middle of 2025 I was very sceptical about it, used only for autocomplete simple patterns. But in january 2026 I've tried agent with these new MCPs on the side project and were surprised by the progress they made. Now I can't allow agents to write code to my main project, because I see It won't respect our guidelines, but learning to use it extensively on side projects.

arozhnov's avatar

arozhnov wrote a reply+100 XP

5mos ago

Laravel date field automatically changes to today's date

For someone like me who have the same problem if future.

This is because of nonstandard behaviors of MySQL and MariaDB databases:

The first TIMESTAMP column in a table, if not explicitly declared with the NULL attribute or an explicit DEFAULT or ON UPDATE attribute, is automatically declared with the DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP attributes.

From mysql docs.

To fix it you should explicitly set field as nullable and set default value in migration.

$table->timestamp('real')->nullable()->default(null);

Now your column won't be updated on other fields update.

arozhnov's avatar

arozhnov liked a comment+100 XP

5mos ago

Laravel validation - bail rule

You can solve it by splitting the validation in two steps:

$request->validate([
    'title' => 'required|unique:posts|max:255',
]);

$request->validate([
    'title' => 'required|unique:posts|max:255', // this is not necessary
    'body' => 'required',
]);
arozhnov's avatar

arozhnov wrote a reply+100 XP

5mos ago

Laravel validation - bail rule

It's always useful not only for topic starter but also for future generations that encounters same problems. Like me now.