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…
Tag: laravel
Blade – Print variable into variable
I am trying to print a variable into another variable in a blade template. I have a variable from database that contains “dynamic” data from another variable. Example: $foo = ‘user’; $bar = ‘Hello {{…
Laravel Sum Eloquent sum of multiple multiplications from two different tables
Currently, in my Laravel project controller, I am using one query QUERY 1 public function cartreview(Request $request,$sp_id, $service_id,$cart_id) { $total = DB::table(‘pricings’) ->…
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
API requests with axios always unauthorized with Laravel API
I’m working on a personal project using Laravel 5.6 and Axios library (standard Laravel 5.6 package). I need to send first GET then POST request using Laravel’s API and axios’ http requests, but I’m …
How to use date time picker in sweet alert?
This is my code i am working on swal({ title: “Confirm details?”, text:”, type: “…
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…