Skip to content

Instantly share code, notes, and snippets.

View mehrancodes's full-sized avatar
🏠

Mehran Rasulian mehrancodes

🏠
  • UAE
  • 18:25 (UTC +04:00)
View GitHub Profile
@mehrancodes
mehrancodes / Docker
Created June 21, 2019 14:58
How to deploy a Laravel app on Fandogh Cloud
FROM alpine
RUN apk update && \
apk add curl \
php7 \
php7-opcache \
php-fileinfo \
php7-openssl \
php7-pdo \
php7-json \
@mehrancodes
mehrancodes / copy_ssh_keys_to_another_system.md
Created October 24, 2018 17:13
How to use the ssh keys on another system
  • Copy the folder ~/.ssh to the other system you would like.
  • Change the ~/.ssh dir permission to 700 and ~/.ssh/* to 600
  • Add the private key identities to the authentication agent like so: ssh-add
  • It's done!
@mehrancodes
mehrancodes / max_if.md
Created March 15, 2017 11:18
Custom validation max_if

max_if is a custom validation which is consists of reqired_if and max validations.
It is usable when you want to validate the size of a file when another field is equal to any value.

max_if:anotherfield,value,...
The field under validation must be present if the anotherfield field is equal to any value.
The field under validation must be less than or equal to a maximum value.
This validation just accepts file fields!

class AppServiceProvider extends ServiceProvider
@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.