How can I type hint the return types in PHP for the following RECURSIVE function?

|
Riya 2022-03-16 08:58:42
laravel_discuss-111825.jpg
How to solve this error
NoName 2022-03-16 09:09:51
Has anyone ever done login with client_id, client_secret, oauth0, please give me an example, thank all.
udev21 2022-03-16 09:13:08
NoName 2022-03-16 09:09:51
Has anyone ever done login with client_id, client_secret, oauth0, please give me an example, thank all.

try laravel passport

2022-03-16 09:30:15
2022-03-11 12:25:11
Join → @iGram

permisi saya pingin tanya tentang Jelaskan mengapa seorang programmer harus membuat konsep user interface sebelum ke langkah selanjutnyaTMS?

Siavashakbarzadeh 2022-03-16 09:41:54
How I can work with mini server in laravel ?
shweta_keshri 2022-03-16 09:50:22
Urgent requirement!!…

Hello all , we are hiring for Android developer requirement
Who is looking for remote opportunity as a developer in india. Are you available for 8 hours? Mon to Friday then please dm me.
Note:- Experience must :3years (contract)

inside_rt 2022-03-16 13:03:09
Siavashakbarzadeh 2022-03-16 09:41:54
How I can work with mini server in laravel ?

What do you mean by mini server?

Arisly 2022-03-16 13:16:37
laravel_discuss-111841.jpg
anyone know how to solve using php
Arisly 2022-03-16 13:17:54
laravel_discuss-111842.jpg
anyone know how to solve using php
Venusky 2022-03-16 13:36:04
how to solve this error? jquery-3.6.0.min.js not found
mynameisbrad 2022-03-16 14:37:50
OneMovile 2022-03-16 07:34:46
This is where it fails $this->firstname = $user->CustomAddressBook->firstname;

First the code is a mess. You already have the user object when calling Auth::user(), you don’t need to fire another query like User:find() after that. And you are calling $this->firstname not $user->firstname.

mynameisbrad 2022-03-16 14:45:59
Arisly 2022-03-16 13:17:54
anyone know how to solve using php

That can help you – https://w3codeworld.com/article/110/php-program-to-check-the-input-character-is-a-vowel-or-consonant-character

PHP program to check whether input character is vowel or consonant using if else – W3CODEWORLDW3Codeworld
mynameisbrad 2022-03-16 14:46:38
Venusky 2022-03-16 13:36:04
how to solve this error? jquery-3.6.0.min.js not found

Maybe you have the path wrong, does the file exists in your file system and are you giving the relative path to it.

Venusky 2022-03-16 14:47:35
mynameisbrad 2022-03-16 14:46:38
Maybe you have the path wrong, does the file exists in your file system and are you giving the relative path to it.

no, I get it directly on online

bsamaasi 2022-03-16 14:47:39
OneMovile 2022-03-16 07:32:39
I have deleted the firstname record directly from the db, so it throws this exception, how can I tell laravel to do something else when its null

Wrap the object in a optional function, there’s a helper function in laravel called optional()… then in your case it will be optional($user->CustomAddressBook)->firstname

You can read more about it in the documentation or dig deep on the function, likely you could be able to pass a default and using it as explain will prevent it throwing an error when null

Venusky 2022-03-16 14:48:31
mynameisbrad 2022-03-16 14:46:38
Maybe you have the path wrong, does the file exists in your file system and are you giving the relative path to it.

<script type=”text/javascript” src=”https://code.jquery.com/jquery-3.6.0.min.js” integrity=”sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=” crossorigin=”anonymous”></script>

Venusky 2022-03-16 14:50:08
that’s the link I use, on my laptop, everything is wel but when I have deployed on a unbutu, I get that error
mynameisbrad 2022-03-16 14:50:51
Hm is the Ubuntu connected to the internet?
bsamaasi 2022-03-16 14:54:48
OneMovile 2022-03-16 07:34:46
This is where it fails $this->firstname = $user->CustomAddressBook->firstname;

Like @mynameisbrad stated why look for the user when you already have it, you running a double query. You can assign the auth user directly to the user variable, and take off the user find, not necessary

bsamaasi 2022-03-16 14:56:51
mynameisbrad 2022-03-16 14:37:50
First the code is a mess. You already have the user object when calling Auth::user(), you don’t need to fire another query like User:find() after that. And you are calling $this->firstname not $user->firstname.

I think the $this->firstname was very clear there, being a property found in that class.

mynameisbrad 2022-03-16 14:58:40
bsamaasi 2022-03-16 14:56:51
I think the $this->firstname was very clear there, being a property found in that class.

Yup you are right. The CusttomAdressBook0>first name is giving the error, because the relationship is not found

mynameisbrad 2022-03-16 15:00:31
@bsamaasi and optional() is nice approach, didn’t know that, I would always IF it.
bsamaasi 2022-03-16 15:02:14
mynameisbrad 2022-03-16 15:00:31
@bsamaasi and optional() is nice approach, didn’t know that, I would always IF it.

Yeah, it exists.

Venusky 2022-03-16 15:04:42
mynameisbrad 2022-03-16 14:50:51
Hm is the Ubuntu connected to the internet?

yes

ForgeDark 2022-03-16 15:44:33
Any .jp smtp or old g-suite seller here? dm
Noob Developer 2022-03-16 15:51:33
$this->db->select(‘*’);
$this->db->from(‘enrol’);
$this->db->where(‘user_id’=$certificateObj[‘user_id’]);
$this->db->where(‘course_id’=$certificateObj[‘source_id’]);
$earned_at = $this->db->get();
Noob Developer 2022-03-16 15:51:45
i dont know how to do
Noob Developer 2022-03-16 15:52:27
user_id =” . $certificateObj[‘user_id’] . dont know how this in quiry buider
Siavashakbarzadeh 2022-03-16 16:00:42
inside_rt 2022-03-16 13:03:09
What do you mean by mini server?

Mini server that has a folder with files I need access to that files

inside_rt 2022-03-16 16:17:59
Venusky 2022-03-16 13:36:04
how to solve this error? jquery-3.6.0.min.js not found

Either you gave the path incorrect or or the file is missing in the mentioned path

DesolatorMagno 2022-03-16 17:36:11
OneMovile 2022-03-16 07:34:46
This is where it fails $this->firstname = $user->CustomAddressBook->firstname;

You can make a default model, so it return when it gets null from database, or you can check if the relation is empty.

flyingdragons 2022-03-16 18:03:28
Hello! How can I type hint the return types in PHP for the following RECURSIVE function?

function display(array $input)
{
foreach ($input as $key => $value) {
echo $key;

if (is_array($value)) {
/** Call the same function again */
return display($value);
}

echo $value;
}
}

The following works but I get 500 Internal error in the console of the browser

function display(array $input) : mixed

Is there a way I can use UNION Types over here? If yes then which are those

web design 2022-03-16 18:08:27
laravel_discuss-111869.jpg

web design 2022-03-16 18:08:37
What is this error/
Mr. N♡ ♡N€🇮🇳 2022-03-16 18:12:43
web design 2022-03-16 18:08:27

seems like Something wrong in your attributes table structure ….

|