I’m working with Laravel 8 to develop my forum and I wanted to add some Like and Unlike functionality to question that have been asked by users. So Like function works fine but for Unlike, I got some problem. Here is the method for Unliking: And here is the form behind this: So the problem is it does not delete
Tag: laravel
Laravel 8: Call to a member function user() on array
I’m working with Laravel 8 to develop my forum project, and I wanted to add some like functionality to question that has been asked on forum by users. So here is a form on question.blade.php: And then at LikeController, I added this: But now I get this error: Which is referring to this line: So what is going wrong here?
: SQLSTATE[HY000]: General error: 1364 Field
I got this error, when I added columns on create_posts_table.php. I was creating UserSeederTable but it doesn’t work. And why can’t I create PostSeedertable now? Before the columns adding, there were no errors. Please help. Answer It’s telling you that user_id cannot be null and it’s currently null. This typically means user_id isn’t being filled by the factory. You have
how can I count same products in order table in laravel eloquent? I`m new Laravel user
Here is my Orders table . How many same product are sell. I needed Answer You can write your query n LARAVEL Eloquent in this way.
Laravel + React: Handling API Data
I’m new to react and laravel and I am trying to boost my skills during this god awful lockdown. I’m following tons of tutorials but I keep finding that they are either incomplete, have very bad english or not indepth enough and skip over things too quickly. I don’t mean to sound ungrateful, I love the fact people are sharing
POST http://localhost:8000/offers-ajax/store 419 (unknown status) Laravel AJAX
I’m a beginner in AJAX and trying to post data form by using AJAX, but this error shows in the console: POST http://localhost:8000/offers-ajax/store 419 (unknown status) I do not know why; I tried a lot but nothing seems to work. I tried to post data without using AJAX queries and it works fine. These are the routes: Controller: blade create
Laravel: how to pass GET array to controller?
How to pass array of GET parameters to the controller? This is my route file routes/web.php: And my controller ‘app/Http/Controllers/Parser.php’: So, I expect to get an array of parameters like this: But if I pass GET array to my route path: http://example.com/ids?ids[]=1&ids[]=2&ids[]=15&ids[]=25 I get an empty request object anyway: {“attributes”:{},”request”:{},”query”:{},”server”:{},”files”:{},”cookies”:{},”headers”:{}} Answer There is few ways to get data from GET.
Laravel grouping or taking from list in six
I’m not sure the title of this topic is correct, I apologize, you suppose I have this list which I get them from the database: as you can see we can grouping them with the first part of each item that we can have that them in three groups, after grouping them I want to use foreach for each one
Decrementing row count with Laravel pagination (not Incrementing)
I want to display the row count of a decrementing paginated collection in Laravel, I have searched a lot, and there are methods to do it incrementing order, but not decrementing. Explaining the issue: Using Laravel 8.x, I have a controller method like this (simplified): In my view, I display the data in a table like this And finally the
i cannot change and how to open /etc/my.cnf
I’m new to laravel I’d like to change utf8 from the others but I don’t know why i was not able to open the file and change. please help. Answer You need to add a space between the vi command you are trying execute and the file path you are passing to it.