How to copy public key from local machine to remote server or droplet with different port?
posted 3 months ago
To copy use the tool called ssh-copy-id on the terminal as: ssh-copy-id -p 1234 [email protected]
Controlling The Cache in PHP Using Edge Side Includes in Varnish
posted 1 year ago
To Control the cache in php 1. Use `set beresp.do_esi = true;` and 2. set ttl for e.g. `set beresp.ttl = 0s;` at backend. 3) On the php template use <esi:include src="/to/path">
Druid Application Test
posted 2 years ago
Druid Application Test
Integration Test
posted 2 years ago
How to Mock Integration Test
PHP Storm Editor Setting
posted 2 years ago
Recommended PHP Storm Editor Settings
Adding new column on a large SQL Database table
posted 3 years ago
Just Using ALTER column on a huge database table to add a new column can bring the database down.
Unit Test - asserting Array Collection of Object against expected json Data
posted 3 years ago
How to assert array Collection of Object with private property against expected json data
How to upgrade PHP from PHP 7.0 to PHP 7.2 on Ubuntu 16.04 on Digital Ocean
posted 3 years ago
Instruction on Upgrading PHP 7.2
We will show you how you can set up database and grant remote access to all or specific server from scratch.
How to install composer locally on Linux Operating System.
posted 4 years ago
Learn how to install composer locally and execute it from anywhere in just a few steps
How to deploy PHP and Nginx app using Kubernetes
posted 4 years ago
This article demonstrates how we can run PHP and Nginx application using Kubernetes. First, we create a deployment object that contains a PHP and Nginx container. And then exposing the application using NodePort and LoadBalancer service. You can use minikube, microk8s or any other tools to run kubernetes in a virtual machine on your local machine.
Key Already in use in Git Hub & Bit Bucket
posted 5 years ago
In GitHub & BitBucket account when you add the new ssh key after deleting the old one, it still gives annoying "Key Already in Use" message - preventing user from adding the newly generated key.
Abstract Class Vs Interfaces
posted 5 years ago
Abstract class represent identity of closely RELATED class. For e.g. car Vehicle abstract class can have a abstract method shared by Car & Bike. Interface on other hand represent Contract or ability of UNRELATED class.
Creating PHP project boilerplate
posted 5 years ago
Creating PHP Project Boilerplate
Creating PHP project boilerplate
posted 5 years ago
Creating PHP Project Boilerplate
Unable to locate package php5-curl
posted 6 years ago
Installing php5-curl package on Linux Ubuntu
Laravel 5.6 Setup
posted 6 years ago
Step by step guide to Laravel 5.6 Installation. No long description, just a necessary script to get Laravel 5.6 started.
Upgrade PHP Version 7.0 to PHP Version 7.2
posted 6 years ago
To upgrade PHP version to 7.2, add repository ppa:ondrej/php, do apt-get update and install php7.2 package.
Laravel Error - TokenMismatchException in VerifyCsrfToken.php line 53 on form submisstion
posted 7 years ago
I get Token Mismatch Exception in Verify Csrf Token at line 53 when submitting the form on Laravel 5, Laravel 5.1, Laravel 5.2, Laravel 5.3, Laravel 5.4 or Laravel 5.5.
Active Record Design Pattern
posted 7 years ago
Active Record design pattern stores in-memory object data in Relational Database. The interface would consist of function such as insert, update, delete and properties that correspond to a column in database table.
The Template Method Pattern - Design Pattern in PHP
posted 7 years ago
The template method design pattern is an easy one to understand and each one of us has used it on multiple occassions without even realizing it! Let's dig in.
The Strategy Pattern - Design Pattern in PHP
posted 7 years ago
We use strategy pattern when there are multiple ways of achieving a task.
The Adapter Pattern - Design Pattern in PHP
posted 7 years ago
Adapter pattern normalize different interface by bridging a gap between two. This makes it possible to convert one interface to another.
The Decorator Pattern - Design Pattern in PHP
posted 7 years ago
Decorator Pattern allow us to stack on additional behaviour or functionality on a existing one. This means we don't have to resort to unnecessary inheritance and instead extend the behaviour during a runtime.
Installing XDEBUG PHP On Linux Fedora
posted 7 years ago
PHP Xdebug installation on Fedora/CentOS x64
Increase the Innodb_log_file_size to a bigger value. Generally the rule of thumb is to increase the Innodb_log_file_size to 10 times the size of the plugin.
Quite often when you start micro PHP Project you may not know where to start. This basic tutorial shows a quick way of creating PHP project using composer to pull in PHP unit and setting up the Application name.
How to fix sudo: no tty present and no askpass program specified error?
posted 8 years ago
Once you comment out #Defaults requiretty on /etc/sudoers you get this error if you don't allow user to use command without prompting for password. The fix is easy thought. Allow user to use the command without prompting for password in /etc/sudoers file.
Sudo: Sorry, You Must Have a Tty to Run Sudo
posted 8 years ago
This is generally enforced by having Defaults requiretty in the /etc/sudoers. No panic, there is an easy fix! Comment out #Defaults requiretty on /etc/sudoers
Installing pdftk on Centos 7
posted 8 years ago
The problem with installing pdftk on Centos 7 is that if has dropped support for libgcj. But you can install to package to install pdftk on centos7.
Gulp autoprefixer throwing ReferenceError: Promise is not defined
posted 8 years ago
When running Gulp on laravel root it throws : Gulp-autoprefixer throwing ReferenceError: Promise is not defined. To Fix add require('es6-promise').polyfill(); on top of your gulp.js and run npm install es6-promise
Laravel not automatically log me out after changing the session lifetime.
posted 8 years ago
If Laravel is not automatically logging you out, I bet it is because the expire_on_close is set to true. Change it to false and It will work.
Creating Custom Validation in Laravel 5
posted 8 years ago
Extending the validation class to create a custom validation. 1) Create Custom Validation class that extends Validator class. 2) Boot this custom validation class on your service provider and 3) finally you can use it on your request class.
Laravel 5.3 Cheat Sheet
posted 8 years ago
New Laravel 5.3 Cheat Sheet which include: Artisan Commands
Laravel 5.3 Cheat Sheet
posted 8 years ago
New Laravel 5.3 Cheat Sheet which include: Artisan Commands
Installing Laravel 5.2 from Scratch : Initial Setup
posted 8 years ago
So you want to level up with Laravel? The first step is to install Laravel on our machine. We'll do that installing Composer, pulling in Laravel's helpful installer utility, and then running larave
Consume External API from Laravel 5.2 using Guzzle Http Client
posted 8 years ago
API could be consumed in many ways in Laravel. For e.g. you can create your own custom API Package to consume API on the remote application. Or there is a better way. This is by using the Guzzle HTTP Client.
Consume External API from Laravel 5.2 using Guzzle Http Client
posted 8 years ago
API could be consumed in many ways in Laravel. For e.g. you can create your own custom API Package to consume API on the remote application. Or there is a better way. This is by using the Guzzle HTTP Client.
Create a simple custom API class with PHP
posted 8 years ago
Shows how to create simple custom API within your project that allows external application to consume it.
How to upgrade npm?
posted 8 years ago
How to upgrade npm? You can upgrade npm easily by running npm install npm@latest -g on to your terminal
Error: The libsass binding was not found in / node_modules / gulp-sass / node_modules / node-sass
posted 8 years ago
Error: The libsass binding was not found in after upgrading npm using npm install npm@latest -g
Problem: I got bindShared application error after updating from laravel 5.1 to 5.2. SOLUTION: Remove the outdated package illuminate/htm:^5.0 and remove its service provider too. Then replace with "laravelcollective/html": "5.2.*"
Cannot find module laravel-elixir-group
posted 8 years ago
To Fix 1. var ElixirGroup = require('laravel-elixir-group'); 2. Add laravel-elixir-group into the package.json 3. Run npm install.
No supported encrypter found. The cipher and / or key length are invalid.
posted 8 years ago
To fix this error in Laravel 5, execute php artisan key:generate command. Then, copy the generated application key and add it into the .env file APP_KEY=xlhF31NeOlibJcoOW9tvZg7TkHcAZI3a.
How to Specify a Separate Database for Unit Testing on Laravel 5
posted 8 years ago
First method is to Create Test Database > Specify Test Database Connection in Config > Modify phpunit.xml. Second is to create .env.testing and load this environment on TestCase->createApplication()
How to Copy or Duplicate Table Row Using Eloquent
posted 8 years ago
To copy or duplicate table row without overwriting a existing one, use eloquent replicate() method. This will create a copy of the existing row with a new id.
Consuming Laravel API From Laravel Application Itself
posted 8 years ago
Consuming my own Laravel API: I have Laravel API made available for external application. But how do I consume this API from my own Laravel Application?
Argument 1 passed to BelongsToMany formatSyncList must be of the type array, null given
posted 8 years ago
Solution to Problem : Argument 1 passed to Illuminate\Database\Eloquent\Relations\BelongsToMany::formatSyncList() must be of the type array, null given, called in ...
How to create a symbolic link
posted 9 years ago
Use this command ln -s <real folder> <link folder> to create symbolic link. With this command <link folder> will actually contain everything <real folder> have.
Can't connet to local MySQL server through mysqld.sock
posted 9 years ago
Solution for: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) or Connection for controluser as defined in your configuration failed while trying to access via phpmyadmin.
How to Ignore Files Only Locally on GIT
posted 9 years ago
You can ignore files locally without polluting the global .gitignore used by everyone else. For this you can modify your .gitconfig file.
Git Cheat Sheet
posted 9 years ago
Browse and download summary of Git command line instruction for quick reference. Git is the open source version control system that facilitates GitHub activities on PC.
Git Cheat Sheet
posted 9 years ago
Browse and download summary of Git command line instruction for quick reference. Git is the open source version control system that facilitates GitHub activities on PC.
Speed up your task with Bash Shell Aliases for Linux / Unix / Mac OS X
posted 9 years ago
Instead of typing a long command, use a Bash rc (keyboard shortcut) on Linux / Unix / Mac OS X to speed up your day to day task.
Laravel Event is not firing?
posted 9 years ago
If Laravel 5 Event is not firing, you can run php artisan optimize, composer dump autoload and php artisan clear-compiled command.
What if you screw up your phpmyadmin?
posted 9 years ago
Sometime you might screw up your phpmyadmin after upgrading Apache or the PHP. This article show you how to remove and reinstall phpmyadmin easily in Ubuntu.
RATS, Ubuntu Sucks! Unity Desktop Won't Load Fully
posted 9 years ago
On Updating Ubuntu OS sometime the Unity Desktop doesn't fully load. This short and sweet article shows how to reinstall Ubuntu Unity Desktop without loosing your sleep.
What is new in PHP 7
posted 9 years ago
Find out and learn some of the new features introduced in PHP7 such as Scalar Typehints, return type declarations and more. Also contribute your knowledge on PHP7 on this post.
Installing XMLLint to Parse and Format XML Data
posted 9 years ago
XML Lint is a command line tool that allows you to format and Parse Badly Formed XML Data. Instruction on installing XMLLint on Linux (Ubuntu, Centos, Fedora, openSUSE) operating system.
When should you denormalize a database?
posted 9 years ago
When should you denormalize a database and when you shouldn't. Pros and Cons of denormalizing a database. How can performance be optimized by denormalizing a database.
Whoops, looks like something went wrong! - Laravel 5
posted 9 years ago
Solution to get rid of Whoops, looks like something went wrong in Laravel 5 and Laravel 5.1.
HTML 5 Cheat Sheet
posted 9 years ago
View and Download Supported and Not Supported HTML 5 Tags on your PC, Tablet and Mobile Devices...
Laravel 5 and Laravel 4 Cheat Sheet
posted 9 years ago
Easy, Quick, Concise Laravel 5.1, Laravel 5 and Laravel 4 Cheat Sheet - PHP Artisan, Composer, Routing, Database Schema, Database Indexes, Database Foreign Keys, Database Column Types, Eloquent, Views, SSH, Unit Test and more ...
Laravel 5 and Laravel 4 Cheat Sheet
posted 9 years ago
Easy, Quick, Concise Laravel 5.1, Laravel 5 and Laravel 4 Cheat Sheet - PHP Artisan, Composer, Routing, Database Schema, Database Indexes, Database Foreign Keys, Database Column Types, Eloquent, Views, SSH, Unit Test and more ...
Increment Number using animate function with comma in JQuery
posted 9 years ago
Learn how to increment a comma separated number inside an element using the animate function in JQuery.
Using Access Contol List (ACL) to veiw and set files and folder permission
posted 9 years ago
Learn how to use setfacl and getfacl to set and view the files and folder permission. Using setfacl will ensure all the files and folder will have a permission specified by setfacl.
How to loop through all the elements having same class in JQuery
posted 9 years ago
Demonstration with example on how to loop through all the elements having a same class on the page
Copy files and folder to remote server having different port number
posted 9 years ago
Find out how to copy files and folder from your local computer using linux to remote linux server with different port number other than 80 or 8080.
I See Blank Page On Accessing Laravel Project
posted 9 years ago
Solution to get rid of blank page while accessing Laravel Page.
Laravel 123
posted 9 years ago
Laravel Installation Quick Tutorial
How to make a Ajax Request on Laravel when dropdown menu is clicked
posted 9 years ago
Laravel Ajax Route Controller Relationship.
Mutator works only on creating record but not on update
posted 9 years ago
Mutators only work when I create a record and not when I update a record on Laravel.
Solution to fix failed to open stream: Permission denied error on Laravel