Laravel 8 database connection not working

Trying to connect laravel 8 app in production to mysql database. Have tried to follow documentation but it isn’t working. .env file as follows DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 …

Months name is not showing in German in PHP?

Hi I am trying to display months name in PHP but it is not showing in German language in MYSQL, my date is showing as 2021-01-23 which I converted into months by using PHP function Month(), MONTH(…

The argument type ‘String’ can’t be assigned to the parameter type ‘Uri’. Flutter

I’m having a trouble, why I’m getting this error in my app flutter main.dart I just follow this reference link. It would be great if anybody could figure out, thank you so much in advance!. Here’s …

Populate database table with Laravel Faker from pre-populated table

I want to populate a table with listings of car offers with dummy data. The specific is that I want the make and model to be from a table already created in the database. Also the listing’s title to …

How to optimize an increment query in Laravel?

in a Laravel project I am incrementing views based on session I am using it like this: $post = Post::whereSlug($slug)->firstOrFail(); $postKey = ‘post_’.$post->id; if (!Session::has($postKey)) …

how to get all user based on where condition and compare this result with another condition in laravel eloquent

I have a user table column referred_by: I have a view for step 1 user like where referred_by=auth::user()->id In here whoever registered by this user referal link will be shown in this table: I …

Can’t get a list of streets to create a card [closed]

public function create() { $streets = street::get(); return view(‘dashboard.house.created’); } public function store(Request $request) { $this->validate($request, [ …

Add the results from a PHP array into a SQL Select for each Result to be procesed

I am a newbie so I want to know if what I am asking is possible. I have a SQl Select query that returns a While loop and I convert the results (peoples names)to a php Array. In a another SQL Query …

From database via join to REST how does it work?

I have a database with two tables (orders & orderProducts) with 1:n-Relation. I would like to combine this two tables to give a JSON to my REST-Tool. For this I have the following SQL-Query: $…

I am trying to run a query in php its working in phpMyAdmin but not in script [closed]

Iam trying to fetch related articles for a blog based project Query : $query = mysqli_query($con, “SELECT * FROM posts WHERE cat_id like ‘%$cat_arr[i]%’ AND NOT post_id = ‘$postid'”); …