Created
March 12, 2022 17:43
-
-
Save emmadesilva/7ec39b453196d7e2bcdadacf7c439246 to your computer and use it in GitHub Desktop.
Tie-in gist with API blog post #3
This file contains hidden or 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 | |
| namespace App\Models; | |
| use Illuminate\Database\Eloquent\Model; | |
| class Log extends Model | |
| { | |
| /** | |
| * Indicates if the model should be timestamped. | |
| * | |
| * @var bool | |
| */ | |
| public $timestamps = false; | |
| /** | |
| * Get the user that owns the Log | |
| * | |
| * @return \Illuminate\Database\Eloquent\Relations\BelongsTo | |
| */ | |
| public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo | |
| { | |
| return $this->belongsTo(User::class); | |
| } | |
| /** | |
| * Get the team that owns the Log | |
| * | |
| * @return \Illuminate\Database\Eloquent\Relations\BelongsTo | |
| */ | |
| public function team(): \Illuminate\Database\Eloquent\Relations\BelongsTo | |
| { | |
| return $this->belongsTo(Team::class); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment