Ethereal

Kevin Upton edited this page Nov 30, 2017 · 19 revisions

The main class which contains all of the custom traits.

This is core class of the package. Extends Laravel Model package directly, providing some simple extra functionality to increase development.

Extending the Class

Simply extend the Ethereal class instead of the Laravel Model class when creating your models.

<?php namespace My\Namespace\Location;

use Kevupton\Ethereal\Models\Ethereal;

class Example extends Ethereal { 

}

Src

<?php namespace Kevupton\Ethereal\Models;

use Illuminate\Database\Eloquent\Model;
use Kevupton\Ethereal\Traits\HasAutoHydration;
use Kevupton\Ethereal\Traits\HasDynamicRelationships;
use Kevupton\Ethereal\Traits\HasEventListeners;
use Kevupton\Ethereal\Traits\HasSingletonMethods;
use Kevupton\Ethereal\Traits\HasTableColumns;
use Kevupton\Ethereal\Traits\HasValidation;

class Ethereal extends Model implements RelationshipConstants
{
    use HasEventListeners,
        HasSingletonMethods,
        HasValidation,
        HasDynamicRelationships,
        HasTableColumns,
        HasAutoHydration
    {
        HasEventListeners::boot insteadof HasValidation;
        HasEventListeners::getEventNameFromMethod insteadof HasValidation;
        HasEventListeners::boot insteadof HasAutoHydration;
        HasEventListeners::getEventNameFromMethod insteadof HasAutoHydration;
    }
}
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.