Skip to content

Tag: laravel

Error in linkedin media upload api

I am trying to upload an image using linkedin api. I already uploaded image in my server and now I want to upload the upoaded image url to linkedin. But I got the error { “serviceErrorCode”:0,”message”:”The request is not a multipart request”,”status”:400 } This…

Custom fields in laravel 5.6 default auth causing error

Before posting this question i’ve already referred to How to add custom field in default registration form of Laravel 5.6? But no solution for my problem. I wanted to add custom fields in my laravel 5.6 fresh install with it’s default make:auth. this is my migration for creating user table this is…

Using Laravel whenLoaded() deeper than one level

How do I use whenLoaded() for deeper than one level relations? It seems as if one can only use whenLoaded with the first relation depth like this: But then Laravel, if origin is loaded, but not season, Laravel will load it, which creates an N+1 problem. Both origin and season relationships are conditional, an…

How to add custom field in default registration form of Laravel 5.6?

In one of my Laravel 5.6 applications, I need to add a few more fields in the default registration form. So I’ve added only one field to test [phone_no] in the default registration form registration.blade.php, and also add phone_no RegisterController, but when I click on the register button it shows the…

Time format in laravel migration?

I want to have an input, where you put a time in EU format like 12:00 or 21:34. (hh:mm) How do I do that? This is what I have, but it’s obviously wrong. Answer In laravel 5.6 you have this new feature that you can cast your timestamp so your migration should be like this And in your Post model

Combine validation errors and return one single message

I have two arrays I want to validate in my custom Request: This returns an error message per each word. But I want a single general message like “Some of the words are invalid”. Is there any Laravel-way to do this? Answer You could do this: EDIT: I think I may have found a solution: First, make su…