Add an extra column on your user table in the database and check the flag?

|
Pro 2020-07-30 19:24:02
It’s depends on ur project
ElyorDjalalov 2020-07-30 19:39:01
laravel_discuss-46683.jpg

ElyorDjalalov 2020-07-30 19:39:45
I just wanna send uploaded file name to DB column named avatar but not working its showing Null as I mentioned beforehand
2020-07-30 19:41:26
oxbir 2020-07-30 13:05:11
Which CSS property will make text bold?

You’re in wrong boat..

ElyorDjalalov 2020-07-30 19:42:02
laravel_discuss-46687.jpg

ElyorDjalalov 2020-07-30 19:43:42
Image is not being uploaded so db is showing null
ElyorDjalalov 2020-07-30 19:43:53
Any suggestions???
ElyorDjalalov 2020-07-30 19:47:15
The uploadAvatar function returning nothing. It is not even redirecting me back after I upload
2020-07-30 19:47:20
If u just don’t trust (your code) if u r going right or wrong, assign variable and make dd and see what you’re getting.
ElyorDjalalov 2020-07-30 19:48:23
Ok I will.
ElyorDjalalov 2020-07-30 19:48:33
Any other suggestions???
flyingdragons 2020-07-30 19:52:11
ElyorDjalalov 2020-07-30 19:39:01

1. Check if your form has enctype=”multipart/form-data”
2. Make sure you have given the name of input to image

flyingdragons 2020-07-30 19:53:10
If you need detailed setp by step instructions then please checkout the following article
flyingdragons 2020-07-30 19:53:21
https://stackcoder.in/posts/file-upload-in-laravel-php

File Upload In Laravel PHP | StackCoderStackCoder
In this article lets get our hands dirty by working on File Upload In PHP Laravel.
flyingdragons 2020-07-30 19:53:48
Even I have written an article for multiple file upload with Laravel kindly check it too
flyingdragons 2020-07-30 19:53:59
https://stackcoder.in/posts/multiple-file-uploads-in-laravel-php

Multiple File Uploads In Laravel PHP | StackCoderStackCoder
In this article, we will learn how to do Multiple File Uploads In PHP Laravel.
ElyorDjalalov 2020-07-30 19:54:49
laravel_discuss-46699.jpg

flyingdragons 2020-07-30 19:54:59
ElyorDjalalov 2020-07-30 19:39:01

Even if you share your HTML code it will be very help to check the same

ElyorDjalalov 2020-07-30 19:55:44
ElyorDjalalov 2020-07-30 19:54:49

Here u go bro

flyingdragons 2020-07-30 19:56:18
ElyorDjalalov 2020-07-30 19:54:49

1. There is typo in button, you have comma (,)

2. On submit are you going to that particular function

ElyorDjalalov 2020-07-30 19:56:43
What?😬
flyingdragons 2020-07-30 19:56:44
Can you please add dd
flyingdragons 2020-07-30 19:57:18
ElyorDjalalov 2020-07-30 19:56:43
What?😬

Can you please share your route code too?

ElyorDjalalov 2020-07-30 19:57:43
Just a second
2020-07-30 19:58:51
Pro 2020-07-30 19:24:02
It’s depends on ur project

I really don’t know a lot about them and I am beginner in Laravel, Should I learn them or Should I master Laravel first ?

ElyorDjalalov 2020-07-30 19:58:55
laravel_discuss-46708.jpg

Mr_Classy 2020-07-30 19:59:18
Sumanta_mukhopadhyay 2020-07-30 16:24:05
Need wordpress developer

I m interested @Sumanta_mukhopadhyay

flyingdragons 2020-07-30 19:59:41
ElyorDjalalov 2020-07-30 19:39:01

Change the name of the method to index()

flyingdragons 2020-07-30 20:00:07
ElyorDjalalov 2020-07-30 19:58:55

In your controller your having uploadAvatar

flyingdragons 2020-07-30 20:01:18
ElyorDjalalov 2020-07-30 19:58:55

Both your GET & POST request are pointing to same method in UserController please change those accordingly or handle properly

ElyorDjalalov 2020-07-30 20:02:06
flyingdragons 2020-07-30 19:59:41
Change the name of the method to index()

I didnt get this

ElyorDjalalov 2020-07-30 20:03:20
flyingdragons 2020-07-30 20:00:07
In your controller your having uploadAvatar

ok

smartnathan2020 2020-07-30 20:03:34
flyingdragons 2020-07-30 20:01:18
Both your GET & POST request are pointing to same method in UserController please change those accordingly or handle properly

Let’s see your Usercontroller

ElyorDjalalov 2020-07-30 20:04:18
flyingdragons 2020-07-30 20:01:18
Both your GET & POST request are pointing to same method in UserController please change those accordingly or handle properly

yeah I understand but how?

flyingdragons 2020-07-30 20:04:50
Your POST request ie /upload is pointing to UserController -> index. So inside web.php change Route::post(‘/upload’, ‘UserController@uploadAvatar’)
flyingdragons 2020-07-30 20:05:40
@ElyorbekDjalalov Did you understand?
smartnathan2020 2020-07-30 20:07:26
ElyorDjalalov 2020-07-30 19:39:01

Okay, sorry I didn’t see this. Does your User model have avatar in the fillable property. Because you are doing a mass assignment with the update method.

ElyorDjalalov 2020-07-30 20:07:47
huh, yeah it works now. But I didnt get the point.šŸ˜ž
ElyorDjalalov 2020-07-30 20:07:58
thanks a lot anyway
flyingdragons 2020-07-30 20:08:12
No worries bro. Good to know it worked
flyingdragons 2020-07-30 20:08:34
Please check out the above articles. There some interesting stuff for uploading files
ElyorDjalalov 2020-07-30 20:08:53
For sure I will
ElyorDjalalov 2020-07-30 20:09:09
take care thanks for your time and Happy coding
ElyorDjalalov 2020-07-30 20:10:48
smartnathan2020 2020-07-30 20:07:26
Okay, sorry I didn’t see this. Does your User model have avatar in the fillable property. Because you are doing a mass assignment with the update method.

yes there is avatar fillable, thanks

S3NX_8 2020-07-30 20:18:04
I have issues connecting to postgres db
I have configured the env file but
Keep getting this error saying can’t find driver

Anyone help
Tnx in advance

Pro 2020-07-30 20:20:05
2020-07-30 19:58:51
I really don’t know a lot about them and I am beginner in Laravel, Should I learn them or Should I master Laravel first ?

U can learn them while u r mastering laravel.

EsmyAlysia 2020-07-30 21:30:40
Hi everybody i’m an Italian girl, excuse me for my bad english. Do you know how to detect a user first login in laravel?
natghi2010 2020-07-30 21:47:24
EsmyAlysia 2020-07-30 21:30:40
Hi everybody i’m an Italian girl, excuse me for my bad english. Do you know how to detect a user first login in laravel?

add an extra column on your user table in the database and check the flag?

EsmyAlysia 2020-07-30 21:50:58
yes, I thought so, too, but I don’t know where to put this control code correctly. I read the official records, but there is other controllers and middleware, but I think it can be easier
EsmyAlysia 2020-07-30 21:51:58
Sorry but I recently started working with laravel
|