Skip to content

Instantly share code, notes, and snippets.

View azazqadir's full-sized avatar

Muhammad Azaz Qadir azazqadir

  • Karachi, Pakistan
View GitHub Profile

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 March 9, 2018 14:06
Learn more about Models and View in Laravel 5.5

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.

@azazqadir
azazqadir / readme.md
Created February 20, 2018 13:00
Developing a Multilingual Site in CodeIgniter

Specify Default Language and Language Options

Go to application/config folder and open config.php. Add the following line to specify the website’s default language.

$config['language']  = 'english';
$config['language']  = 'english';
@azazqadir
azazqadir / index.php
Created February 2, 2018 14:08
Realtime chat application created in PHP using Pusher: https://www.cloudways.com/blog/real-time-chat-app-php/
<!DOCTYPE html>
<head>
<title>Pusher Test</title>
<link rel="stylesheet" type="text/css" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js" type="text/javascript" ></script>
<script src="https://js.pusher.com/4.1/pusher.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js" type="text/javascript" ></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootbox.js/4.3.0/bootbox.min.js" type="text/javascript" ></script>
@azazqadir
azazqadir / captcha.php
Created January 18, 2018 10:21
Adding Captcha in Forms in CodeIgniter Website: https://www.cloudways.com/blog/captcha-in-codeigniter/
<?php
defined('BASEPATH') OR exit('your exit message');
class Captcha extends CI_Controller
{
   function __construct()
@azazqadir
azazqadir / departments.php
Created January 16, 2018 06:51
Creating Pagination Feature in CodeIgniter App. Learn how to create Model, Controller and View for Pagination in CodeIgniter: https://www.cloudways.com/blog/pagination-in-codeigniter/
<?php
class Departments extends CI_Model
{
   public function __construct() {
       parent::__construct();
@azazqadir
azazqadir / laravelaimeos.php
Created December 20, 2017 14:16
Creating an ecommerce website in Laravel using Aimeos Package. https://www.cloudways.com/blog/laravel-ecommerce-website-with-aimeos-package/
composer create-project aimeos/aimeos myshop
@azazqadir
azazqadir / web.php
Created November 21, 2017 10:57
CDN Integration in Yii 2 App. Using CloudwaysCDN to call CSS file from CDN. Full article at: https://www.cloudways.com/blog/cdn-in-yii2/
// ...
'components' => [
   // ...
'cdn' => [
            'class' => '\yii2cdn\Cdn',
            'baseUrl' => defined ('YII2CDN_OFFLINE')
                ? 'http://localhost/yii2/cdn'
@azazqadir
azazqadir / bootstrap.php
Created November 15, 2017 13:15
Using Eloquent Outside of Laravel for Other PHP Apps. Source: https://www.cloudways.com/blog/eloquent-illuminate-in-php-without-laravel/
<?php
require "vendor/autoload.php";
use Illuminate\Database\Capsule\Manager as Capsule;
@azazqadir
azazqadir / head.blade.php
Created October 16, 2017 11:47
Laravel Blade Layout. Learn how you can quickly create a layout in Laravel using the Blade: https://www.cloudways.com/blog/create-laravel-blade-layout/
<meta charset="utf-8">
<meta name="description" content="">
<meta name="Saquib" content="Blade">
<title>Checkout our layout</title>
<!-- load bootstrap from a cdn -->