1016 search results for API Platform

... some general things from, but it's starting to show its age. Our much newer tutorial about API Platform is another great option and can get you set up faster. Though, this tutorial teaches you many "lower-level" things ...
weaverryan
weaverryan
Read Full Comment
I really really like symfony and api platform. But i have a weird challenge. (i've never installed anything on a linux machine before, so bear with me please AND i am a newbie to symfony 4). We have a new Azure server ...
... //.enableIntegrityHashes() // uncomment if you're having problems with a jQuery plugin //.autoProvidejQuery() // uncomment if you use API Platform Admin (composer req api-admin) //.enableReactPreset ...
Jean-tilapin
Jean-tilapin
Read Full Comment
75 lines | webpack.config.js
var Encore = require('@symfony/webpack-encore');
// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
// directory where compiled assets will be stored
.setOutputPath('public/build/')
// public path used by the web server to access the output path
.setPublicPath('/build')
// only needed for CDN's or sub-directory deploy
//.setManifestKeyPrefix('build/')
/*
* ENTRY CONFIG
*
* Add 1 entry for each "page" of your app
* (including one that's included on every page - e.g. "app")
*
* Each entry will result in one JavaScript file (e.g. app.js)
* and one CSS file (e.g. app.css) if your JavaScript imports CSS.
*/
.addEntry('app', './assets/js/app.js')
//.addEntry('page1', './assets/js/page1.js')
//.addEntry('page2', './assets/js/page2.js')
// When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
.splitEntryChunks()
// will require an extra script tag for runtime.js
// but, you probably want this, unless you're building a single-page app
.enableSingleRuntimeChunk()
/*
* FEATURE CONFIG
*
* Enable & configure other features below. For a full
* list of features, see:
* https://symfony.com/doc/current/frontend.html#adding-more-features
*/
.cleanupOutputBeforeBuild()
.enableBuildNotifications()
.enableSourceMaps(!Encore.isProduction())
// enables hashed filenames (e.g. app.abc123.css)
.enableVersioning(Encore.isProduction())
// enables @babel/preset-env polyfills
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = 3;
})
// enables Sass/SCSS support
//.enableSassLoader()
// uncomment if you use TypeScript
//.enableTypeScriptLoader()
// uncomment to get integrity="..." attributes on your script & link tags
// requires WebpackEncoreBundle 1.4 or higher
//.enableIntegrityHashes(Encore.isProduction())
// uncomment if you're having problems with a jQuery plugin
//.autoProvidejQuery()
// uncomment if you use API Platform Admin (composer req api-admin)
//.enableReactPreset()
//.addEntry('admin', './assets/js/admin.js')
;
module.exports = Encore.getWebpackConfig();
See Code Block in Script
Provider Transforming Entities to DTOs

... $entities variable is actually a Pagination object. Now that we're just returning an array, it makes API Platform think that we don't support pagination. The solution is dead-simple. Instead of returning $dtos, return new ...

4:47
DTO Class Organization

It took some work - especially getting the update to work before API Platform 2.6 - but our input & output DTO system is alive! Though... our logic for converting from CheeseListing to input, input to CheeseListing and ...

5:12
Input Data Transformer

... isPublished to false in CheeseListingInput: Ok, one more time. And... yes! A 201 status code. It worked! So using a DTO input is a 3-step process. First, API Platform deserializes the JSON we send into a CheeseListingInput ...

4:24
Filter Class Arguments

... $throwOnInvalid API platform does a cool, but kind of strange thing: if you pass an arguments option to a filter, it tries to pass that argument - by name - to the constructor of your filter. Check it out: in DailyStatsDateFilter ...

4:26
Leveraging the Doctrine Data Provider

... getCollection(): it creates a query builder and then loops over something called the "collection extensions". This is the Doctrine extension system in API Platform, and these extensions are actually what is responsible for ...

5:27
Calling the Controller View Event

... extensively inside API Platform. Internally, their controllers return objects. Then, they have a listener - actually a few that work together - that transforms that object into JSON, XML or whatever format the user is ...

5:20
Bootstrapping a Test Suite

... --env=test: Repeat that same thing with the doctrine:schema:create command: Perfect! Next, Api Platform has some really nice testing tools which... aren't released yet. Boo! Well... because I'm impatient, let's backport those new tools into our app and get our first test running.

4:29
... /api_platform/vendor/api-platform/core/src/Bridge/Symfony/Validator/Validator.php", "line": 67, "args": [] }, { "namespace": "ApiPlatform\\Core\\Bridge\\Symfony\\Validator", "short_class ...
Andrew M.
Andrew M.
Read Full Comment
... /container that we've been working with.This means that when your API Platform code runs, it uses the *same* EntityManager as your test. And so, when your API code, for example, queries for the User object, the EntityManager ...
weaverryan
weaverryan
Read Full Comment
OAuth with Facebook

... Facebook uses OAuth 2.0 for their API, so we're already dangerous. And like a lot of sites, they even have a PHP library to help us work with it. Installing it via Composer is easy. In fact, I already added it to our ...

11:28
... . We use it to add custom endpoints from other bundles, or from the auth system, to add it to the OpenApi dump so it's a neat complete documentation, even filled with endpoints and resources that don't come from API platform.
Joris-Mak
Joris-Mak
Read Full Comment
Since I am upgrading an app from 2.6 to 3 right now, I was wondering about a behavior of the serializer that I ovserved. In API-Platform >= 3, the default setting in the api_platform.yaml is ...
TristanoMilano
TristanoMilano
Read Full Comment
... collection automatically so that only some are shown, that's not done directly via `security`. Instead, in chapter 35 (will be released this week - but you can peek at it here https://symfonycasts.com/screencast/api ...
weaverryan
weaverryan
Read Full Comment
... earlier chapter where we even sent a mixture or objects and IRI strings: https://symfonycasts.com/screencast/api-platform/collections-create#sending-embedded-objects-and-iri-strings-at-the-same-time B) We are using the ...
weaverryan
weaverryan
Read Full Comment
I have created a Custom Normalizer in my API Platform 3 (Symfony 6) application. The goal of this normalizer is to modify and add some data to the response before returning it to the user (GET collection request). This ...
Hi Gianluca-F! Ah, apologies for the very slow answer! Hmm. Yes, what you're expecting makes sense to me! However, it's done this way on purpose: API Platform FIRST loads your data, and THEN applies security. My ...
weaverryan
weaverryan
Read Full Comment