Skip to content

Instantly share code, notes, and snippets.

View azazqadir's full-sized avatar

Muhammad Azaz Qadir azazqadir

  • Karachi, Pakistan
View GitHub Profile
@azazqadir
azazqadir / laravel.php
Created September 24, 2018 13:29
Laravel API Rate Limiting and Dynamic Rate Limiting: https://www.cloudways.com/blog/laravel-and-api-rate-limiting/
Route::group(['prefix' => 'api/v1'], function () {
Route::get('/getTasks', function () {
return Task::all();
});
Route::post('/addTask', function (Request $request) {
@azazqadir
azazqadir / readme.md
Created September 22, 2018 11:37
Step by Step Guide to Deploy Symfony Web to Server Using Envoyer

Step 1: Create an Envoyer Account and Add a Project Step 2: Connect Your GitHub Repository With Envoyer Account Step 3: Integrate Your Server With Envoyer Step 4: Click the Deploy button for actual project deployment.

Source: Deploy Symfony using Envoyer

@azazqadir
azazqadir / ssl
Created September 14, 2018 14:23
Enable SSL on Laravel Website and Enable Force HTTPS Redirect: https://www.cloudways.com/blog/how-to-setup-https-ssl-certificates-on-laravel-5/
namespace MyApp\Http\Middleware;
use Closure;
class HttpsProtocol {
public function handle($request, Closure $next)
{
if (!$request->secure() && env('APP_ENV') === 'prod') {
return redirect()->secure($request->getRequestUri());
@azazqadir
azazqadir / search.blade.php
Created September 10, 2018 14:00
View File for Laravel Search With Live Results: https://www.cloudways.com/blog/live-search-laravel-ajax/
<!DOCTYPE html>
<html>
<head>
<meta name="_token" content="{{ csrf_token() }}">
@azazqadir
azazqadir / readme.md
Created August 23, 2018 17:44
Integration of React in Symfony

Here is a detailed step by step guide on integrating react in Symfony using pure javascript library by the framework, Webpack Encore. Webpack Encore is a simpler way to integrate Webpack into your application. It wraps Webpack, giving you a clean & powerful API for bundling JavaScript modules, pre-processing CSS & JS and compiling and minifying assets. Encore gives you professional asset system that's a delight to use.

@azazqadir
azazqadir / readme.md
Created August 6, 2018 10:45
Symfony 4 Installation Command

Use the following composer command to install Symfony 4

composer create-project symfony/skeleton symfony4

Flex is now included as a dependency in the new version. You can easily create a new Symfony 4 skeleton projects with Flex enabled.

@azazqadir
azazqadir / readme.md
Created June 26, 2018 13:44
PHP 5.6 Performance Benchmarks Compared with PHP 7 on Laravel 5.4

When tested Laravel 5.4 on PHP 5 vs 7 for performance benchmark, the latter was 50% faster than the previous version. With PHP 5.4, the response time was 553ms, whereas with PHP 7 it was 274ms. This is enough to prove that it is time to start upgrading to PHP 7 and make websites load faster.

@azazqadir
azazqadir / readme.md
Created May 17, 2018 09:45
Enable SSL Certificate on Custom PHP website

To enable SSL on PHP, you need to install the SSL certificate. If you are doing it using Cloudways, then you can either enable Free SSL by Let's Encrypt on one click from the settings or install custom SSL.

<Files ~ "^\.(htaccess|htpasswd)$">
deny from all
@azazqadir
azazqadir / readme.md
Created May 14, 2018 09:51
Creating a Connection Between MySQL and PHP

This tutorial guides you how to connect MySQL database with PHP. To establish the connection, you can simply do it with MySQL or you can use MySQLi or PDO (PHP Data Objects).

For MySQL, simply add followin code in db_connection.php file in your root.

<?php

function OpenCon()
 {
 $dbhost = "localhost";
@azazqadir
azazqadir / deployphpapplication.md
Created April 9, 2018 15:11
Using Envoyer for PHP App Deployment

Envoyer is a great tool for deploying PHP Applications with zero downtime on your server.

Step 1: Create Envoyer Account and Add a Project

Step 2: Connect to a Repository on Github, Bitbucket or any other self-hosted repository

Step 3: Head to the server tab and click the add server button.

Step 4: Deploy your application