Exemplo n.º 1
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;
     }
 }
 public function __construct(array $attributes = [])
 {
     $this->attributes['status'] = true;
     static::$rules = array_add(static::$rules, 'name', 'required|max:255');
     static::$rules = array_add(static::$rules, 'price', 'required|numeric|min:0');
     parent::__construct($attributes);
 }
 public function __construct(array $attributes = [])
 {
     $this->attributes['status'] = true;
     static::$rules = array_add(static::$rules, 'first_name', 'required|max:100');
     static::$rules = array_add(static::$rules, 'phone', 'required|max:100');
     static::$rules = array_add(static::$rules, 'email', 'required|email|max:100');
     parent::__construct($attributes);
 }
 public function __construct(array $attributes = [])
 {
     $this->attributes['status'] = true;
     static::$rules = array_add(static::$rules, 'name', 'required|max:100');
     // static::$rules = array_add(static::$rules, 'description', 'required|max:100');
     // static::$rules = array_add(static::$rules, 'phone', 'required|max:100');
     // static::$rules = array_add(static::$rules, 'email', 'required');
     // static::$rules = array_add(static::$rules, 'location', 'required');
     // static::$rules = array_add(static::$rules, 'website', 'required');
     // static::$rules = array_add(static::$rules, 'logo', 'required|mimes:jpeg,bmp,png,jpg');
     // static::$rules = array_add(static::$rules, 'background_image', 'required|mimes:jpeg,bmp,png,jpg');
     // static::$rules = array_add(static::$rules, 'start_at_hh', 'required');
     // static::$rules = array_add(static::$rules, 'end_at_hh', 'required');
     // static::$rules = array_add(static::$rules, 'days', 'required');
     // static::$rules = array_add(static::$rules, 'capacity_max', 'required');
     // static::$rules = array_add(static::$rules, 'extends_tables', '');
     parent::__construct($attributes);
 }
Exemplo n.º 5
0
 function __construct()
 {
     // Try to find Cockpit Collections
     $result = \DB::collection('common_collections')->get();
     if (!$result) {
         throw new \Exception("Unable to find Cockpit 'common_collections' collection. Is Cockpit installed correctly?");
     }
     // Try to find this collection via it's slug
     $found = array_filter($result, function ($collection) {
         if ($collection['slug'] == $this->cockpitSlug) {
             $this->collection = "collections_collection{$collection['_id']}";
             $this->cockpitCollection = $collection;
             return $collection;
         }
     });
     if (!$found) {
         throw new \Exception("Unable to find Cockpit collection with slug '{$this->cockpitSlug}'");
     }
     // Off we go...
     parent::__construct();
 }
 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
 }
Exemplo n.º 7
0
 /**
  * Create a new Ardent model instance.
  *
  * @param array $attributes
  * @return \LaravelBook\Ardent\Ardent
  */
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes);
     $this->validationErrors = new MessageBag();
 }
Exemplo n.º 8
0
 /**
  *@todo The configuration options need to live in the config file.
  */
 public function __construct(array $attributes = array())
 {
     $this->hasAttachedFile('photo', ['styles' => ['smartphone' => '320x175', 'tablet_portrait' => '600x365', 'tablet_landscape' => '768x445', 'desktop' => '1024x480']]);
     parent::__construct($attributes);
 }