Skip to content

Commit

Permalink
Merge pull request #668 from mikemand/feature/allow-user-model-override
Browse files Browse the repository at this point in the history
Allow the User model to be customized
  • Loading branch information
austintoddj committed Mar 18, 2020
2 parents 402007d + 2f78dc6 commit fa864b8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions config/canvas.php
Expand Up @@ -15,6 +15,19 @@

'path' => env('CANVAS_PATH_NAME', 'canvas'),

/*
|--------------------------------------------------------------------------
| User Model
|--------------------------------------------------------------------------
|
| Next, you may define a specific user model that your application will
| use for authentication. This will define the relationships between
| a user and their posts, tags, and topics that they author.
|
*/

'user' => Illuminate\Foundation\Auth\User::class,

/*
|--------------------------------------------------------------------------
| Route Middleware
Expand Down
2 changes: 1 addition & 1 deletion src/Post.php
Expand Up @@ -118,7 +118,7 @@ public function topic()
*/
public function user()
{
return $this->belongsTo(User::class);
return $this->belongsTo(config('canvas.user'));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/UserMeta.php
Expand Up @@ -39,7 +39,7 @@ class UserMeta extends Model
*/
public function user()
{
return $this->belongsTo(User::class);
return $this->belongsTo(config('canvas.user'));
}

/**
Expand Down

0 comments on commit fa864b8

Please sign in to comment.