__construct() public method

Create a new Eloquent model instance.
public __construct ( array $attributes = [] ) : void
$attributes array
return void
Example #1
1
 public function __construct(array $attributes = [])
 {
     $place = last(explode('/', request()->server()['REQUEST_URI']));
     #request()->route('place');
     $this->hasAttachedFile('image_desktop', ['styles' => ['crop' => function ($file, $imagine) {
         $image = $imagine->open($file->getRealPath());
         if (request()->input('crop.image_desktop.w') >= 0 && request()->input('crop.image_desktop.y') >= 0) {
             $image->crop(new \Imagine\Image\Point(request()->input('crop.image_desktop.x'), request()->input('crop.image_desktop.y')), new \Imagine\Image\Box(request()->input('crop.image_desktop.w'), request()->input('crop.image_desktop.h')));
         }
         return $image;
     }], 'default_url' => 'http://placehold.it/' . config('mbanners.places.' . $place . '.desktop.width') . 'x' . config('mbanners.places.' . $place . '.desktop.height')]);
     if (config('mbanners.places.' . $place . '.tablet') !== false) {
         $this->hasAttachedFile('image_tablet', ['styles' => ['crop' => function ($file, $imagine) {
             $image = $imagine->open($file->getRealPath());
             if (request()->input('crop.image_tablet.w') >= 0 && request()->input('crop.image_tablet.y') >= 0) {
                 $image->crop(new \Imagine\Image\Point(request()->input('crop.image_tablet.x'), request()->input('crop.image_tablet.y')), new \Imagine\Image\Box(request()->input('crop.image_tablet.w'), request()->input('crop.image_tablet.h')));
             }
             return $image;
         }], 'default_url' => 'http://placehold.it/' . config('mbanners.places.' . $place . '.tablet.width') . 'x' . config('mbanners.places.' . $place . '.tablet.height')]);
     }
     if (config('mbanners.places.' . $place . '.mobile') !== false) {
         $this->hasAttachedFile('image_mobile', ['styles' => ['crop' => function ($file, $imagine) {
             $image = $imagine->open($file->getRealPath());
             if (request()->input('crop.image_mobile.w') >= 0 && request()->input('crop.image_mobile.y') >= 0) {
                 $image->crop(new \Imagine\Image\Point(request()->input('crop.image_mobile.x'), request()->input('crop.image_mobile.y')), new \Imagine\Image\Box(request()->input('crop.image_mobile.w'), request()->input('crop.image_mobile.h')));
             }
             return $image;
         }], 'default_url' => 'http://placehold.it/' . config('mbanners.places.' . $place . '.mobile.width') . 'x' . config('mbanners.places.' . $place . '.mobile.height')]);
     }
     parent::__construct($attributes);
 }
Example #2
0
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     if ($connection = config('tagging.connection')) {
         $this->connection = $connection;
     }
 }
Example #3
0
 /**
  * {@inheritDoc}
  */
 public function __construct(array $attributes = [])
 {
     $this->table = config('vi-kon.auth.table.user_permissions');
     $this->timestamps = false;
     $this->casts = [static::FIELD_TOKEN => 'string'];
     parent::__construct($attributes);
 }
Example #4
0
 public function __construct($attributes = array())
 {
     //Eloquent model base construction
     parent::__construct($attributes);
     //App\Article
     //$this->user_id = 1; //TEMPORARY TEST
 }
Example #5
0
 public function __construct($attributes = [])
 {
     parent::__construct($attributes);
     if ($this->useSti()) {
         $this->setAttribute($this->stiClassField, get_class($this));
     }
 }
Example #6
0
 public function __construct($tablename, $data)
 {
     parent::__construct($data);
     if ($tablename) {
         $this->setTable($tablename);
     }
 }
Example #7
0
 /**
  * constructor
  */
 public function __construct(array $attributes = array())
 {
     $this->timestamps = true;
     // call superclass constructor
     //
     Model::__construct($attributes);
 }
Example #8
0
 /**
  * Create a new Eloquent model instance.
  *
  * @param  array  $attributes
  */
 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
     if ($connection = config('database.default')) {
         $this->setConnection($connection);
     }
 }
Example #9
0
 public function __construct($attributes = array())
 {
     parent::__construct($attributes);
     // initialize empty messages object
     $this->errors = new \Illuminate\Support\MessageBag();
     $this->modelName = get_class($this);
 }
Example #10
0
 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
     $this->errors = new MessageBag();
     $this->validator = \App::make('validator');
     $this->manejaConcurrencia = true;
 }
Example #11
0
 /**
  * __construct.
  *
  * @method __construct
  *
  * @param array $attributes
  */
 public function __construct(array $attributes = [])
 {
     if (empty($attributes['hash'])) {
         $attributes['hash'] = Random::generateToken();
     }
     parent::__construct($attributes);
 }
Example #12
0
 /**
  * {@inheritDoc}
  */
 public function __construct(array $attributes = [])
 {
     $this->table = config('vi-kon.auth.table.user_roles');
     $this->timestamps = false;
     $this->casts = [static::FIELD_TOKEN => 'string', static::FIELD_STATIC => 'boolean', static::FIELD_HIDDEN => 'boolean'];
     parent::__construct($attributes);
 }
Example #13
0
 public function __construct(array $attributes = array())
 {
     $this->hasAttachedFile('krapin');
     $this->hasAttachedFile('titledeed');
     $this->hasAttachedFile('passportphoto');
     parent::__construct($attributes);
 }
Example #14
0
 /**
  * constructor
  */
 public function __construct(array $attributes = array())
 {
     $this->timestamps = false;
     // call superclass constructor
     //
     parent::__construct($attributes);
 }
Example #15
0
 /**
  *
  * @param type $module
  * @param type $entity
  * @param array $attributes
  */
 public function __construct($module = null, $entity = null, array $attributes = [])
 {
     parent::__construct($attributes);
     if ($module && $entity) {
         $this->setScaffold($module, $entity);
     }
 }
Example #16
0
 public function __construct()
 {
     parent::__construct();
     $this->table = "cliente";
     $this->clienteId = "id";
     $this->fields = explode(", ", "id, cpf, senha, nome, telefone, email, dt_nascimento");
 }
Example #17
0
 /**
  * Create a new Eloquent model instance.
  *
  * @param  array  $attributes
  */
 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
     if ($connection = config('laravel-auth.database.connection')) {
         $this->setConnection($connection);
     }
 }
Example #18
0
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     if (!$this->acl_field_key && $this->getKeyName()) {
         $this->acl_field_key = $this->getKeyName();
     }
 }
Example #19
0
 /**
  * Create a new Eloquent model instance.
  *
  * @param  array  $attributes
  * @return void
  */
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     // Set the prefix
     $this->prefix = Config::get('power::prefix', 'test');
     $this->table = $this->prefix . $this->getTable();
 }
Example #20
0
 /**
  * {@inheritdoc}
  */
 public function __construct(array $attributes = [])
 {
     $defaults = [];
     static::$dispatcher->fire(new ConfigureModelDefaultAttributes($this, $defaults));
     $this->attributes = $defaults;
     parent::__construct($attributes);
 }
Example #21
0
 /**
  * Create a new Eloquent model instance.
  *
  * @param  array  $attributes
  * @return void
  */
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     // Set the prefix
     $this->prefix = \Config::get('admin.prefix', 'admin_');
     $this->table = $this->prefix . $this->getTable();
 }
Example #22
0
 function __construct()
 {
     if (!empty(Config::get('corcel.connection'))) {
         $this->connection = Config::get('corcel.connection');
     }
     parent::__construct();
 }
Example #23
0
 /**
  * Create a new model instance.
  *
  * @param array $attributes
  * @return void
  */
 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
     if ($connection = config('roles.connection')) {
         $this->connection = $connection;
     }
 }
Example #24
0
 /**
  * Create a new Eloquent model instance.
  *
  * @param  array  $attributes
  */
 public function __construct($attributes = [])
 {
     if ($this->isPrefixed()) {
         $this->table = $this->prefix . $this->table;
     }
     parent::__construct($attributes);
 }
Example #25
0
 /**
  * Create a new CabinetUpload instance.
  */
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     if (!static::$app) {
         static::$app = app();
     }
 }
Example #26
0
    /**
     * Constructor
     *
     * @param array $attributes
     *
     * @return void
     */
    public function __construct($attributes = array()) {
        parent::__construct($attributes);

        if ($this->sti_field) {
            $this->setAttribute($this->sti_field, get_class($this));
        }
    }
 public function __construct($attributes = array())
 {
     parent::__construct($attributes);
     if ((new \ReflectionClass(get_class($this)))->isInstantiable()) {
         $this->setAttribute($this->getStiClassField(), get_class($this));
     }
 }
Example #28
0
 /**
  * @param array $attributes
  */
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     if ($this->isNeedMigrate()) {
         $this->autoMigrate();
     }
 }
Example #29
0
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     // Set the prefix
     $tableName = \Config::get('kandy-laravel.kandy_live_chat_table');
     $this->table = $this->prefix . $tableName;
 }
Example #30
0
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     if (!$this->root) {
         $this->root = $this->getRoot();
     }
 }