Skip to content

Instantly share code, notes, and snippets.

View nguyenthanhtung88's full-sized avatar

Nguyễn Thanh Tùng nguyenthanhtung88

  • Framgia Vietnam
  • Hanoi, Vietnam
View GitHub Profile
@nguyenthanhtung88
nguyenthanhtung88 / model.php
Created May 11, 2016 06:42 — forked from systemseven/model.php
Soft Deletes in Laravel 4
//in the model
class User extends Eloquent {
protected $softDelete = true;
}
//in the migration, to create a soft delete column
$table->softDeletes();
@nguyenthanhtung88
nguyenthanhtung88 / laravel-quickstart-project-docker.md
Created October 31, 2016 06:38 — forked from wataridori/laravel-quickstart-project-docker.md
Running Laravel Quick Start Project easily using Docker
  • Install Docker
    • Docker for Ubuntu: https://docs.docker.com/engine/installation/linux/ubuntulinux/
      sudo apt-get update && apt-get install -y apt-transport-https ca-certificates
      sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
      
      // Open the /etc/apt/sources.list.d/docker.list and add the following line then save it
      // Ubuntu 14.04
      deb https://apt.dockerproject.org/repo ubuntu-trusty main
      

// Ubuntu 16.04

<?php
class Collection implements IteratorAggregate
{
/**
* The collection contents.
*
* @var array
*/
protected $items;
@nguyenthanhtung88
nguyenthanhtung88 / delete_git_submodule.md
Created November 2, 2018 06:03 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule