To trigger a Jenkins job from a Laravel application using Guzzle, you can use the Jenkins API endpoint to build a job. Follow these steps: Create Jenkins Token In Jenkins, click on your User Name from Top Right Navbar, inside that page go to “Configure”. There you will see section “API Token “. Click on “Add new token " and create token. Copy the generated token and save it for future use....
Php

Trigger Jenkins job from Laravel via Guzzle Request

PHP-FPM Get list of running php files
We always find need to know which php files (Malware or otherwise) consuming the CPU and Server resources, so that you can fix those files. FPM status page give this exact information. For that it needs to be enabled and configured in your apache confirguration where you want it to be displayed. Find where your FPM configuration is and edit www.conf. nano /etc/php/7.4/fpm/pool.d/www.conf Update file for: pm.status_path = /fpm7.4-status Restart FPM sudo service php7....

Integrate Zoho Cliq OAuth API in PHP Laravel using Guzzle
Zoho has created amazing Product ecosystem but is very poor while implementing the Clean API’s for it’s users. Reference API Docs: https://www.zoho.com/cliq/help/restapi/v2/ In this article we will be demonstrating How to send a simple Message to Cliq Channel and ** Bot Subscribers**. 1. Setup a Server-based Application Zoho Admin Panel Link: https://api-console.zoho.com Add http://app.test/cliq-redirect url as ‘Authorized Redirect URIs ‘. Create a Organization Channel in Cliq named mychannel. Create a Bot with ** Listen** and ** Send** Permission and name it mybot....

How to switch PHP Versions on LAMP Server
Use multiple PHP versions on same server and manage currently running (default) php version for terminal. Install multiple PHP Versions: sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt-get install php8.1 sudo apt-get install php8.4 sudo a2enmod php8.1 sudo a2enmod php8.4 Switch: sudo update-alternatives --config php

Creating TimeAgo function in PHP
Many times while displaying time on website we need to do something extra. This function script can give you time in days/hour/minutes/seconds ago format. You just need to pass the mysql time to this function. like this: echo timeago("2013-11-24 18:00:09"); function timeago($timeStr) { $time = strtotime($timeStr); $output = ""; $time_difference = time() - $time; $seconds = $time_difference ; $minutes = round($time_difference / 60 ); $hours = round($time_difference / 3600 ); $days = round($time_difference / 86400 ); $weeks = round($time_difference / 604800 ); $months = round($time_difference / 2419200 ); $years = round($time_difference / 29030400 ); if($seconds <= 60) { // Seconds $output = "$seconds seconds ago"; } else if($minutes <=60) { //Minutes if($minutes==1) { $output = "one minute ago"; } else { $output = "$minutes minutes ago"; } } else if($hours <=24) { //Hours if($hours==1) { $output = "one hour ago"; } else { $output = "$hours hours ago"; } } else if($days <= 7) { //Days if($days==1) { $output = "one day ago"; } else { $output = "$days days ago"; } } else if($weeks <= 4) { //Weeks if($weeks==1) { $output = "one week ago"; } else { $output = "$weeks weeks ago"; } } else if($months <=12) { //Months if($months==1) { $output = "one month ago"; } else { $output = "$months months ago"; } } else { //Years if($years==1) { $output = "one year ago"; } else { $output = "$years years ago"; } } return $output; } Note : Sometimes you may get time error while using this function because of timezone....

Mobile OS detection in PHP CodeIgniter
For doing this there is one good plugin called “Mobile Detect”. Just download library from https://github.com/serbanghita/Mobile-Detect Put Mobile_Detect.php inside libraries folder of ci application. Whenever you need to detect the OS or any other parameter, use following code: public function index() { $this -> load -> library('Mobile_Detect'); $detect = new Mobile_Detect(); if ($detect->isMobile() || $detect->isTablet() || $detect->isAndroidOS()) { header("Location: ".$this->config->item('base_url')."/mobile"); exit; } } You can find variety of functions like this in here:...