What is images? Is it a database field or relation in User model @bastos?
May 15, 2019
6
Level 1
Update image show white square
Hello there, I'll need your help because when I display an image that I upload, it show a white square. I have a form that I use for a profil picture, It's working, I can upload the picture, BUT it show me a white square instead of the photo. That's html code :
<img src="{{Auth::user()->images}}"/>
<p>{{Auth::user()->firstName}} {{Auth::user()->lastName}}</p>
<a href="{{ url('/my_account') }}">Mon compte</a> | <a href="{{ url('/logout') }}">Se déconnecter</a>
</div>
And that's my ProfilePictureController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
use Auth;
class ProfilePictureController extends Controller
{
public function update(Request $request)
{
$request = $request->All();
User::where('id', Auth::user()->id)
->update(
[
'image' => $request['image']]
);
return redirect()->to('/')->with(['image-changed' => 'Photo de profil modifiée !']);
}
}
I don't know if my question was clear but ask if you need more informations. Thank you.
Please or to participate in this conversation.