PHPackages                             redbeed/corcel-laravel5 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. redbeed/corcel-laravel5

AbandonedArchivedLibrary

redbeed/corcel-laravel5
=======================

Wrappers to collect data from Wordpress databases with Laravel 5

63.6kPHP

Since Sep 2Pushed 8y ago1 watchersCompare

[ Source](https://github.com/redbeed/corcel-laravel5)[ Packagist](https://packagist.org/packages/redbeed/corcel-laravel5)[ RSS](/packages/redbeed-corcel-laravel5/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Wordpress Corcel
================

[](#wordpress-corcel)

*This is a fork of [jgrossi/corcel](https://github.com/jgrossi/corcel)*

\--

Corcel is a class collection created to retrieve Wordpress database data using a better syntax. It uses the Eloquent ORM developed for the Laravel 5 Framework.

This way you can use Wordpress as back-end, to insert posts, custom types, etc.

Installation
------------

[](#installation)

To install Corcel just create a `composer.json` file and add:

```
"require": {
    "redbeed/corcel-laravel5": "dev-master"
},

```

After that run `composer update` and wait.

Usage
-----

[](#usage)

First you must add the service provider to to `config/app.php` under `providers`

```
Corcel\CorcelServiceProvider::class

```

Now you must publish the assets:

```
php artisan vendor:publish

```

You can specify the connection in the corcel config file.

```
config/corcel.php

```

### Posts

[](#posts)

```
// All published posts
$posts = Post::published()->get();
$posts = Post::status('publish')->get();

// A specific post
$post = Post::find(31);
echo $post->post_title;

```

You can retrieve meta data from posts too.

```
// Get a custom meta value (like 'link' or whatever) from a post (any type)
$post = Post::find(31);
echo $post->meta->link; // OR
echo $post->fields->link;
echo $post->link; // OR

```

Updating post custom fields:

```
$post = Post::find(1);
$post->meta->username = 'juniorgrossi';
$post->meta->url = 'http://grossi.io';
$post->save();

```

Inserting custom fields:

```
$post = new Post;
$post->save();

$post->meta->username = 'juniorgrossi';
$post->meta->url = 'http://grossi.io';
$post->save();

```

### Custom Post Type

[](#custom-post-type)

You can work with custom post types too. You can use the `type(string)` method or create your own class.

```
// using type() method
$videos = Post::type('video')->status('publish')->get();

// using your own class
class Video extends Corcel\Post
{
    protected $postType = 'video';
}
$videos = Video::status('publish')->get();

```

Custom post types and meta data:

```
// Get 3 posts with custom post type (store) and show its title
$stores = Post::type('store')->status('publish')->take(3)->get();
foreach ($stores as $store) {
    $storeAddress = $store->address; // option 1
    $storeAddress = $store->meta->address; // option 2
    $storeAddress = $store->fields->address; // option 3
}

```

### Taxonomies

[](#taxonomies)

You can get taxonomies for a specific post like:

```
$post = Post::find(1);
$taxonomy = $post->taxonomies()->first();
echo $taxonomy->taxonomy;

```

Or you can search for posts using its taxonomies:

```
$post = Post::taxonomy('category', 'php')->first();

```

### Pages

[](#pages)

Pages are like custom post types. You can use `Post::type('page')` or the `Page` class.

```
// Find a page by slug
$page = Page::slug('about')->first(); // OR
$page = Post::type('page')->slug('about')->first();
echo $page->post_title;

```

### Categories &amp; Taxonomies

[](#categories--taxonomies)

Get a category or taxonomy or load posts from a certain category. There are multiple ways to achief it.

```
// all categories
$cat = Taxonomy::category()->slug('uncategorized')->posts()->first();
echo ""; print_r($cat->name); echo "";

// only all categories and posts connected with it
$cat = Taxonomy::where('taxonomy', 'category')->with('posts')->get();
$cat->each(function($category) {
    echo $category->name;
});

// clean and simple all posts from a category
$cat = Category::slug('uncategorized')->posts()->first();
$cat->posts->each(function($post) {
    echo $post->post_title;
});

```

### Attachment and Revision

[](#attachment-and-revision)

Getting the attachment and/or revision from a `Post` or `Page`.

```
$page = Page::slug('about')->with('attachment')->first();
// get feature image from page or post
print_r($page->attachment);

$post = Post::slug('test')->with('revision')->first();
// get all revisions from a post or page
print_r($post->revision);

```

Licence
-------

[](#licence)

Corcel is licensed under the MIT license.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1660cd922b8d833a04149c582482e698681123d8370019c20d04e0d3ce51218a?d=identicon)[redbeed](/maintainers/redbeed)

---

Top Contributors

[![yoramdelangen](https://avatars.githubusercontent.com/u/1531885?v=4)](https://github.com/yoramdelangen "yoramdelangen (5 commits)")[![jeffersonsouza](https://avatars.githubusercontent.com/u/1742484?v=4)](https://github.com/jeffersonsouza "jeffersonsouza (2 commits)")[![jgrossi](https://avatars.githubusercontent.com/u/1175275?v=4)](https://github.com/jgrossi "jgrossi (2 commits)")[![ashwin-sureshkumar](https://avatars.githubusercontent.com/u/4744080?v=4)](https://github.com/ashwin-sureshkumar "ashwin-sureshkumar (1 commits)")[![bruno-barros](https://avatars.githubusercontent.com/u/1840784?v=4)](https://github.com/bruno-barros "bruno-barros (1 commits)")[![kriskbx](https://avatars.githubusercontent.com/u/3148865?v=4)](https://github.com/kriskbx "kriskbx (1 commits)")[![chris-redbeed](https://avatars.githubusercontent.com/u/7247625?v=4)](https://github.com/chris-redbeed "chris-redbeed (1 commits)")

### Embed Badge

![Health badge](/badges/redbeed-corcel-laravel5/health.svg)

```
[![Health](https://phpackages.com/badges/redbeed-corcel-laravel5/health.svg)](https://phpackages.com/packages/redbeed-corcel-laravel5)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
