https://www.php.net/manual/en/function.str-pad.php Useful when for example add 0000 prefix to and ID (int) STR_PAD_LEFT / RIGHT https://www.w3resource.com/mysql/string-functions/mysql-lpad-function.php https://stackoverflow.com/questions/3446538/cleanest-way-to-skip-a-foreach-if-array-is-empty https://laravel.io/forum/07-28-2014-error-using-this-when-not-in-object-context $table is an instance variable, not a static variable, so you can't use it in a static function (basic PHP). Damn basic PHP that I miss, and many interview question asked this shit. Yeah, update Model func remove static and update Controller call: // Model public function findMyReviewedShop() {} // Controller $data = (new AreaModel)->findMyReviewedShop($user_id, $area_id); // instead of :: https://stackoverflow.com/questions/34947862/how-to-use-hasmanythrough-with-more-than-3-tables-in-laravel Questions: 1. Is relation query return all related data ? ie. review->shopdata ... This is...
Some tribes of the programmer clan.