Comments (9)
once I started debugging I saw the problem, looks like there's an endless loop, not sure why it happens yet. The following lines are repeated:
[Mon Sep 07 11:37:52 2015] PHP 119. NilPortugues\Serializer\Serializer->serializeData() /home/remo/jsonapi1/vendor\nilportugues/serializer/src/Serializer.php:469
[Mon Sep 07 11:37:52 2015] PHP 120. NilPortugues\Serializer\DeepCopySerializer->serializeObject() /home/remo/jsonapi1/vendor/nilportugues/serializer/src\Serializer.php:146
[Mon Sep 07 11:37:52 2015] PHP 121. NilPortugues\Serializer\Serializer->serializeInternalClass() /home/remo/jsonapi1/vendor/nilportugues/serializer/src\DeepCopySerializer.php:34
from laravel5-jsonapi.
Could you provide an example? I'll look into it...
from laravel5-jsonapi.
Seems to be failing because it cannot retrieve class properties from internal class... so question is, what's the internal class being used? If it's a special case, I should write its own serializer.
from laravel5-jsonapi.
I'm using the current laravel version and a super simple class:
namespace Ortic\Models;
class Post extends Model {
}
and in my controller:
$posts = $this->post->all();
//$posts = $this->post->find(1, ['id']);
$transformer = $this->serializer->getTransformer();
$transformer->setSelfUrl(route('posts.index', []));
$response = $this->response($this->serializer->serialize($posts));
return $response;
and my config:
<?php
return [
[
'class' => 'OrticDb\Models\Post',
'alias' => '',
'aliased_properties' => [
],
'hide_properties' => [
],
'id_properties' => [
'id',
],
'urls' => [
'self' => 'posts.index',
],
],
];
from laravel5-jsonapi.
Laravel Models out of the box use __get(), meaning properties are magic. I see the problem.
Should code a special case for theIlluminate\Database\Eloquent\Model
class, indeed.
I'll treat this as a bug.
from laravel5-jsonapi.
Alright I've done some small testing and if nothing goes wrong this fix should up and ready today/tomorrow 👍
from laravel5-jsonapi.
@Remo you'll love this: https://github.com/nilportugues/laravel5-jsonapi-transformer/releases/tag/1.2.0
Thanks once again :) 👍
from laravel5-jsonapi.
You're fast, awesome! I'll continue my tests, thanks!
from laravel5-jsonapi.
@Remo let me know how it goes :)
from laravel5-jsonapi.
Related Issues (20)
- Formatting date on models to ISO 8601 gives error HOT 2
- Abandonware (NOT) HOT 3
- getAliasedProperties() and getHideProperties() are ignored in relationships
- Can't add fields to getRequiredProperties()
- Where can i specify the default page[size] ?
- Slow request on resource with alot of relationship items even if the relationship is not included
- Adding required attribute. Causes an error HOT 1
- Not compatible with nilportugues/api-transformer anymore.
- Multiplay connection and Lumen 5.4 support?
- Authorizer runs before Validator, exposes runtime error risk
- Laravel 5.2 - "Argument 1 passed to MappingFactory::fromArray() must be of the type array, string given" HOT 1
- Can't create or update
- Laravel 5.3 & 5.4 Support HOT 3
- [Deleted issue]
- is there any example for Lumen ?
- getAliasProperties are not working for included relationships
- Laravel Passport Compatibility
- Polymorphic models
- Maintenance
- Make compatible with Laravel 6.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel5-jsonapi.