I am currently working on a laravel php project. In this case, a table containing countries should be created. There are three fields within the table: a short country code column called country_code and the name of the country in german and english language in the columns country_name_de and country_code_en.…
Tag: php
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 no…
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 …
jQuery send data to a new open tab and get the data
I want to send some data from ClassA to ClassB . So what I did is I create a hidden form in my ClassA view page and post it to ClassB. Then from the js part But then I dont know how can I get the post data from ClassA. I have tried getting the data from $_POST in the
: 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 c…
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.
Display date with ordinal suffix in PHP
I am currently displaying date in my php code like below its giving me output like Monday Mar 08 2021 Instead I want output like Monday Mar 08th 2021 I have found function on this answer But I am not getting idea how I can use it with my date format. Let me know if anyone here can help me
How to replace all timestamps to date in a single string in PHP?
i need to replace all timestamps into a date but they’re all in the same string and the output needs to be in the same string, i tried different methods but i can’t get it working The string format is like this one: The output should be like Answer preg_replace_callback() will do the job for you.
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, …
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 a…