12345678910111213141516171819202122 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class Note extends Model
- {
- protected $table='notes';
- public function get_notes(){
- return $this->hasMany(Note::class,'user_id','user_id');
- }
- public function note_like(){
- return $this->hasOne(NoteLike::class,'note_id');
- }
- public function get_user(){
- return $this->hasOne(User::class,'id','user_id');
- }
- }
|