External API calling in Laravel by Guzzle Package

Recently I am working on a project that need to access some external API. And it's a Laravel project, so I am looking for some package that can save my time and meet the deadline too.   I am using GuzzleHttp package for accessing external API and its really easy   Installation: composer require guzzlehttp/guzzle:~6.0 Uses: … Continue reading External API calling in Laravel by Guzzle Package

Advertisements

How to define Global Variable or Constant in Laravel

We often need to define global variables/constants for our application, like Status, Conditions, Countries (we can put all countries in table as it will be along array/object), also weekdays, weekends and e.t.c. vary on projects. Status (Active, Inactive) and Conditions (Ok, Good, Better, Best) or Grade (F, C, D, A, A-, A+), so like these … Continue reading How to define Global Variable or Constant in Laravel

Update (custom) XAMPP/WAMP/LAMP default landing page layout

We are building website and applications on localhost and I use XAMPP package on Linux for my local development.   After installing Xampp, we always get a default home page from Xampp and most of the time we don’t need that. Basically before writing this article I always delete all items of htdocs/www folder, but … Continue reading Update (custom) XAMPP/WAMP/LAMP default landing page layout

How to find src attribute of image tag in php?

In my case, I had a string containing exactly one <img /> tag (and no other markup). And I was trying to get the src attribute. // get the featured image $image = '<img src="path/to/image_file" />'; // get the src for that image $pattern = '/src="([^"]*)"/'; preg_match($pattern, $image, $matches); $src = $matches[1]; unset($matches); In the … Continue reading How to find src attribute of image tag in php?

PHP code to execute MySQL script

There are advanced and comfortable tools to manage your MySQL databases (i.e.  server side: phpMyAdmin, client side:  SQLyog). But sometimes you can not use those tools and need the ability to execute some SQL script on server by your own hands, easy and fast way. What to do in such situation? Use this PHP code … Continue reading PHP code to execute MySQL script