Skip to content

Tag: laravel

Limit Comment in Post Laravel

So this is the problem, I have application with post and comment. But I want to limit the comment per user, So if there is 1 post only 1 comment per user. Is it possible ? Here is my store function in CommentController: What query can I add in this store function to limit the user to only comment once

PHP Laravel Check if Array is empty

I am struggling with displaying some content depending on if an array does have a value or not.Every time the code in the else part is executed. What’s wrong here? Is there any syntax error with this code? I’m using php laravel. Answer

Upload file using Curl and receive them in Laravel method

I have been trying to upload file to using curl using laravel app end point. Below code is on separate server. And receiving end in laravel app hosted on different server. It returns me empty response. I am able to verify curl request using headers. Any suggestion will be helpful. Thanks. Answer You can try s…