Skip to content

Tag: laravel-5.6

upload image to server modifying name

I am building a form with laravel 5.6 and where I save a name and a user photo, but i need the photo to be stored with the username. I show the code of my store I can get the username with $request->nombre; but I don’t know how to assign that name to the photo Answer There is a ->storeAs()

whereJsonContains Laravel 5.6 not working?

The eloquent query above seems to only work when there is a single item in the ‘players’ json array. The data stored in the database looks as follows: [1] vs [“1″,”2”] Is there a reason the whereJsonContains is only working when it sees [1] in the db but not when it sees [&…

Laravel 5.6 time ago in views

Is it possible to echo the Time Ago in my View ( pages.dashboard.dashboard ) Something Like, Expecting output like, Answer First, try an eloquent model. $users = AppUser::orderBy(‘created_at’,’desc’)->limit(5)->get(); in view @foreach($users as $user) {{$user->created_at->d…

Laravel 5.6 – User not getting authenticated

I have looked for days, but my user never gets authenticated when using the auth middleware. We don’t use the standard laravel way, but using the standard auth middleware to block access to a route group. (in this example the dashboards) The data is correct as it doesnt give any error message, but the u…