PHPackages                             rsanchez/deep - 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. [Database &amp; ORM](/categories/database)
4. /
5. rsanchez/deep

ActiveLibrary[Database &amp; ORM](/categories/database)

rsanchez/deep
=============

A set of Eloquent models for ExpressionEngine Channel Entries.

3.0.1(5y ago)502.4k14[5 issues](https://github.com/rsanchez/Deep/issues)[1 PRs](https://github.com/rsanchez/Deep/pulls)PHPPHP &gt;=5.4.0CI failing

Since Apr 20Pushed 5y ago4 watchersCompare

[ Source](https://github.com/rsanchez/Deep)[ Packagist](https://packagist.org/packages/rsanchez/deep)[ RSS](/packages/rsanchez-deep/feed)WikiDiscussions 2.0 Synced 3d ago

READMEChangelog (2)Dependencies (7)Versions (31)Used By (0)

Deep
====

[](#deep)

[![Build Status](https://camo.githubusercontent.com/4fded1c53d71b62f5a76ba34fd2adc1f8d618086f05e91f2e9300156ad3de076/68747470733a2f2f7472617669732d63692e6f72672f7273616e6368657a2f446565702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rsanchez/Deep)[![Total Downloads](https://camo.githubusercontent.com/08d36c11c829dd6b126fe19b5e9094916adf729636f57d61567c3163c228b9d2/68747470733a2f2f706f7365722e707567782e6f72672f7273616e6368657a2f646565702f646f776e6c6f6164732e706e67)](https://packagist.org/packages/rsanchez/deep)[![Latest Stable Version](https://camo.githubusercontent.com/569a39023881575bb7aa5e4e637aef63625a4d27a8f1e6f30c3dc3b079001a5b/68747470733a2f2f706f7365722e707567782e6f72672f7273616e6368657a2f646565702f762f737461626c652e706e67)](https://packagist.org/packages/rsanchez/deep)

A read-only set of [Eloquent](http://laravel.com/docs/eloquent) models for ExpressionEngine Channel Entries. This library has a few goals in mind:

- replicate as much of the `{exp:channel:entries}` functionality as possible using Eloquent [query scopes](http://laravel.com/docs/eloquent#query-scopes)
- chainable with standard Eloquent model methods (ex. `->where('foo', 'bar')`)
- minimize the number of queries needed using eager loading
- provide an base plugin from which EE plugins/modules can extend, which has near parity with `{exp:channel:entries}`
- automatically fetch custom fields using field names and entities instead of just raw text from `exp_channel_data`

For more detailed information, see the [auto-generated API docs](http://rsanchez.github.io/Deep/api).

### Version Compatibility Chart

[](#version-compatibility-chart)

EE VersionDeep Version2.x[2.0.x](https://github.com/rsanchez/Deep/tree/2.0)3.x[2.1.x](https://github.com/rsanchez/Deep/tree/2.1)&gt;= 4.x[3.0.x](https://github.com/rsanchez/Deep/tree/3.0)```

```

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

[](#installation)

Run this command in your terminal:

```
composer require rsanchez/deep

```

Setup
-----

[](#setup)

### ExpressionEngine

[](#expressionengine)

Make sure you load composer's autoloader at the top of your `config.php` (your actual vendor path may vary):

```
require_once FCPATH.'vendor/autoload.php'

```

Then you can create your own plugin that uses Deep by [extending the `BasePlugin` class](#extending-the-baseplugin-class). Or you can use the built-in wrapper class, which bootstraps Deep with EE for you:

```
use rsanchez\Deep\Deep;
use rsanchez\Deep\Model\Entry;

Deep::bootEE();

$entries = Entry::channel('blog')
                ->limit(10)
                ->get();

```

### Laravel

[](#laravel)

Deep comes with a service provider for Laravel. Add this to the list of providers in `app/config/app.php`:

```
'rsanchez\Deep\App\Laravel\ServiceProvider',

use rsanchez\Deep\Model\Entry;

route('/blog', function()
{
    $entries = Entry::channel('blog')->get();
    return View::make('blog.index')->withEntries($entries);
});

route('/blog/json', function()
{
    $entries = Entry::channel('blog')->get();
    return Response::json($entries);
});

```

If you are using a table prefix for your database tables (EE uses `exp_` by default, so you most likely are), make sure to set the prefix in Laravel's `app/config/database.php`

If you need to use a DB connection other than Laravel's default connection, you should add the following configuration to `app/config/database.php`:

```
'deep' => array(
    'connection' => 'your_connection_name',
),

```

The specified connection will be used for all of Deep's models.

### Generic PHP (or other framework)

[](#generic-php-or-other-framework)

First you must bootstrap Eloquent for use outside of Laravel. There are [many](https://laracasts.com/lessons/how-to-use-eloquent-outside-of-laravel) [guides](http://www.slimframework.com/news/slim-and-laravel-eloquent-orm) [out](http://www.edzynda.com/use-laravels-eloquent-orm-outside-of-laravel/) [there](http://jenssegers.be/blog/53/using-eloquent-without-laravel) on how to do this.

Then you can simply use the generic wrapper:

```
use rsanchez\Deep\Deep;
use rsanchez\Deep\Model\Entry;

Deep::bootInstance();

$entries = Entry::channel('blog')
                ->limit(10)
                ->get();

```

Or instantiate your own instance of the Deep DI container if you prefer:

```
use rsanchez\Deep\Deep;

$deep = new Deep();

$entries = $deep->make('Entry')
                ->channel('blog')
                ->limit(10)
                ->get();

```

### Using the Phar archive for easier distribution

[](#using-the-phar-archive-for-easier-distribution)

You can build a Phar archive as an alternative installation method. The best way to package Deep with your custom distributed add-on is to use the Phar archive, since EE doesn't natively support compser installation out of the box.

To build the Phar archive, you must have [box](http://box-project.org/) installed. Then you can clone this repo, run `composer install` to fetch all the dependencies, and run `box build` to create the Phar archive. The archive can be found in `build/deep.phar` after it's built.

Now you can package that single Phar archive with your add-on (say, in a `phar` folder in your add-on root) and load it like so:

```
// this is a courtesy check in case other add-ons are also
// using deep.phar
if ( ! class_exists('\\rsanchez\\Deep\\Deep'))
{
    require_once PATH_THIRD.'your_addon/phar/deep.phar';
}

```

Query Scopes
------------

[](#query-scopes)

### Filtering Scopes

[](#filtering-scopes)

Filtering scopes should look familiar, since most of them relate to a native `{exp:channel:entries}` parameter.

#### Channel Name

[](#channel-name)

```
Entry::channel('blog', 'news')->get();

```

#### Not Channel Name

[](#not-channel-name)

```
Entry::notChannel('blog', 'news')->get();

```

#### Channel ID

[](#channel-id)

```
Entry::channelId(1, 2)->get();

```

#### Not Channel ID

[](#not-channel-id)

```
Entry::notChannelId(1, 2)->get();

```

#### Author ID

[](#author-id)

```
Entry::authorId(1, 2)->get();

```

#### Not Author ID

[](#not-author-id)

```
Entry::notAuthorId(1, 2)->get();

```

#### Category ID

[](#category-id)

```
Entry::category(1, 2)->get();

```

#### Not Category ID

[](#not-category-id)

```
Entry::notCategory(1, 2)->get();

```

#### All Categories

[](#all-categories)

Only show entries that have all of the specified categories.

```
Entry::allCategories(1, 2)->get();

```

#### Not All Categories

[](#not-all-categories)

Exclude entries that have all of the specified categories.

```
Entry::notAllCategories(1, 2)->get();

```

#### Category Name

[](#category-name)

```
Entry::categoryName('mammals', 'reptiles')->get();

```

#### Not Category Name

[](#not-category-name)

```
Entry::notCategoryName('mammals', 'reptiles')->get();

```

#### Category Group

[](#category-group)

```
Entry::categoryGroup(1, 2)->get();

```

#### Not Category Group

[](#not-category-group)

```
Entry::notCategoryGroup(1, 2)->get();

```

#### Day

[](#day)

```
Entry::day(31)->get();

```

#### Dynamic Parameters

[](#dynamic-parameters)

```
Entry::dynamicParameters(array('limit', 'search:your_field_name'), $_REQUEST)->get();

```

#### Entry ID

[](#entry-id)

```
Entry::entryId(1, 2)->get();

```

#### Not Entry ID

[](#not-entry-id)

```
Entry::notEntryId(1, 2)->get();

```

#### Entry ID From

[](#entry-id-from)

```
Entry::entryIdFrom(1)->get();

```

#### Entry ID To

[](#entry-id-to)

```
Entry::entryIdTo(100)->get();

```

#### Fixed Order

[](#fixed-order)

```
Entry::fixedOrder(4, 8, 15, 16, 23, 42)->get();

```

#### Member Group ID

[](#member-group-id)

```
Entry::groupId(1, 2)->get();

```

#### Not Member Group ID

[](#not-member-group-id)

```
Entry::notGroupId(1, 2)->get();

```

#### Limit

[](#limit)

```
Entry::limit(1)->get();

```

#### Month

[](#month)

```
Entry::month(12)->get();

```

#### Offset

[](#offset)

```
Entry::offset(1)->get();

```

#### Show Expired

[](#show-expired)

```
Entry::showExpired(false)->get();

```

#### Show Future Entries

[](#show-future-entries)

```
Entry::showFutureEntries(true)->get();

```

#### Show Pages

[](#show-pages)

```
Entry::showPages(false)->get();

```

#### Show Pages Only

[](#show-pages-only)

```
Entry::showPagesOnly(true)->get();

```

#### Site ID

[](#site-id)

```
Entry::siteId(1, 2)->get();

```

#### Start On

[](#start-on)

Unix time:

```
Entry::startOn(1394393247)->get();

```

Or use a `DateTime` object:

```
$date = new DateTime();
Entry::startOn($date)->get();

```

#### Stop Before

[](#stop-before)

Unix time:

```
Entry::stopBefore(1394393247)->get();

```

Or use a `DateTime` object:

```
$date = new DateTime();
Entry::stopBefore($date)->get();

```

#### Sticky

[](#sticky)

```
Entry::sticky(true)->get();

```

#### Status

[](#status)

```
Entry::status('open', 'closed')->get();

```

#### Not Status

[](#not-status)

```
Entry::notStatus('open', 'closed')->get();

```

#### URL Title

[](#url-title)

```
Entry::urlTitle('cats', 'dogs')->get();

```

#### Not URL Title

[](#not-url-title)

```
Entry::notUrlTitle('cats', 'dogs')->get();

```

#### Username

[](#username)

```
Entry::username('john_doe', 'jane_doe')->get();

```

#### Not Username

[](#not-username)

```
Entry::notUsername('john_doe', 'jane_doe')->get();

```

#### Year

[](#year)

```
Entry::year(2014)->get();

```

#### Tagparams

[](#tagparams)

This scope accepts an array of parameters And applies all the [supported](#parameters-not-implemented) `{exp:channel:entries}` parameters to the query.

```
Entry::tagparams(ee()->TMPL->tagparams)->get();

```

The following channel:entries parameters are not implemented by the `tagparams` scope:

- cache
- display\_by
- disable
- dynamic
- dynamic\_start
- month\_limit
- paginate
- paginate\_base
- paginate\_type
- refresh
- related\_categories\_mode
- relaxed\_categories
- require\_entry
- show\_current\_week
- track\_views
- week\_sort
- uncategorized\_entries

### Eager Loading Scopes

[](#eager-loading-scopes)

These scopes force eager loading of certain relationships. Eager loading of custom field data is done automatically with the `Entry` model (and the `Entries` proxy). Use the `Title` model (or the `Titles` proxy) to *not* eager load custom field data.

#### With Categories

[](#with-categories)

Eager load the `categories` attribute.

```
Entry::withCategories()->get();

```

#### With Category Fields

[](#with-category-fields)

Eager load the `categories` attribute with custom category fields.

```
Entry::withCategoryFields()->get();

```

#### With Author

[](#with-author)

Eager load the `author` attribute.

```
Entry::withAuthor()->get();

```

#### With Author Fields

[](#with-author-fields)

Eager load the `author` attribute with custom member fields.

```
Entry::withAuthorFields()->get();

```

#### With Parents

[](#with-parents)

Eager load the `parents` attribute (native EE relationship fields only).

```
Entry::withParents()->get();

```

#### With Siblings

[](#with-siblings)

Eager load the `siblings` attribute (native EE relationship fields only).

```
Entry::withSiblings()->get();

```

#### With Comments

[](#with-comments)

Eager load the `comments` attribute, a collection of Comment models.

```
Entry::withComments()->get();

```

#### Without Fields

[](#without-fields)

Do not load custom fields.

```
Entry::withoutFields()->get();

```

#### Without Child Fields

[](#without-child-fields)

Do not load custom fields in child (Playa/Relationship) entries.

```
Entry::withoutChildFields()->get();

```

#### With Fields

[](#with-fields)

Specify exactly which custom fields to load.

```
Entry::withFields(['your_custom_field', 'your_other_custom_field'])->get();

```

### Custom Field Scopes

[](#custom-field-scopes)

This set of scopes allows you to use the traditional some Eloquent methods with custom field names instead of `field_id_X`.

#### Order By Field

[](#order-by-field)

```
Entry::orderByField('your_custom_field', 'asc')->get();

```

#### Where Field

[](#where-field)

```
Entry::whereField('your_custom_field', 'foo')->get();

```

#### Or Where Field

[](#or-where-field)

```
Entry::orWhereField('your_custom_field', 'foo')->get();

```

#### Where Field In

[](#where-field-in)

```
Entry::whereFieldIn('your_custom_field', array('foo', 'bar'))->get();

```

#### Or Where Field In

[](#or-where-field-in)

```
Entry::orWhereFieldIn('your_custom_field', array('foo', 'bar'))->get();

```

#### Where Field Not In

[](#where-field-not-in)

```
Entry::whereFieldNotIn('your_custom_field', array('foo', 'bar'))->get();

```

#### Or Where Field Not In

[](#or-where-field-not-in)

```
Entry::orWhereFieldNotIn('your_custom_field', array('foo', 'bar'))->get();

```

#### Where Field Between

[](#where-field-between)

```
Entry::whereFieldBetween('your_custom_field', array(1, 10))->get();

```

#### Or Where Field Between

[](#or-where-field-between)

```
Entry::orWhereFieldBetween('your_custom_field', array(1, 10))->get();

```

#### Where Field Not Between

[](#where-field-not-between)

```
Entry::whereFieldNotBetween('your_custom_field', array(1, 10))->get();

```

#### Or Where Field Not Between

[](#or-where-field-not-between)

```
Entry::orWhereFieldNotBetween('your_custom_field', array(1, 10))->get();

```

#### Where Field Null

[](#where-field-null)

```
Entry::whereFieldNull('your_custom_field')->get();

```

#### Or Where Field Null

[](#or-where-field-null)

```
Entry::orWhereFieldNull('your_custom_field')->get();

```

#### Where Field Not Null

[](#where-field-not-null)

```
Entry::whereFieldNotNull('your_custom_field')->get();

```

#### Or Where Field Not Null

[](#or-where-field-not-null)

```
Entry::orWhereFieldNotNull('your_custom_field')->get();

```

#### Where Field Contains

[](#where-field-contains)

This is like `search:your_custom_field="foo|bar"`.

```
Entry::whereFieldContains('your_custom_field', 'foo', 'bar')->get();

```

#### Or Where Field Contains

[](#or-where-field-contains)

```
Entry::orWhereFieldContains('your_custom_field', 'foo', 'bar')->get();

```

#### Where Field Does Not Contain

[](#where-field-does-not-contain)

This is like `search:your_custom_field="not foo|bar"`.

```
Entry::whereFieldDoesNotContain('your_custom_field', 'foo', 'bar')->get();

```

#### Or Where Field Does Not Contain

[](#or-where-field-does-not-contain)

```
Entry::orWhereFieldDoesNotContain('your_custom_field', 'foo', 'bar')->get();

```

#### Where Field Contains Whole Word

[](#where-field-contains-whole-word)

This is like `search:your_custom_field="foo\W|bar\W"`.

```
Entry::whereFieldContainsWholeWord('your_custom_field', 'foo', 'bar')->get();

```

#### Or Where Field Contains Whole Word

[](#or-where-field-contains-whole-word)

```
Entry::orWhereFieldContainsWholeWord('your_custom_field', 'foo', 'bar')->get();

```

#### Where Field Does Not Contain Whole Word

[](#where-field-does-not-contain-whole-word)

This is like `search:your_custom_field="not foo\W|bar\W"`.

```
Entry::whereFieldDoesNotContainWholeWord('your_custom_field', 'foo', 'bar')->get();

```

#### Or Where Field Does Not Contain Whole Word

[](#or-where-field-does-not-contain-whole-word)

```
Entry::orWhereFieldDoesNotContainWholeWord('your_custom_field', 'foo', 'bar')->get();

```

### Advanced Category Querying

[](#advanced-category-querying)

This library makes use of Eloquent's [relationship capabilities](http://laravel.com/docs/eloquent#querying-relations). If you need to do more advanced category querying than the default category scopes, you can use the `whereHas` and `orWhereHas` methods.

```
Entry::whereHas('categories', function ($query) {
    // category starts with A
    $query->where('cat_name', 'LIKE', 'A%');
})->get();

```

Entry objects
-------------

[](#entry-objects)

Each entry object has the following string properties from the `exp_channel_titles` table.

```
$entry->entry_id
$entry->site_id
$entry->channel_id
$entry->author_id
$entry->forum_topic_id
$entry->ip_address
$entry->title
$entry->url_title
$entry->status
$entry->versioning_enabled
$entry->view_count_one
$entry->view_count_two
$entry->view_count_three
$entry->view_count_four
$entry->allow_comments
$entry->sticky
$entry->year
$entry->month
$entry->day
$entry->comment_total
$entry->page_uri

```

### Dates

[](#dates)

Entries have the following date properties. Each of these will be a [`Carbon` object](https://github.com/briannesbitt/Carbon). `expiration_date`, `comment_expiration_date` and `recent_comment_date` can be `null`.

```
$entry->entry_date
$entry->edit_date
$entry->expiration_date
$entry->comment_expiration_date
$entry->recent_comment_date

```

Dates are serialized to ISO-8601 format during toArray and toJson. To do this, Deep sets Carbon's default format to `DateTime::ISO8601` or `Y-m-d\TH:i:sO`. If you wish to change the default format, you should call `\Carbon\Carbon::setToStringFormat($yourDateFormatString)` prior to serialization. If you wish to reset this attribute globally in Carbon to the original default, you should call `Carbon::resetToStringFormat()`.

### Channel object

[](#channel-object)

If you need info about the entry's channel, there is the `$entry->channel` object. The channel object contains the following properties from the `exp_channels` table.

```
$entry->channel->channel_id
$entry->channel->site_id
$entry->channel->channel_name
$entry->channel->channel_title
$entry->channel->channel_url
$entry->channel->channel_description
$entry->channel->channel_lang
$entry->channel->total_entries
$entry->channel->total_comments
$entry->channel->last_entry_date
$entry->channel->last_comment_date
$entry->channel->cat_group
$entry->channel->status_group
$entry->channel->deft_status
$entry->channel->field_group
$entry->channel->search_excerpt
$entry->channel->deft_category
$entry->channel->deft_comments
$entry->channel->channel_require_membership
$entry->channel->channel_max_chars
$entry->channel->channel_html_formatting
$entry->channel->channel_allow_img_urls
$entry->channel->channel_auto_link_urls
$entry->channel->channel_notify
$entry->channel->channel_notify_emails
$entry->channel->comment_url
$entry->channel->comment_system_enabled
$entry->channel->comment_require_membership
$entry->channel->comment_use_captcha
$entry->channel->comment_moderate
$entry->channel->comment_max_chars
$entry->channel->comment_timelock
$entry->channel->comment_require_email
$entry->channel->comment_text_formatting
$entry->channel->comment_html_formatting
$entry->channel->comment_allow_img_urls
$entry->channel->comment_auto_link_urls
$entry->channel->comment_notify
$entry->channel->comment_notify_authors
$entry->channel->comment_notify_emails
$entry->channel->comment_expiration
$entry->channel->search_results_url
$entry->channel->show_button_cluster
$entry->channel->rss_url
$entry->channel->enable_versioning
$entry->channel->max_revisions
$entry->channel->default_entry_title
$entry->channel->url_title_prefix
$entry->channel->live_look_template

```

### Categories

[](#categories)

Each `Entry` object has a `categories` property which is a collection of `Category` objects. Use the `withCategories` or `withCategoryFields` scope to eager load this relationship.

```
foreach ($entry->categories as $category) {
    echo ''.$category->cat_name.'';
}

```

```
$category->cat_id
$category->site_id
$category->group_id
$category->parent_id
$category->cat_name
$category->cat_description
$category->cat_image
$category->cat_order
$category->your_custom_field

```

### Author

[](#author)

Each `Entry` object has a `author` property which is a `Member` object. Use the `withAuthor` or `withAuthorFields` scope to eager load this relationship.

```
$entry->author->member_id
$entry->author->group_id
$entry->author->username
$entry->author->screen_name
$entry->author->password
$entry->author->salt
$entry->author->unique_id
$entry->author->crypt_key
$entry->author->authcode
$entry->author->email
$entry->author->url
$entry->author->location
$entry->author->occupation
$entry->author->interests
$entry->author->bday_d
$entry->author->bday_m
$entry->author->bday_y
$entry->author->aol_im
$entry->author->yahoo_im
$entry->author->msn_im
$entry->author->icq
$entry->author->bio
$entry->author->signature
$entry->author->avatar_filename
$entry->author->avatar_width
$entry->author->avatar_height
$entry->author->photo_filename
$entry->author->photo_width
$entry->author->photo_height
$entry->author->sig_img_filename
$entry->author->sig_img_width
$entry->author->sig_img_height
$entry->author->ignore_list
$entry->author->private_messages
$entry->author->accept_messages
$entry->author->last_view_bulletins
$entry->author->last_bulletin_date
$entry->author->ip_address
$entry->author->join_date
$entry->author->last_visit
$entry->author->last_activity
$entry->author->total_entries
$entry->author->total_comments
$entry->author->total_forum_topics
$entry->author->total_forum_posts
$entry->author->last_entry_date
$entry->author->last_comment_date
$entry->author->last_forum_post_date
$entry->author->last_email_date
$entry->author->in_authorlist
$entry->author->accept_admin_email
$entry->author->accept_user_email
$entry->author->notify_by_default
$entry->author->notify_of_pm
$entry->author->display_avatars
$entry->author->display_signatures
$entry->author->parse_smileys
$entry->author->smart_notifications
$entry->author->language
$entry->author->timezone
$entry->author->time_format
$entry->author->include_seconds
$entry->author->date_format
$entry->author->cp_theme
$entry->author->profile_theme
$entry->author->forum_theme
$entry->author->tracker
$entry->author->template_size
$entry->author->notepad
$entry->author->notepad_size
$entry->author->quick_links
$entry->author->quick_tabs
$entry->author->show_sidebar
$entry->author->pmember_id
$entry->author->rte_enabled
$entry->author->rte_toolset_id
$entry->author->your_custom_field

```

### Comments

[](#comments)

Each `Entry` object has a `comments` property which is a collection of `Comment` objects. Use the `withComments` scope to eager load this relationship.

```
$entry->comment->comment_id
$entry->comment->site_id
$entry->comment->entry_id
$entry->comment->channel_id
$entry->comment->author_id
$entry->comment->status
$entry->comment->name
$entry->comment->email
$entry->comment->url
$entry->comment->location
$entry->comment->ip_address
$entry->comment->comment_date
$entry->comment->edit_date
$entry->comment->comment
$entry->comment->author->member_id
$entry->comment->author->username
$entry->comment->author->screen_name

```

### Custom Fields

[](#custom-fields)

Entries have their custom fields as properties, keyed by the field short name. Most custom field properties merely the string data from the corresponding `exp_channel_data` `field_id_X` column.

```
$entry->your_field_name

```

For the following fieldtypes, an entry's custom field properties will be special objects, rather than string data from the `exp_channel_data` table.

### Matrix &amp; Grid

[](#matrix--grid)

Matrix &amp; Grid fields will be Eloquent Collections of `Row` objects. Each `Row` object has string properties keyed to the column short name from the `exp_matrix_data` and `exp_channel_grid_field_X` tables, respectively. Custom `Row` fields follow the same logic as `Entry` custom fields.

```
$number_of_rows = $entry->your_matrix_field->count();

foreach ($entry->your_matrix_field as $row) {
    echo $row->your_text_column;
    foreach ($row->your_playa_column as $childEntry) {
        echo $childEntry->title;
    }
}

```

### Playa &amp; Relationship

[](#playa--relationship)

Playa &amp; Relationship fields will be Eloquent Collections of related `Entry` objects. These `Entry` objects behave just as parent `Entry` objects do.

```
$number_of_rows = $entry->your_playa_field->count();

foreach ($entry->your_playa_field as $childEntry) {
    echo $childEntry->title;
}

```

### Assets

[](#assets)

Assets fields will be Eloquent Collections of `Asset` objects. `Asset` objects have the following properties:

```
foreach ($entry->your_assets_field as $file) {
    $file->url
    $file->server_path
    $file->file_id
    $file->folder_id
    $file->source_type
    $file->source_id
    $file->filedir_id
    $file->file_name
    $file->title
    $file->date
    $file->alt_text
    $file->caption
    $file->author
    $file->desc
    $file->location
    $file->keywords
    $file->date_modified
    $file->kind
    $file->width
    $file->height
    $file->size
    $file->search_keywords
}

```

### File

[](#file)

File fields will be a single `File` object. `File` objects have the following properties:

```
$entry->your_file_field->url
$entry->your_file_field->server_path
$entry->your_file_field->file_id
$entry->your_file_field->site_id
$entry->your_file_field->title
$entry->your_file_field->upload_location_id
$entry->your_file_field->rel_path
$entry->your_file_field->mime_type
$entry->your_file_field->file_name
$entry->your_file_field->file_size
$entry->your_file_field->description
$entry->your_file_field->credit
$entry->your_file_field->location
$entry->your_file_field->uploaded_by_member_id
$entry->your_file_field->upload_date
$entry->your_file_field->modified_by_member_id
$entry->your_file_field->modified_date
$entry->your_file_field->file_hw_original

```

```
echo '';

```

### Date

[](#date)

Date fields will be a single [`Carbon` object](https://github.com/briannesbitt/Carbon).

```
echo $entry->your_date_field->format('Y-m-d H:i:s');

```

### Multiselect, Checkboxes, Fieldpack Multiselect, Fieldpack Checkboxes &amp; Fieldpack List

[](#multiselect-checkboxes-fieldpack-multiselect-fieldpack-checkboxes--fieldpack-list)

These fields will be arrays of values:

```
foreach ($entry->your_multiselect_field as $value) {
    echo $value;
}

```

Extending the `BasePlugin` class
--------------------------------

[](#extending-the-baseplugin-class)

The abstract `rsanchez\Deep\Plugin\BasePlugin` class is provided as a base for ExpressionEngine modules and plugins. The `parseEntries` method parses a template using an `EntryCollection`.

### Entries

[](#entries)

```
