Created
March 27, 2017 18:20
-
-
Save web-hat/ee947d290d26baee0d3a0de87ae33359 to your computer and use it in GitHub Desktop.
Accessing WordPress Post through Laravel
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
<?php | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
class BlogPostmeta extends Model { | |
protected $connection = 'wordpress_db_connection'; | |
protected $table = 'postmeta'; | |
protected $primaryKey = 'meta_id'; | |
/** | |
* Get the postmeta for the blog post. | |
*/ | |
public function post() { | |
return $this->belongsTo('App\BlogPost'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment