Permalink
Browse files

Add Thread model

  • Loading branch information...
NathanHeffley committed Jan 11, 2018
1 parent 238b373 commit 1bde7f36b7d0bc809c6ee85279766dbbf53d99cb
Showing with 18 additions and 10 deletions.
  1. +13 −0 app/Thread.php
  2. +5 −10 app/User.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');
}
}
@@ -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.