Skip to content

Instantly share code, notes, and snippets.

View mpijierro's full-sized avatar

Manu Pijierro mpijierro

View GitHub Profile
@vluzrmos
vluzrmos / HasWithCountScope.php
Last active September 23, 2021 09:00
Laravel 5.1 withCount(relation) method.
<?php
namespace App;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOneOrMany;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Database\Query\Expression;
@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master