Skip to content

Instantly share code, notes, and snippets.

@prio101
Created July 28, 2015 07:50
Show Gist options
  • Select an option

  • Save prio101/0fe2ac176f485c15ebb1 to your computer and use it in GitHub Desktop.

Select an option

Save prio101/0fe2ac176f485c15ebb1 to your computer and use it in GitHub Desktop.
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
class Menu extends Model
{
//Using the table name
protected $table = "menus" ;
/*Each menu is belongs to a user*/
public function user(){
return $this->belongsTo('App\User');
}
/*Getting all data as content from the table*/
public function getAllContent(){
return Menu::all();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment