Skip to content

Commit

Permalink
Add Thread model
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanheffley committed Jan 11, 2018
1 parent 238b373 commit 1bde7f3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
13 changes: 13 additions & 0 deletions app/Thread.php
@@ -0,0 +1,13 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Thread extends Model
{
public function author()
{
return $this->belongsTo('App\User');
}
}
15 changes: 5 additions & 10 deletions app/User.php
Expand Up @@ -9,21 +9,16 @@ class User extends Authenticatable
{
use Notifiable;

/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];

/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];

public function threads()
{
return $this->hasMany('App\Thread');
}
}

0 comments on commit 1bde7f3

Please sign in to comment.