Created
February 15, 2015 12:47
-
-
Save coreymcmahon/46409ac52efc5a8a700b to your computer and use it in GitHub Desktop.
Laravel 5: camel-case to snake-case mapping for eloquent relations has been dropped - http://slashnode.com/definitive-laravel-4-to-laravel-5-migration-guide/
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\Models; | |
class Article extends Model | |
{ | |
/** etc... */ | |
public function associatedUsers() | |
{ | |
return $this->belongsToMany('...'); | |
} | |
/** etc... */ | |
} | |
$article = App\Models\Article::find(1); | |
// below: works in Laravel 4.2, but not Laravel 5 | |
$article->associated_users; | |
// instead use this | |
$article->associatedUsers; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment