Created
February 11, 2017 06:47
-
-
Save evercode1/a7c4d87f75ea26b006ffb57d9591cad9 to your computer and use it in GitHub Desktop.
chapter 15 Category.php
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; | |
| use Illuminate\Database\Eloquent\Model; | |
| class Category extends Model | |
| { | |
| protected $fillable = ['name']; | |
| public function subcategories() | |
| { | |
| return $this->hasMany(Subcategory::class); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment