Created
May 14, 2021 09:30
-
-
Save EmmanuelObua/69239d34a02c0788529e9adf8e3c7085 to your computer and use it in GitHub Desktop.
User post relationship
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* User | |
* | |
* @author Obua Emmanuel <eobua6882@gmail.com> | |
* @copyright 2021 Obua Emmanuel | |
* @link http://emmanuelobua.me | |
* @version 1.0.0 | |
* | |
*/ | |
namespace App; | |
use Illuminate\Contracts\Auth\MustVerifyEmail; | |
use Illuminate\Foundation\Auth\User as Authenticatable; | |
use Illuminate\Notifications\Notifiable; | |
class User extends Authenticatable | |
{ | |
/** | |
* A user has many posts | |
* @return void | |
*/ | |
public function posts() | |
{ | |
return $this->hasMany(Post::class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment