123456789101112131415161718192021222324252627282930 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Notifications\Notifiable;
- class Code extends Model
- {
- use Notifiable{
- notify as protected laravelNotify;
- }
- protected $table='code';
- public function get_user(){
- return $this->belongsTo(User::class,'user_id');
- }
- public function user(){
- return $this->belongsTo(User::class,'user_id');
- }
- public function enroll(){
- return $this->belongsTo(Code::class,'user_id','user_id');
- }
- public function notify($instance)
- {
- $this->laravelNotify($instance);
- }
- }
|