Closed webdesign7 closed 6 years ago
After some debugging I discovered I am getting this as well
(3/3) QueryException
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '>'$."en"' = ? limit 1' at line 1 (SQL: select * from product_categories
where slug
->'$."en"' = cold-water-prawns limit 1)
I think I figured out .. is because of lower version of mysql / phpmyadmin on the server I deployed. I think it doesn't support json queries ?
Hello,
Yeah spatie/laravel-translatable which is used in this boilerplate require at least Mysql 5.7
Bad.. :( .. server admins don't want to update this as its a shared server .. any solution? clean dirty doesn't matter ??
@webdesign7 hmm bro I guess its better to use laravel in dedicated server so that you are not entitled to various risk.
I wish but the client can't afford it ...
This is a show stopper for me now ...
keep talking to myself :)) What if instead of this:
if ($post = $this->query()->where("slug->{$locale}", $slug)->first()) {
return $post;
}
I do this:
if ($post = $this->query()->where("slug",'LIKE', '%' . $slug . '%')->first()) {
return $post;
}
@webdesign7 Bro the field in database is in JSON. So I guess you should try to switch to postgresql or sqlite maybe? Postgresql supports Json . Try sqlite it may work.
Bro i guess there are lot of shared hosting at cheap price you can try another . Thanks
If you really need translation and force to use low MySQL, maybe your best chance is to switch to https://github.com/dimsav/laravel-translatable which i used before. But plan 1-2 days of work ^^
Luckily this commit will help you a lot in that task. So it's definitly doable. Good luck ;)
Thanks @adr1enbe4udou1n appreciate that .. If I would use SQLite , would it work ? would relations work ?
Regards
@bloggervista I tried postgress and still no luck :(( getting same things timeout gateway
Sorry but SQLite will not work either :(
But strange that postgres (which supports json) dont work :@, if it's really the case what a shame...
@bloggervista i'm asking now myself if i should rollback to dimsav/laravel-translatable, sure its a boring way to do translations but it's battle tested for all environnements...
Laravel docs states that where clause support MySQL 5.7 and PostgreSQL
Hmm, weird then... I tried with PostgreSQL 8.4.20 .. Any specific version i need to use ? What I noticed is that there is no json field type ..
You need at least PostgreSQL 9.2 which adds JSON type support
And we cannot do anything about JSON support because many package like laravel taggable, mediable etc uses JSON field type. Meaning we would need to change many things.
This boilerplate will be released to even upcoming 5.7 and i guess it requires PHP 7.1 minimum . So i guess shared hosting may not support it .
I am using postgres and it is working better than Mysql.
@adr1enbe4udou1n hmm if this was case for dedicated hosting we should have considered it. But in shared hosting security is too problematic as we cannot point apache or nginx to public folder. There is no support for git etc... I worked on shared hosting and it was nightmare some shared hosting even don't have various extension enabled that laravel requires.
Hello,
Not sure what the issue is but I deployed website to a production and I am getting
when I go into blog post detail page
All other pages are working like contact , blog list , about but when I go into view a post then it takes a while to load and then I got gateway timeout ?
Any ideas ?
Thanks Sergiu C.