Skip to content

Instantly share code, notes, and snippets.

View hamog's full-sized avatar
😃

Hashem Moghaddari hamog

😃
View GitHub Profile
@codewithgun
codewithgun / laravel-local-pusher.md
Created April 22, 2021 15:40
Laravel web socket with local pusher and custom authentication

Laravel local websocket

Customized authentication will be used in this gist instead of default Auth facade provided by Laravel

Create project

composer create-project laravel-laravel your-project-name
cd your-project-name
@mehrancodes
mehrancodes / prepare_ubuntu_for_laravel.md
Last active May 29, 2021 16:13
Prepare Ubuntu 16.04 for Laravel ( PHP + Composer + Valet)

Install PHP (shell)

Requirements

  • Dependencies: sudo apt-get install libnss3-tools jq xsel
  • PHP >= 5.6 : sudo apt-get install php
  • PHP Packages: php*-cli php*-common php*-curl php*-json php*-mbstring php*-mcrypt php*-mysql php*-opcache php*-readline php*-xml php*-zip
  • Optional PHP Packages: php*-sqlite3 php*-mysql php*-pgsql

Install Composer (shell)

There are 2 options to installing composer on Ubuntu.

@arubacao
arubacao / latlong.php
Last active February 10, 2024 00:55
Latitude Longitude Regular Expression Validation PHP
<?php
/**
* Validates a given latitude $lat
*
* @param float|int|string $lat Latitude
* @return bool `true` if $lat is valid, `false` if not
*/
function validateLatitude($lat) {
return preg_match('/^(\+|-)?(?:90(?:(?:\.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:\.[0-9]{1,6})?))$/', $lat);
@sohelamin
sohelamin / laravel-related-posts.php
Created December 3, 2015 11:31
Related posts in Laravel