-
Notifications
You must be signed in to change notification settings - Fork 164
Home
John Dave Decano edited this page Oct 22, 2013
·
6 revisions
Welcome to the PHPLaravelGymManagementSystem wiki!
// Members Model
$members = Member::all();
// Order by latest members
$members = Member::orderBy('created_at','desc')->get();
// Conditions
$members = Member::where('last_name','=','decano')->get();
// Single Result
$member = Member::find($primary_key);
$member->first_name;
$member->last_name;
// Same Result
$member = Member::where('id','=',1)->first();
$member->first_name;
$member->last_name;
$packages = Memberpackage::where('member_id','=',1)->get();
//Same Result
$member = Member::find(1);
$member->memberpackages->get();
$member->memberpackages->count(); // Total Member packages