PHPackages                             jbernavaprah/eloquent-binary-cast - 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. jbernavaprah/eloquent-binary-cast

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

jbernavaprah/eloquent-binary-cast
=================================

Cast correctly binary data (mainly for PostgreSQL)

39153PHP

Since May 22Pushed 4y ago2 watchersCompare

[ Source](https://github.com/jBernavaPrah/eloquent-binary-cast)[ Packagist](https://packagist.org/packages/jbernavaprah/eloquent-binary-cast)[ RSS](/packages/jbernavaprah-eloquent-binary-cast/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Eloquent Binary Cast
====================

[](#eloquent-binary-cast)

The Eloquent Binary Cast.

When using the PostgreSQL dialectic, Eloquent treat the "bytea" column in the same manner as blob/text column. But this is incorrect on PostgreSQL. The value needs to be cast before pushed to the database.

If you are not using Postgresql, you don't need this cast class.

See those issues:

- [laravel/framework#10847](https://github.com/laravel/framework/issues/10847)
-
-

Prerequisites:
--------------

[](#prerequisites)

- PostgreSQL 9.0 or later.
- Eloquent 8 or later.

Install:
--------

[](#install)

```
composer require jbernavaprah/eloquent-binary-cast
```

Use:
----

[](#use)

```
