My validation is as follows:
$request->validate([ 'name' => 'required|exists:trainers,name', 'id' => 'required', 'id.*' => 'numeric|exists:' ]);
and my $_POST looks like this:
Array ( [_token] => 0I6lF7rLocDwy0rgargtZ48fAiSjHuaLpfmyAfSj [name] => Axxeia [id] => Array (  => 27  => 69  => 107 ) )
When posting my form I get this error:
SQLSTATE: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'where `id`.`0` = ?' at line 1 (SQL: select count(*) as aggregate where `id`.`0` = 27)
Which makes sense as I expected the query to be:
select count(*) as aggregate from `trainers` where `name` = 'Axxeia'
The documentation states that the format is
exists:table,column and as you can see in the screenshot below I have a trainers.name table/column as referenced to in the first code block above. Why is this failing?
Why is this going wrong, why does the query laravel runs seem to miss some vital information like a
from clause? And how do I fix it?
Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.