Skip to content

Instantly share code, notes, and snippets.

@evercode1
Created February 11, 2017 06:47
Show Gist options
  • Select an option

  • Save evercode1/a7c4d87f75ea26b006ffb57d9591cad9 to your computer and use it in GitHub Desktop.

Select an option

Save evercode1/a7c4d87f75ea26b006ffb57d9591cad9 to your computer and use it in GitHub Desktop.
chapter 15 Category.php
<?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