[Solved] i need to print currently no products in my laravel page using else condtion [closed]

Your question is unclear, but I think I know what you want to accomplish. Before your foreach you need to check the products count. If products are found, then loop them, if not, display a message. Try this: @if(count($data[‘products’])) @foreach ($data[‘products’] as $list) <div class=”col-6 col-md-4 tt-col-item”> <div class=”tt-product thumbprod-center”> <div class=”tt-description”> <div class=”tt-row”> </div> … Read more

[Solved] Printing key value pair in Laravel blade using for each loop [closed]

Your code is a mess. here is a cleaner version without using the models (since you did not say if they are in place) Controller Code public function show_friend_request() { $user_id = auth()->user()->id; $senderIds = DB::table(‘friendships’)->where(‘recipient_id’, $user_id)->where(‘status’, ‘pending’)->pluck(‘sender_id’)->toArray(); $activeRequests = DB::table(‘users’) ->whereIn(‘id’, $senderIds) ->get([‘first_name’,’last_name’]); return view(‘pages.friend_request’)->with(‘activeRequest’, $activeRequests); } Blade Code @foreach($activeRequest as $key => $friend) … Read more

[Solved] PDOException SQLSTATE[HY000] [2002] No such file or directory

The error message indicates that a MySQL connection via socket is tried (which is not supported). In the context of Laravel (artisan), you probably want to use a different / the correct environment. Eg: php artisan migrate –env=production (or whatever environment). See here. 5 solved PDOException SQLSTATE[HY000] [2002] No such file or directory

[Solved] How can i upload and post an image to linkedin using api?

Use Linkedin V2 API.Below code will upload the image. curl -i –upload-file /Users/peter/Desktop/superneatimage.png –header “Authorization: Bearer redacted” ‘https://api.linkedin.com/mediaUpload/C5522AQGTYER3k3ByHQ/feedshare-uploadedImage/0?ca=vector_feedshare&cn=uploads&m=AQJbrN86Zm265gAAAWemyz2pxPSgONtBiZdchrgG872QltnfYjnMdb2j3A&app=1953784&sync=0&v=beta&ut=2H-IhpbfXrRow1’ I suggest you to use Guzzle HTTP client to exicute this in your PHP application solved How can i upload and post an image to linkedin using api?

[Solved] Symfony\Component\Debug\Exception\FatalThrowableError Parse error: syntax error, unexpected ‘->’ (T_OBJECT_OPERATOR) [duplicate]

Symfony\Component\Debug\Exception\FatalThrowableError Parse error: syntax error, unexpected ‘->’ (T_OBJECT_OPERATOR) [duplicate] solved Symfony\Component\Debug\Exception\FatalThrowableError Parse error: syntax error, unexpected ‘->’ (T_OBJECT_OPERATOR) [duplicate]

[Solved] How to Convert this sql query into laravel query builder

$result = DB::table(‘table as t’) ->select(‘t.product_id’, ‘t.on_hand’, ‘t.created_at’) ->join(DB::raw(‘(SELECT MAX(purchase_id) as pId FROM table Group by product_id) tg’), function($join) { $join->on(‘t.purchase_id’, ‘=’, ‘tg.pId’); })->get(); 1 solved How to Convert this sql query into laravel query builder

[Solved] number_format(): Argument #1 ($num) must be of type float [closed]

Pluck will still return a collection. You’d need to iterate through it, either with another foreach loop, or such as through map, etc: @foreach($amazings as $product) @foreach($product->prices->pluck(‘value’)->all() as $val) {{ number_format($val) }} @endforeach @endforeach solved number_format(): Argument #1 ($num) must be of type float [closed]

[Solved] Query data in database to show posts

Laravel Blade allows to use a helpful set of variable like Loop Variable When looping, a $loop variable will be available inside of your loop. This variable provides access to some useful bits of information such as the current loop index and whether this is the first or last iteration through the loop: @foreach($news as … Read more

[Solved] Where I must contain business logic of my application? [closed]

It’s down to preferences. As long as you are using the correct standards, you should be fine! So in Laravel, I use Models strictly for database operations. I also create a folder called Services and another folder called Hydrators My services in the service folder handles the business logic e.g grabbing data from the models … Read more

[Solved] What is the right granularity for a microsrevice? [closed]

The answer is, it depends. One way to answer your question is to look at how your teams are organized. Do you have teams organized around Flight Aggregation, Payment, Hotel Booking and Flight booking? If you have, then maybe it makes sense mimic this organization structure in your microservice architecture. After all, Conway’s law state … Read more