Skip to content

Instantly share code, notes, and snippets.

@DavidStrada
Created June 28, 2016 18:38
Show Gist options
  • Save DavidStrada/3d04899201ee65c55842e947971b0ab3 to your computer and use it in GitHub Desktop.
Save DavidStrada/3d04899201ee65c55842e947971b0ab3 to your computer and use it in GitHub Desktop.
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Article extends Model
{
protected $fillable = ['name', 'content'];
public function laws()
{
return $this->belongsTo(Law::class);
}
public function articles()
{
return $this->belongsToMany(Article::class);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment