Created
July 9, 2018 04:41
-
-
Save tiagoandrepro/c3cb09986c87aa267710bfd6dfc7b394 to your computer and use it in GitHub Desktop.
Treinamento
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 Course extends Model | |
| { | |
| public $table = 'courses'; | |
| public function user() | |
| { | |
| return $this->belongsToMany('App\User'); | |
| } | |
| public function order() | |
| { | |
| return $this->belongsToMany(Order::class); | |
| } | |
| } |
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 Order extends Model | |
| { | |
| public function user() | |
| { | |
| return $this->belongsTo('App\User'); | |
| } | |
| public function course() | |
| { | |
| return $this->belongsToMany(Course::class); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment