You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> In Symfony we use the term “entities”, while the following documentation is mostly for Laravel “models”.
242
+
231
243
Note that in this example, we declared an association using Doctrine only between Employee and Company using a ManyToOne. There is no inverse association hence the use of `toProperty` in the URI Variables definition.
232
244
233
245
The following declares a few subresources: - `/companies/{companyId}/employees/{id}` - get an employee belonging to a company - `/companies/{companyId}/employees` - get the company employee's
@@ -310,7 +322,7 @@ class Company
310
322
}
311
323
```
312
324
313
-
We did not define any Doctrine annotation here and if we want things to work properly with GraphQL, we need to map the `employees` field as a Link to the class `Employee` using the property `company`.
325
+
We did not define any Doctrine or Eloquent annotation here and if we want things to work properly with GraphQL, we need to map the `employees` field as a Link to the class `Employee` using the property `company`.
314
326
315
327
As a general rule, if the property we want to create a link from is in the `fromClass`, use `fromProperty`, if not, use `toProperty`.
316
328
@@ -335,6 +347,9 @@ class Company {
335
347
336
348
## Security
337
349
350
+
> [!WARNING]
351
+
> This is not yet available with Laravel, you're welcome to contribute [on Github](github.com/api-platform/core)
352
+
338
353
In order to use Symfony's built-in security system on subresources the security option of the `Link` attribute can be used.
339
354
340
355
To restrict the access to a subresource based on the parent object simply use the Symfony expression language as you would do normally, with the exception that the name defined in `toProperty` or `fromProperty` is used to access the object.
0 commit comments