Giter VIP home page Giter VIP logo

eloquent-meta's People

Contributors

clin407 avatar dzafel avatar electricjones avatar lukasknuth avatar rezwanul7 avatar stephandesouza avatar vasiliy-bondarenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eloquent-meta's Issues

Migration mislabel

Finally, run the migration php artisan migrate --package="phoenix/eloquentmeta" to create the database table.

Should be:

Finally, run the migration php artisan migrate --package="phoenix/eloquent-meta" to create the database table.

Commands for non-laravel users

Non-laravel users can currently use the package, but not any of the command-line utilities. This should either be described in the docs or a more general command created.

Decoding non-json strings

When storing a string that contains a string like "01.01.1970", the maybeDecode() function returns only the first two sequences, since json_decode() returns no error. The function should also check if the result of json_decode() is an object.

Class 'CreateItemMetaTable' not found on migrate:rollback

I created an Unique Meta Model and Table for my Items model.
I can migrate the models with no problem but when I try to migrate:rollback / migrate:reset I get the next error:
Class 'CreateItemMetaTable' not found.

It ain't fixed with composer dump-autoload, any idea how to fix this?

Laravel 5.0

This is a running list of items that need to be addressed for the upcoming Laravel 5.0 release

  • Create Table Command should autodetect, and/or give the option of where to place the migration file

Issue in laravel 5.4

Following error displays on updatedMeta function.

Type error: Argument 1 passed to Illuminate\Validation\Factory::__construct() must implement interface Illuminate\Contracts\Translation\Translator, instance of Symfony\Component\Translation\Translator given, called in C:\xampp\htdocs\v2.superdash.ca\vendor\phoenix\eloquent-meta\src\Phoenix\EloquentMeta\Meta.php on line 77

Any advice towards resolution?

Nested Meta Data

Does the current release allow nested set of meta data? Or do you plan to release a version with a nested meta data set? It could be useful in a lot of cases, so I am wondering if you are planning to develop this. Thanks!

Can't json_encode Models that use the MetaTrait

I ran across an issue while trying to json_encode() a Model, that used the MetaTrait and included the meta-information in the json. See my StackOverflow question.

Whether the inclusion is done by loading the model ::with("meta"), or by adding the meta-data to the toArray()-method of the model (as I did in the question) doesn't madder.

The json_encode()-function returns false, the json_last_error()-method returns JSON_ERROR_SYNTAX and the json_last_error_msg()-method returns Syntax error (which is weird, since that error can't come up when encoding... trust me, I read the sources...).
Also, Laravel throws the following error (it tries to return the false generated by json_encode):

UnexpectedValueException in Response.php line 403: The Response content must be a string or object implementing __toString(), "boolean" given.

After some testing I found that when I call json_encode($data, JSON_PARTIAL_OUTPUT_ON_ERROR), the returned JSON is complete and valid, which baffled me even more.


I traced the error back to the Helpers.maybeDecode($value)-method:

The current implementation tries to parse the value with json_decode($value) and checks, whether that worked, by checking the json_last_error()-function. The problem is, that this doesn't reset the last error.

When the Helpers.maybeDecode($value)-method is called, while Laravel is encoding the model, and the value it tried to decode was not an valid json (for example, a simple string), the error code is set, causing the json_encode()-function to see it and return null. The problem is with the global nature of the error-variable.

My proposed workaround for this is to reset the json_last_error()-function after checking if decoing worked, and the only way I have found to do this is by decoding something valid (even if it's just an empty array).
I'm going to send a pull-request soon.


Let me know if further information is required!

Laravel 5.5 support

Laravel 5.5 just came out, was testing my app and when running composer update came across this:

Problem 2
    - phoenix/eloquent-meta v1.6.2 requires illuminate/validation 5.4.* -> satisfiable by laravel/framework[v5.4.35], illuminate/validation[v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9].
    - phoenix/eloquent-meta v1.6.1 requires illuminate/translation 5.4.* -> satisfiable by laravel/framework[v5.4.35], illuminate/translation[v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9].
    - phoenix/eloquent-meta v1.6.2 requires illuminate/translation 5.4.* -> satisfiable by laravel/framework[v5.4.35], illuminate/translation[v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9].
    - Can only install one of: laravel/framework[v5.5.0, v5.4.35].```

Using getAllMeta() without fetching metable_id and metable_type

Hi.

Is it possible to remove columns such as metable_id and metable_type during getAllMeta() call? Because I have been trying to return the meta data using a model accessor like so:

    protected $appends = ['meta_data'];

    ....

    public function getMetaDataAttribute(){
        return $this->getAllMeta();
    }

but unfortunately, the metable_id and metable_type is also included, which is totally unnecessary and may be insecure (for some reason).

Sorry for bumping a not-so-updated repo, I like this repo due to stability.

Thanks!

Jan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.