Skip to content
Advertisement

Tag: laravel

Laravel 8: delete() does not delete from the DB

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

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

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

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.

Advertisement