Created
November 9, 2012 11:42
-
-
Save aranw/4045289 to your computer and use it in GitHub Desktop.
Models
This file contains 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
class Album extends \Eloquent | |
{ | |
public static $timestamps = true; | |
public function artist() | |
{ | |
return $this->belongs_to('Askonasholt\Artist'); | |
} | |
public function image() | |
{ | |
return $this->belongs_to('Askonasholt\Image'); | |
} | |
} |
This file contains 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
class Artist extends \Eloquent | |
{ | |
public static $timestamps = true; | |
public function album() | |
{ | |
return $this->has_many('Askonasholt\Album'); | |
} | |
} |
This file contains 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
Artist | |
----- | |
ID | |
Name | |
Album | |
----------- | |
ID | |
artist_id | |
image_id | |
Images | |
------ | |
ID | |
Name |
This file contains 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
class Image extends \Eloquent | |
{ | |
public function album() | |
{ | |
return $this->has_many('Askonasholt\Album'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment