𝐑𝐞𝐟𝐥𝐞𝐜𝐭𝐢𝐧𝐠 𝐨𝐧 𝐚𝐧 𝐈𝐧𝐜𝐫𝐞𝐝𝐢𝐛𝐥𝐞 𝐉𝐨𝐮𝐫𝐧𝐞𝐲: 𝐓𝐡𝐞 𝐅𝐢𝐫𝐬𝐭 𝐋𝐚𝐫𝐚𝐯𝐞𝐥𝐢𝐚𝐧𝐬 𝐌𝐞𝐞𝐭𝐮𝐩 𝐢𝐧 𝐏𝐚𝐤𝐢𝐬𝐭𝐚𝐧 ❤️
After dedicating my personal efforts and hard work for the last 9 months finally, I successfully arranged my first-ever Laravelians ❤️ meetup yesterday! 🎉
Though the number of attendees was very small, but I don't care, it will not stop me from chasing my dream of building the largest PHP/Laravel community for Pakistanis (maybe even the biggest in the world) and to bring Laracon to Pakistan!
With consistency and passion, this community will grow stronger and more motivated every day.
𝐈𝐧 𝐒𝐀𝐇 𝐀𝐋𝐋𝐀𝐇. 🌟
𝐒𝐭𝐚𝐲 𝐭𝐮𝐧𝐞𝐝, @𝐃𝐞𝐚𝐫𝐋𝐚𝐫𝐚𝐯𝐞𝐥𝐢𝐚𝐧𝐬 ❤️ 𝐟𝐫𝐨𝐦 𝐋𝐚𝐡𝐨𝐫𝐞 𝐚𝐧𝐝 𝐊𝐚𝐫𝐚𝐜𝐡𝐢! 🚀😉
#Laravel #Laravelians❤️ #TaylorOtwell #MuhammadAbdullahM

Muhammad Abdullah Mirza
@muhammadabdullahmirza
I'm in strong ties with Web Development 😇
• • 41 Posts • 168 Views
𝗧𝗶𝗽 𝗼𝗳 𝗧𝗵𝗲 𝗗𝗮𝘆 𝗳𝗼𝗿 𝗟𝗮𝗿𝗮𝘃𝗲𝗹𝗶𝗮𝗻𝘀❤️
Dear! Laravelians❤️,
Today, I want to show you the power of Laravel's built-in relationship attribute selection syntax 🚀💪🚀
𝟏. 𝐖𝐡𝐚𝐭 𝐢𝐬 𝐇𝐚𝐩𝐩𝐞𝐧𝐢𝐧𝐠?
𝗶𝗺𝗮𝗴𝗲𝘀:𝗶𝗱,𝗽𝗿𝗼𝗱𝘂𝗰𝘁_𝗶𝗱,𝗽𝗿𝗼𝗱𝘂𝗰𝘁_𝗶𝗺𝗮𝗴𝗲: Fetches only the id, product_id, and product_image columns from the images relationship.
𝗰𝗮𝘁𝗲𝗴𝗼𝗿𝘆:𝗶𝗱,𝗰𝗮𝘁𝗲𝗴𝗼𝗿𝘆_𝗻𝗮𝗺𝗲,𝗰𝗮𝘁𝗲𝗴𝗼𝗿𝘆_𝗶𝗺𝗮𝗴𝗲: Fetches only the id, category_name, and category_image columns from the category relationship.
🚀 𝗝𝘂𝘀𝘁 𝗧𝗿𝗶𝗲𝗱 𝗟𝗮𝗿𝗮𝘃𝗲𝗹 𝗖𝗹𝗼𝘂𝗱, 𝗮𝗻𝗱 𝗜’𝗺 𝗕𝗹𝗼𝘄𝗻 𝗔𝘄𝗮𝘆! 🚀
Today, I had the chance to explore 𝗟𝗮𝗿𝗮𝘃𝗲𝗹 𝗖𝗹𝗼𝘂𝗱, the new self-managed PAAS platform by Laravel, and I must say—it’s a game-changer for Laravel developers!
𝗧𝗵𝗲 𝗨𝗜 𝗶𝘀 𝗶𝗻𝗰𝗿𝗲𝗱𝗶𝗯𝗹𝘆 𝘂𝘀𝗲𝗿-𝗳𝗿𝗶𝗲𝗻𝗱𝗹𝘆, and the navigation is so smooth that even a beginner can deploy an application in minutes.
𝗧𝗶𝗽 𝗼𝗳 𝗧𝗵𝗲 𝗗𝗮𝘆 𝗳𝗼𝗿 𝗟𝗮𝗿𝗮𝘃𝗲𝗹𝗶𝗮𝗻𝘀❤️
Hey! Guess what?
𝗧𝗵𝗲𝗿𝗲'𝘀 𝗻𝗼 𝗻𝗲𝗲𝗱 𝘁𝗼 𝘂𝘀𝗲 "𝗳𝗼𝗿𝗲𝗮𝗰𝗵()" 𝗹𝗼𝗼𝗽𝘀 𝗶𝗻 𝘆𝗼𝘂𝗿 𝗟𝗮𝗿𝗮𝘃𝗲𝗹 𝗔𝗽𝗽𝘀 anymore because Laravel has its own built-in 𝗖𝗼𝗹𝗹𝗲𝗰𝘁𝗶𝗼𝗻 𝗛𝗲𝗹𝗽𝗲𝗿𝘀 to make your life easier!
𝐔𝐬𝐞 𝐂𝐚𝐬𝐞
Imagine you’re building an e-commerce app where customers place orders. Each order has multiple items (order_items), and each item is linked to a product. Each product has a weight or volume attribute & you have to fetch the sum of weight or volume of all products for calculating your delivery charges.
𝗪𝗶𝘁𝗵𝗼𝘂𝘁 𝗖𝗼𝗹𝗹𝗲𝗰𝘁𝗶𝗼𝗻 𝗛𝗲𝗹𝗽𝗲𝗿𝘀: You’d have to write a loop maybe nested loops to calculate the total weight or volume of all products in the order.
𝗪𝗶𝘁𝗵 𝗖𝗼𝗹𝗹𝗲𝗰𝘁𝗶𝗼𝗻 𝗛𝗲𝗹𝗽𝗲𝗿𝘀: You can use Laravel’s pluck() and sum() methods to do the same thing in just one
𝗧𝗶𝗽 𝗼𝗳 𝗧𝗵𝗲 𝗗𝗮𝘆 𝗳𝗼𝗿 𝗟𝗮𝗿𝗮𝘃𝗲𝗹𝗶𝗮𝗻𝘀❤️
Do you know...!!
𝗧𝗵𝗲𝗿𝗲'𝘀 𝗻𝗼 𝗻𝗲𝗲𝗱 𝘁𝗼 𝘂𝘀𝗲 𝘁𝗵𝗲 "𝘁𝗿𝘆-𝗰𝗮𝘁𝗰𝗵" 𝗯𝗹𝗼𝗰𝗸 𝗶𝗻 𝘆𝗼𝘂𝗿 𝗟𝗮𝗿𝗮𝘃𝗲𝗹 𝗔𝗽𝗽𝘀 because Laravel has its own built-in 𝗛𝗮𝗻𝗱𝗹𝗲𝗿 𝗰𝗹𝗮𝘀𝘀 to control global exceptions from a single class. In Laravel 10 & below it lives under "𝗮𝗽𝗽\𝗘𝘅𝗰𝗲𝗽𝘁𝗶𝗼𝗻𝘀" directory.
𝟏. 𝐖𝐡𝐚𝐭 𝐢𝐬 𝐇𝐚𝐩𝐩𝐞𝐧𝐢𝐧𝐠?
𝗿𝗲𝗴𝗶𝘀𝘁𝗲𝗿(): The default method to register all reportable() & renderable() exceptions.
𝗿𝗲𝗻𝗱𝗲𝗿𝗮𝗯𝗹𝗲(): A built-in method to render a response when a specific exception is caught.
𝗧𝗵𝗿𝗼𝘄𝗮𝗯𝗹𝗲: Any throwable exception that can occur in your application.
𝟐. 𝐔𝐬𝐞 𝐂𝐚𝐬𝐞
If you are working on a large application & you don't want to add "try-catch" block everywhere to keep your code clean & maintainable then you can use the power of Laravel Handler class.
𝐑𝐞𝐟𝐥𝐞𝐜𝐭𝐢𝐧𝐠 𝐨𝐧 𝐚𝐧 𝐈𝐧𝐜𝐫𝐞𝐝𝐢𝐛𝐥𝐞 𝐉𝐨𝐮𝐫𝐧𝐞𝐲: 𝐓𝐡𝐞 𝐅𝐢𝐫𝐬𝐭 𝐋𝐚𝐫𝐚𝐯𝐞𝐥𝐢𝐚𝐧𝐬 𝐌𝐞𝐞𝐭𝐮𝐩 𝐢𝐧 𝐏𝐚𝐤𝐢𝐬𝐭𝐚𝐧 ❤️
After dedicating my personal efforts and hard work for the last 9 months finally, I successfully arranged my first-ever Laravelians ❤️ meetup yesterday! 🎉
Though the number of attendees was very small, but I don't care, it will not stop me from chasing my dream of building the largest PHP/Laravel community for Pakistanis (maybe even the biggest in the world) and to bring Laracon to Pakistan!
With consistency and passion, this community will grow stronger and more motivated every day.
𝐈𝐧 𝐒𝐀𝐇 𝐀𝐋𝐋𝐀𝐇. 🌟
𝐒𝐭𝐚𝐲 𝐭𝐮𝐧𝐞𝐝, @𝐃𝐞𝐚𝐫𝐋𝐚𝐫𝐚𝐯𝐞𝐥𝐢𝐚𝐧𝐬 ❤️ 𝐟𝐫𝐨𝐦 𝐋𝐚𝐡𝐨𝐫𝐞 𝐚𝐧𝐝 𝐊𝐚𝐫𝐚𝐜𝐡𝐢! 🚀😉
#Laravel #Laravelians❤️ #TaylorOtwell #MuhammadAbdullahM