easyadmin

EasyAdmin 3: limit data to the logged-in user still shows other data in form dropdowns

試著忘記壹切 提交于 2021-01-28 08:03:55
问题 I'm using Symfony 5. I want every logged in user to have it's own space in EasyAdmin 3, so no user will see records of other users. I store the user with every table in the database. For simple list views, I managed to get this to work using a extension of the AbstractCrudController : <?php namespace App\Controller\Admin; use Doctrine\ORM\QueryBuilder; use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection; use EasyCorp\Bundle\EasyAdminBundle\Collection\FilterCollection; use EasyCorp

How to use Vich uploader with easyAdmin 3 on Symfony 5

守給你的承諾、 提交于 2021-01-21 08:36:52
问题 I've been trying to use VichUploader to upload files on a Symfony project, already using EasyAdmin 3. I've configured everything correctly, but I'm getting this error: The "pieceJointeFile" image field must define the directory where the images are uploaded using the setUploadDir() method. <?php namespace App\Entity; use App\Repository\InventaireRepository; use DateTime; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\HttpFoundation\File\File; use Vich\UploaderBundle\Mapping\Annotation

How to use Vich uploader with easyAdmin 3 on Symfony 5

孤人 提交于 2021-01-21 08:35:32
问题 I've been trying to use VichUploader to upload files on a Symfony project, already using EasyAdmin 3. I've configured everything correctly, but I'm getting this error: The "pieceJointeFile" image field must define the directory where the images are uploaded using the setUploadDir() method. <?php namespace App\Entity; use App\Repository\InventaireRepository; use DateTime; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\HttpFoundation\File\File; use Vich\UploaderBundle\Mapping\Annotation

How to use Vich uploader with easyAdmin 3 on Symfony 5

﹥>﹥吖頭↗ 提交于 2021-01-21 08:34:29
问题 I've been trying to use VichUploader to upload files on a Symfony project, already using EasyAdmin 3. I've configured everything correctly, but I'm getting this error: The "pieceJointeFile" image field must define the directory where the images are uploaded using the setUploadDir() method. <?php namespace App\Entity; use App\Repository\InventaireRepository; use DateTime; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\HttpFoundation\File\File; use Vich\UploaderBundle\Mapping\Annotation

symfony easyadmin new articles are submitted and stored but not the author_id

可紊 提交于 2019-12-25 03:24:51
问题 I'm trying since several days to find out how to ask to easyadmin to store the author_id (or user_id to be specific), but I can't find by myself. Basicly, by using the createListQueryBuilder function in a specific controller to override the easyadmin controller, I found the way to display for each logged user, the articles they created. Now I'm locked since several days as i dont know how to tell to easyadmin to store the currently logged author_id (or user_id),the solution is to get the

add a virtual property in easy-admin bundle

删除回忆录丶 提交于 2019-12-25 00:22:18
问题 I'm currently working with the 2.3 version of the easy-admin bundle in Symfony 4. I try to create a virtual property for the new view. I have the following configuration #config/packages/easy_admin.yaml easy_admin: entities: Field: class: App\Entity\Field form: fields: - { type: tab, label: initial information, icon: pencil-alt } - name new: fields: - { property: toto, type: file } and my entity file: //src/Entity/Field.php /** * @ORM\Entity(repositoryClass="App\Repository\FieldRepository") *

Symfony 4 EasyAdmin how to encrypt passwords?

混江龙づ霸主 提交于 2019-12-20 01:46:32
问题 I am using EasyAdmin to add/edit users and wanted to ask if there is a possibility of encrypting your passwords? Password encryption worked previously when I used the Symfony 4 make:registration-form but I can't use that now, I have to use EasyAdmin. easy_admin.yaml easy_admin: entities: User: class: App\Entity\User password_encoding: { algorithm: 'bcrypt', cost: 12 } (Actual) I go to EasyAdmin page (/admin), click User, Add User, fill in email (test@gmail.com) and password (test), click Save

symfony easyadmin form field type entity with filter list

旧时模样 提交于 2019-12-13 16:25:15
问题 I use symfony 3.4 and easycorp/easyadmin-bundle 1.17 This is my class "Quotation", the "artisan" field is an "under registration" of the "Person" entity (person.type = 1) : class Quotation { /** others fields... */ /** * 1 => 'artisan', 2 => 'customer' */ private $type; /** * @ORM\ManyToOne(targetEntity="Person", inversedBy="artisanQuotations", cascade= { "persist" }) * @ORM\JoinColumn(name="artisan_id", referencedColumnName="id") */ private $artisan; /** getters and setters ... */ I have a

symfony easyadmin custom form builder

巧了我就是萌 提交于 2019-12-11 15:00:45
问题 I use symfony 3.4 and easycorp/easyadmin-bundle 1.17 Config form easyadmin : form: fields: - { type: 'group', label: 'Basic Information', icon: 'envelope-o', css_class: 'col-sm-8' } - { property: 'title' } - { property: 'status' } - { type: 'group', label: 'Legal Information', icon: 'briefcase', css_class: 'col-sm-4' } - { property: 'pdfFile', type: 'file' } In AdminController : /** * @param $entity * @param $view * @return \Symfony\Component\Form\FormBuilder */ protected function