Posts

Multiple DataBase Connections in Laravel

This article is about using databases with different data, not necessary for load balancing (or connection pooling) between databases. Define Connections Inside of your datbase configuration file - likely app/config/database.php - you can define more than one database connection of any type. In fact, you can define as many connections as you'd like. For instance, if your application has to pull data from 2 MySQL databases, you can define them both separately: <?php return array(     'default' => 'mysql',     'connections' => array(         # Our primary database connection         'mysql' => array(             'driver'    => 'mysql',             'host'      => 'host1',             'database'  => 'database1',             'username'  => 'user1',             'password'  => 'pass1'             'charset'   => 'utf

Laravel HRMS

Image
Introduction Advanced HRM involves everything related to the employer-employee relationship and is about supporting and managing the organisation’s people and associated processes. It’s seen as a core business function essential to the organisation’s effective operation. System Rquirements PHP >= 5.5.9 OpenSSL PHP Extension PDO PHP Extension Mbstring PHP Extension Tokenizer PHP Extension MySQL 5.x or later versions Installing Process With Built In Auto Installer 1: Unzip the Download File From Codecanyon. You will find two folders, One folder contains documentation & another is Application Files. 2: Upload the Entire Application folder to your website / server 3: Next you can rename the folder to whatever you like (HRM, Advanced-HRM etc..) 4: Now visit the uploaded location using your web browser to run the installer process. 5: Follow the instructions on screen to install Advanced HRM. On Successful Installation, You will be find the Login URL. 6: For securit

Set Up Master Slave Replication in MySQL

About MySQL replication MySQL replication is a process that allows you to easily maintain multiple copies of MySQL data by having them copied automatically from a master to a slave database. This can help for many reasons including facilitating a backup for the data, a way to analyze it without using the main database, or simply as a means to scale out. This tutorial will cover a very simple example of MySQL replication—one master will send information to a single slave. For the process to work you will need two IP addresses: one of the master server and one of the slave. This tutorial will use the following IP addresses: 12.34.56.789- Master Database 12.23.34.456- Slave Database Setup This article assumes that you have a user with sudo privileges and have MySQL installed. If you do not have MySQL, you can install it with this command: sudo apt-get install mysql-server mysql-client Step One—Configure the Master Database Open up the mysql configuration file on the

Deploy Laravel Project On Heroku

Getting Started with Laravel on Heroku This guide will walk you through the configuration and deployment of a Laravel 5 application. For a general introduction to using PHP on Heroku, please refer to Getting Started with PHP on Heroku. Prerequisites: PHP (and ideally some Laravel) knowledge. A Heroku user account. Signup is free and instant. Familiarity with the Getting Started with PHP on Heroku guide, with PHP, Composer, and the Heroku CLI installed on your computer. Creating a Laravel application The application in this tutorial is based on the Laravel Installation guide. It’s worth a read before following the instructions in this article. Installing a new Laravel project: The composer create-project command is one of the ways you can bootstrap a new project based on the laravel/laravel standard application skeleton. The command below sets it up in a directory named hello_laravel using the latest version of the framework. After downloading an extensive number of de

How to reduce or compress image size while uploading using PHP

It is very common to upload images to the server or website by the users and admins. Users mostly upload their images for setting their profile picture or to submit documents and so on. But most of the time images are uploaded by the users are not optimized for the web, thus taking much more spaces on your server than that it actually need. Apart from this when you upload an image of large size, it takes more time to load on the web page, thus its effects on your website ranking. Uploaded images are very important and it should be reduced as much as possible. You can write some PHP code that reduces or compress image size while uploading to the server. But, of course reducing the image size will also reduce the image quality.  So, in this tutorial, I will show you how to reduce or compress image size while uploading using PHP. How to reduce or compress image size while uploading using PHP Step 1: Image Upload Form (index.php): <form method="post" enctype="mul

User login and registration using nodejs and mysql with example:

In this tutorial, I am going to create simple email and password login authentication and register a user using nodejs and mysql. I will save simple password in mysql database but this is not good practice for security reason so in next tutorial, you will know the use of BCrypt module of Node.js to encrypt passwords. This tutorial will explain only how to save a record in mysql table and how to check email exist or not in the table with given password. To handle post parameters of Http request in Node.js, we use Body-Parser module. Step1: Table and directory structure: In first step, create a "users" table in the database by running following command in phpmyadmin or in mysql shell : CREATE TABLE `users` (   `id` int(11) NOT NULL AUTO_INCREMENT,   `name` varchar(255) NOT NULL,   `email` varchar(255) NOT NULL,   `password` varchar(255) NOT NULL,   `created_at` datetime NOT NULL,   `updated_at` datetime NOT NULL,   PRIMARY KEY (`id`) ) E

PHPMyBackup - A PHP MySQL differential backup script

A PHP MySQL differential backup script PHPMyBackup is a PHP script designed for backing up an entire MySQL server on the command line. What makes it unique is it only uses use  differential  methods to dump only the changes as it keeps a local copy of all the synced databases & tables. Software features Only download changed/altered tables (checksum) Allows specifying subset of databases for backups (supports wildcard) Allows skipping of specified databases from backups (supports wildcard) Allows skipping of specified tables or table-data (supports wildcard) Integrates with  mysqldump  client for individual sql dumps Backup rotation Limitations No database locking during backup. because a separate `mysqldump` is called for every table download, only table locking is used. This has been tested in several environments, but your own full testing is always advised! Requirements A MySQL user on the server with ‘SELECT’ & ‘LOCK TABLES’ permissions tar  with