Skip to content

hasManyThrough laravel relation

I have three table below. hasManyThrough in Country::class model to get all products. I want products which are related to countries or one country: Answer The relation you’re describing best suits a many to many, which is usually written in Laravel as a belongsToMany on both sides. If you stick to Lara…

PHP not reading $_GET parameter when sending an AJAX request

I’ve been struggling with this since months, and finally got to the point I need to fix it on my project. The thing is, I’m sending an ajax request to a php file where I need to read the current $_GET[‘user_id’] value in order to insert a query. But php just won’t read $_GET[&#82…