laravel-json-api / core Goto Github PK
View Code? Open in Web Editor NEWContracts and support classes for Laravel JSON API packages.
License: MIT License
Contracts and support classes for Laravel JSON API packages.
License: MIT License
At the moment the LaravelJsonApi\Core\Support\Arr
helper forwards static calls through to the Illuminate\Support\Arr
class. This does not work for methods, e.g. forget
, where the array is passed by reference. To fix, we will need to implement these methods on our Arr
class and mark the value as passed by reference: then forward on to the correct method in the Illuminate class.
core/src/Contracts/Auth/Authorizer.php
Line 79 in b8faaca
lets assume we have a companySchema and branchSchema and they have a m-t-m relationship
lets also assume that a user has permission to 'index', 'show', 'showRelationship' of the branchSchema but does not have any permissions to the companySchema using the Authorizer.
if that user used the url: domain.com/api/v1/branches/{branch_id}/companies he will be able to see the data of each company ?
Hey,
Any chance the $fields
property and allFields()
, allAttributes()
, allSortFields()
, and allRelation()
methods could be changed to protected
.
I need to inject some dynamic fields into the Schema
during Server::serving()
, but fields are cached in the Schema
earlier, during routing. Ideally I'd override allFields()
to start caching after the dynamic fields have been injected.
More info: In my application I have a Schema
which represents several user generated content types. This works by setting Schema
s the uriType()
to include a route variable for the type, and url()
to generate the correct URL. The JsonApiResource
s type()
returns a type congruent with the route variable.
I have two issues I'm trying to overcome. The first is the visibility mentioned above, and second I need to get the Spec\ResourceBuilder
and Spec\RelationBuilder
to handle the 'fake' type when given a document. I have something hacky working, but not sure it's the best approach. I'm basically mutating the JSON document just before it's created. Any ideas here would be awesome?
Cheers,
George
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.