Trigger Jenkins job from Laravel via Guzzle Request

Trigger Jenkins job from Laravel via Guzzle Request

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....

September 15, 2023 · 2 min · Ganesh Bhosale
How to access Laravel Passport API from Shell Script using CURL and JQ

How to access Laravel Passport API from Shell Script using CURL and JQ

TL;DR: Access Laravel Passport API’s from Shell Script using CURL and JQ. This combination can be helpful in running remote Automation Jobs and Builds. Laravel Passport is a full OAuth2 server implementation for Laravel. It provides a simple and convenient way to authenticate users and secure API endpoints. In this article, we’ll walk through the process of logging in to a Laravel Passport API using a shell script. We’ll use curl to make HTTP requests and jq to parse JSON responses....

September 9, 2023 · 3 min · Ganesh Bhosale
How to speed up Laravel Unit tests using Schema:Dump

How to speed up Laravel Unit tests using Schema:Dump

Laravel, an open-source PHP framework, provides built-in functionalities for developers to write tests for their applications. However, running tests, especially database tests, can sometimes be slow and time-consuming, affecting the productivity of developers. This blog post will elaborate on how to speed up Laravel unit tests using the schema::dump command. The Problem While performing unit tests in Laravel, developers often face a problem: migrations. Each time you run a test, Laravel runs all migrations, creating a database schema....

May 10, 2023 · 4 min · Ganesh Bhosale
Manage Laravel Queues using Supervisor

Manage Laravel Queues using Supervisor

Every Laravel Queue has it’s own cached version of Laravel Models, Jobs & Notification. You will be in serious panic if you are working on Jobs & Notification as Queue will not update the version of those file dynamically. You will need to restart Queue every time, by finding it in processes and killing it. Supervisor is a client/server system that allows its users to control a number of processes on UNIX-like operating systems....

November 7, 2021 · 1 min · Ganesh Bhosale
Laravel Valet setup including PHPMyAdmin

Laravel Valet setup including PHPMyAdmin

Laravel Valet is one of the most used tool on Mac by Laravel developers. Deploying test domains is lot way convenient than working on localhost or 127.0.0.1. Make sure that all your libraries you are installing via ** brew** only. 1. Brew, Composer & PHP Installation If you don’t have Brew or Composer Installed, Install it with following commands first. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" Install php using brew install php@7....

September 2, 2021 · 2 min · Ganesh Bhosale
Laravel Valet : 502 Bad Gateway [SOLVED]

Laravel Valet : 502 Bad Gateway [SOLVED]

When you upgrade or downgrade PHP Version of Laravel Valet it creates this issue of getting 502 Bad Gateway Error while accessing any parked .test domain. Simple way to solve this by updating composer first. composer global update Once done reinstall Valet again. It takes very less time. valet install Run this command to make sure that you use correct version of php valet use php@7.4

August 29, 2021 · 1 min · Ganesh Bhosale
Integrate Zoho Cliq OAuth API in PHP Laravel using Guzzle

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....

August 23, 2021 · 4 min · Ganesh Bhosale
Send Email Alert to Admin when Error Exceptions occurs in Laravel

Send Email Alert to Admin when Error Exceptions occurs in Laravel

It’s very tedious for a developer to check error logs every day and make sure that everything is running fine. But you can reduce this daily overhead by creating simple developer notifications to Admin Mail or Slack for example. 1. Handle Exceptions in Laravel Handler There is default Handler for all these exceptions at app\Exceptions\Handler.php in Laravel 8. We handled the situation in reportable callback. <?php namespace App\Exceptions; use App\Jobs\JobDevNotification; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Throwable; class Handler extends ExceptionHandler { ....

July 28, 2021 · 3 min · Ganesh Bhosale
How to setup Laravel Application on Heroku

How to setup Laravel Application on Heroku

Heroku provides a simple way to deploy PHP and Laravel applications without managing the underlying web server. In this guide, we will deploy a Laravel application to Heroku using Git, configure the application environment, and connect it to a MySQL database. Heroku’s PHP runtime automatically handles PHP, Composer, Apache/Nginx, and PHP-FPM. ([Heroku Dev Center][2]) 1. Prerequisites Before deploying the Laravel application, make sure the following are installed and working on your local machine:...

February 24, 2020 · 7 min · Ganesh Bhosale
Laravel Task Scheduling in Ubuntu using Cron Tabs

Laravel Task Scheduling in Ubuntu using Cron Tabs vs Supervisor

Laravel provides a convenient way to define scheduled tasks using its task scheduler. Instead of creating a separate Linux cron entry for every Laravel command, you can define your scheduled tasks inside the Laravel application and let Laravel handle when each task should run. On Ubuntu, the most common approach is to use CronTab to execute Laravel’s schedule:run command every minute. This article focuses on two practical ways to run Laravel’s scheduler:...

July 20, 2018 · 3 min · Ganesh Bhosale
All you need for VSCode Laravel Setup

All you need for VSCode Laravel Setup

Visual Studio Code Tut https://laracasts.com/series/visual-studio-code-for-php-developers Keyboard changes: Go to Symbol in File -> Cmd + R Go to Symbol in Workspace -> Cmd + shift + R User Settings { "extensions.ignoreRecommendations": true, "typescript.check.npmIsInstalled": false, "editor.tabSize": 4, "editor.insertSpaces": true, "emmet.syntaxProfiles": { "blade": "html" }, "workbench.activityBar.visible": true, "editor.minimap.enabled": false, "workbench.panel.location": "right", "explorer.openEditors.visible": 0, "editor.detectIndentation": false, "git.confirmSync": false, "git.autofetch": true, "window.zoomLevel": 0, "explorer.confirmDelete": false, "todohighlight.keywords": [ { "text": "NOTE:", "isWholeLine": false, "color": "#ff0000", "backgroundColor": "yellow", "overviewRulerColor": "magenta" }, { "text": "TODO:", "isWholeLine": true, "color": "white", "border": "1px solid #FFFFFF", "borderRadius": "20px", "backgroundColor": "#48b0f7", "overviewRulerColor": "#48b0f7" } ], "todohighlight....