Skip to content

Instantly share code, notes, and snippets.

Muhammad Azaz Qadir azazqadir

  • Karachi, Pakistan
Block or report user

Report or block azazqadir

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ssl
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());
View search.blade.php
<!DOCTYPE html>
<html>
<head>
<meta name="_token" content="{{ csrf_token() }}">
@azazqadir
azazqadir / readme.md
Created Aug 23, 2018
Integration of React in Symfony
View readme.md

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 Aug 6, 2018
Symfony 4 Installation Command
View readme.md

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 Jun 26, 2018
PHP 5.6 Performance Benchmarks Compared with PHP 7 on Laravel 5.4
View readme.md

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
Enable SSL Certificate on Custom PHP website
View readme.md

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
Creating a Connection Between MySQL and PHP
View readme.md

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 Apr 9, 2018
Using Envoyer for PHP App Deployment
View deployphpapplication.md

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

View laravelrecaptcha.md

Get Necessary Packages Let’s get the necessary classes we will require to make things possible. I’ll be using Composer to bring down the packages:

$ composer requireanhskohbo/no-captcha

Set up Configurations We are going to edit the app.php file.

@azazqadir
azazqadir / laravel-model-view.md
Created Mar 9, 2018
Learn more about Models and View in Laravel 5.5
View laravel-model-view.md

In Laravel, models are created inside the app folder. Models are mostly used to interact with the database using Eloquent ORM. Eloquent provides simple ActiveRecord implementations for database interaction.

The easiest way to create a model is the Artisan command:

php artisan make:model <model name>

Views in Laravel are created in the resources/views folder. You can change base path for views by editing config/view.php file and changing realpath(base_path('resources/views')) to the new location for the views.

You can’t perform that action at this time.