Category : php

In the valet documentation. Valet support symfony framework. In my setup of my directory ~Sites/sampleSymp I successfully see the page when I use this url http:sampleSymp.test, but when I try to connect the api http:sampleSymp.test/api/v1/devices. I get this error syntax error, unexpected ‘ObjectManager’ (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) I also check their documentation ..

Read more

I tried for hours to understand relationship in Schema Generator Component, I read the documentation but I’m stuck with the poor details about field cardinality, forcing a relation table name, mappedBy and inversedBy attributes from Full Configuration Reference I’m just trying to generate two entities with a ManyToMany doctrine relationship. The two objects in my ..

Read more

In a Symfony 5.3 Application I want to implement a simple password change form. In the controller method managing the process I inject UserPasswordHasherInterface and get the password from the form. Something like this: public function userChangePassword( Request $request, UserPasswordHasherInterface $passwordHasher ): Response { $user = $this->getUser(); $userChangePasswordForm = $this->createForm( UserChangePasswordType::class, $user ); $userChangePasswordForm->handleRequest( $request ..

Read more

Some time ago everythig works fine, but after rebuild my image I faced with error composer json "require-dev": { "dbrekelmans/bdi": "^0.3.0", "symfony/panther": "^1.1", [email protected]:/auth_service# /usr/lib/chromium/chrome –version bash: /usr/lib/chromium/chrome: No such file or directory [email protected]:/auth_service# /usr/lib/chromium/ chrome-sandbox chromium locales/ [email protected]:/auth_service# /usr/lib/chromium/chrom chrome-sandbox chromium [email protected]:/auth_service# /usr/lib/chromium/chromium –version Chromium 90.0.4430.212 [email protected]:/auth_service# /usr/bin/chromedriver -v ChromeDriver 90.0.4430.212 (e3cd97fc771b893b7fd1879196d1215b622c2bed-refs/branch-heads/[email protected]{#1429}) [email protected]:/auth_service# drivers/chromedriver ..

Read more

I want to match all paths for a specific host and redirect to a new one: redirect_from_host: path: /{uri}/ host: www.my-old-domain.com defaults: _controller: FrameworkBundle:Redirect:urlRedirect path: https://www.my-new-domain.com permanent: true This works for URL’s like www.my-old-domain.com/foo/ but doesn’t with: www.my-old-domain.com/foo/bar/ So I have to add more routing definitions like: redirect_from_host_2: path: /{uri}/{uri2}/ host: www.my-old-domain.com defaults: _controller: FrameworkBundle:Redirect:urlRedirect ..

Read more

I generated the user registration code with the symfony console make:registration command. But when I fill out the Registration form, and submit, var_dump($ form->isSubmitted()) always shows false, so I fail to actually create the users. What can explain this? How to correct? This is the generated controller file: #[Route(‘/register’, name: ‘app_register’)] public function register(Request $request, ..

Read more

After creating a user I want to make functionality to update email/ canonical email of the other accounts. I’m trying to update using: $user = $this->fosUserManager->findUserBy(["id" => $id]); $user->setEmail($content->email); $this->fosUserManager->updateUser($user); But this is not updating correctly. Is there any other way this can be done. Preferably by using the api platform itself. Thanks and Regards ..

Read more