Skip to content

Instantly share code, notes, and snippets.

@exileed
Created September 9, 2018 12:37
Show Gist options
  • Save exileed/004e85f7a7e3e5902a560f071ea3152a to your computer and use it in GitHub Desktop.
Save exileed/004e85f7a7e3e5902a560f071ea3152a to your computer and use it in GitHub Desktop.
<?php
class AbstractEntity extends Entity
{
protected static $applyScope = true;
public static function boot()
{
parent::boot();
if(static::$applyScope) {
static::addGlobalScope(new Scope);
}
}
}
# -------------------------
class Admin extends AbstractEntity
{
protected static $applyScope = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment