I fixed it!
unique:pgsql.tutorials.posts
Where pgsql is the default database connection set up in the .env file :)
Hope this helps someone!
Hi,
I am using PostgreSQL database because this is what I use at work (I am a DBA) and I like to separate sections of my website or subdomains to different schemas. For the most part this works fine, in my Model class I can do something like:
protected $table = 'tutorials.posts';
... and it works fine. Even relationships work fine so I know that Laravel can look in other schemas. The problem is that when I add a unique validation in the store function of the controller, I get the following error:
required|alpha_dash|min:5|max:255|unique:tutorials.posts
InvalidArgumentException in DatabaseManager.php line 239: Database [tutorials] not configured.
So it seems like the validation code is splitting the string and taking the schema name as the database name. I have tried specifying the database name then schema name and then table but that comes back with:
InvalidArgumentException in DatabaseManager.php line 239: Database [my_database] not configured.
Is there something I am missing or am I going to have to look into the BaseController and fiddle?
Thanks!
Please or to participate in this conversation.