Skip to content

Instantly share code, notes, and snippets.

View eballeste's full-sized avatar
👁️‍🗨️
(-(-_(-_-)_-)-)

Enrique Ballesté Peralta eballeste

👁️‍🗨️
(-(-_(-_-)_-)-)
View GitHub Profile
@eballeste
eballeste / pivot_example.php
Last active August 26, 2020 05:39 — forked from lighta971/pivot_example.php
Laravel Custom Pivot Model Relationships Example (Laravel 7)
<?php
// https://github.com/laravel/framework/issues/2093#issuecomment-28689244
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\Pivot;
class User extends Model {
public function groups() {