Skip to content

Commit

Permalink
Merge pull request #25 from RUGSoftEng/Patient_User
Browse files Browse the repository at this point in the history
Changed to blade syntax
  • Loading branch information
Dammes authored May 11, 2018
2 parents 8df2b38 + 94da9aa commit 3ce6588
Show file tree
Hide file tree
Showing 410 changed files with 260,799 additions and 108,457 deletions.
29 changes: 29 additions & 0 deletions app/CommentReply.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
* Reply written to a VerificationComment
*
* @property timestamp created_at
* @property string text
*/
class CommentReply extends Model
{
protected $table = 'comment_replies';
public $timestamps = false;

protected $fillable = ['text'];

public function author()
{
return $this->belongsTo('App\User','author_id');
}

public function verificationComment()
{
return $this->belongsTo('App\VerificationComment','verification_comment_id');
}
}
41 changes: 40 additions & 1 deletion app/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,50 @@

use Illuminate\Database\Eloquent\Model;

/**
* Fields that are provided in an input step. They can be either categorical
* (then they contain a number of options and have empty continuous attributes)
* or continuous (they provide additional attributes)
*
* @property string friendly_title Title that is friendly to a patient
* @property string friendly_description Description that is friendly to a patient
* @property int continuous_field_max Maximum input value (Applies only to
* continuous fields)
* @property int continuous_field_min Minimum input value (Applies only to
* continuous fields)
* @property int continuous_field_step_by Interval between possible input values
* (Applies only to continuous fields)
* @property int continuous_field_unit Unit of the value (kilograms, years, etc.)
* (Applies only to continuous fields)
* @property int evidencio_variable_id Evidencio API variable id associated with
* this field in the designer page
*/
class Field extends Model
{
public $timestamps = false;

protected $fillable = [
'evidencio_variable_id','friendly_title','friendly_description','continuous_field_max','continuous_field_min','continuous_field_step_by','continuous_field_unit'
];

/**
* Possible options of a field (Applies only to categorical fields)
*/
public function options()
{
return $this->hasMany('App\Option','categoricalFieldId');
return $this->hasMany('App\Option','categorical_field_id');
}

/**
* Input steps that have this field
*/
public function inputSteps()
{
return $this->belongsToMany('App\Step','field_in_input_steps','field_id','input_step_id');
}

public function usedInRunsInSteps()
{
return $this->belongsToMany('App\Step','model_run_field_mappings','field_id','step_id');
}
}
7 changes: 6 additions & 1 deletion app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|string|max:255',
'first_name' => 'required|string|max:30',
'last_name' => 'required|string|max:30',
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|min:6|confirmed',
]);
Expand All @@ -65,8 +67,11 @@ protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'first_name' => $data['first_name'],
'last_name' => $data['last_name'],
'language_code' => 'en',
'email' => $data['email'],
'password' => Hash::make($data['password']),
'password' => Hash::make($data['password'])
]);
}
}
Loading

0 comments on commit 3ce6588

Please sign in to comment.