PHP Reddit – Telegram
PHP Reddit
34 subscribers
289 photos
37 videos
24.8K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
Laravel Sanctum SPA Auth Flow with Bruno (Postman alternative)

Hey everyone,

I previously shared a Postman-based Laravel Sanctum auth setup, and a lot of you commented that Postman is dead — especially after the recent issue where it was found sending secret values to their analytics servers.

🔗 https://anonymousdata.medium.com/postman-is-logging-all-your-secrets-and-environment-variables-9c316e92d424

So, I rebuilt the whole flow using Bruno — an open-source, local-first API client.

🔗 New repo: https://github.com/maikeru-desu/laravel-sanctum-bruno-authentication

This guide walks through the typical SPA auth setup:

CSRF cookie flow
Login with XSRF protection
Testing protected routes
Reusable pre-request noscripts

If you’re building a Laravel SPA and want to test it properly without leaking anything, this should be a good fit.

Star it if it helps you out — or just like it so others can find it too.

https://redd.it/1mapj37
@r_php
Weekly /r/Laravel Help Thread

Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:

What steps have you taken so far?
What have you tried from the documentation?
Did you provide any error messages you are getting?
Are you able to provide instructions to replicate the issue?
Did you provide a code example?
Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.

For more immediate support, you can ask in the official Laravel Discord.

Thanks and welcome to the r/Laravel community!

https://redd.it/1margw0
@r_php
Any of you do event sourcing with symfony ?

I recently (well, I’ve been working on it for a year) learned event sourcing. As a result, I created my own event sourcing framework called FluxCapacitor.

It’s GDPR compliant, as I encrypt data with personalData attributes in my domain events and decrypt it when rebuilding my aggregates. If I could find some people who know the subject to check my repository and provide feedback on my implementation, that would be amazing .

Here’s my GitHub: https://github.com/GremaudMatthieu/budget .
You can find the Symfony project in the backend folder. My event sourcing framework is in the libraries folder, and you can see how I implement it in the rest of the project! Thank you for your time! I look forward to your feedbacks!

https://redd.it/1mauic7
@r_php
Why Use Livewire or Filament?

Hey everyone,

I recently looked into some benchmarks, and the numbers are pretty eye-opening. When it comes to Time to Interactive (TTI), memory usage, and concurrent user capacity, Livewire and Filament consistently lag behind more traditional or decoupled approaches.

Here's a quick rundown of what I found:

Time to Interactive (TTI)

Laravel Blade: 200-500ms
Laravel + Inertia + Vue: 1-3s
Laravel Filament: 2-8s (can reach 10-18s with issues)
Laravel API + SPA: 3-10s (initial load)

Memory Usage (server)

Laravel Blade: 32-64MB per request
Laravel + Inertia + Vue: 64-128MB per request
Laravel Filament: 128-256MB per request
Laravel API + SPA: 16-32MB per request

Concurrent Users Capacity

Laravel Blade: 500-1000+ users
Laravel + Inertia + Vue: 300-600 users
Laravel Filament: 100-300 users
Laravel API + SPA: 1000+ users

While the development speed of these tools is attractive, are we sacrificing too much in terms of user experience and scalability? For projects where performance is a key metric, it seems like Laravel Blade or a Laravel API + SPA setup still offer significant advantages.

What are your thoughts? Has anyone else experienced similar performance bottlenecks with Livewire or Filament in production, or found effective ways to mitigate them?

Let's discuss!

https://redd.it/1mawpx7
@r_php
Weekly Ask Anything Thread

Feel free to ask any questions you think may not warrant a post. Asking for help here is also fine.

https://redd.it/1mb5gnv
@r_php
Weekly help thread

Hey there!

This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!

https://redd.it/1mb8dod
@r_php
43 stars on my Laravel Chat package!

Just got my 43rd star for Le Chat \- my Laravel chat package!


Thank you to the community!

https://redd.it/1mb9lgd
@r_php
PHP is evolving, but every developer has complaints. What's on your wishlist?

PHP continues to rule the web in 2025 (holding about 75% of the market), and has been developing actively lately, keeping up with the competition. Things are pretty good today, but there are drawbacks. I'm sure every PHP developer has some things that don't satisfy them and they would like to see fixed.

For example, I don't really like the official PHP website. It looks like it's stuck in the early 2000s. Minimalism is one thing, but outdated design, inconvenient navigation and lack of modern features make it irrelevant for newcomers.

But the most important thing - newcomers don't understand where to start at all! You go to the "Download" section - there's a bunch of strange archives, versions, in the documentation there are big pages of text, but where's the quick guide? Where are the examples? Where's the ecosystem explanation? A person just wants to try PHP, but gets a "figure it out yourself" quest. This scares people away from the language! Imagine a modern website with:

* Clear getting started for beginners
* Convenient documentation navigation
* "Ecosystem" section with tools, frameworks, etc.

What's your main idea? Bold suggestions are welcome - strict typing by default, built-in asynchronicity? Let's brainstorm and maybe PHP core developers will notice the post and take it into consideration!

https://redd.it/1mbaeo9
@r_php
v0.5 - Powerful And API-Ready AI Agents For Laravel

LarAgent v0.5 released!

Now you can:

* Expose agents via API, compatible with OpenAI, connect your Agent to any OpenAI client - easily ,
* Multimodal inputs, send messages now with Audio ,
* Send ready UserMessage instance instead of text messages,
* Receive MessageInterface instance instead of string/array (Using returnMessage()),
* Use Groq as your LLM provider,
* Choose tool handling strategy: none, required, forced,
* Use PhantomTool to handle tool execution outside of LarAgent


Check the summary of new features and changes here: [https://blog.laragent.ai/laragent-v0-5-powerful-and-api-ready-ai-agents-for-laravel/](https://blog.laragent.ai/laragent-v0-5-powerful-and-api-ready-ai-agents-for-laravel/)

https://redd.it/1mbfk64
@r_php
Strict comparison with null instead of boolean check, just style or are there other reasons?

In many projects, especially symfony, you will find null checks written like this:
function my_func(?string $nullable = null) {
if (null === $nullable) {
// Do stuff when string is null
}
}


But I would normally just write:
// ...
if (!$nullable) {
// Do stuff when string is null
}



Are there specific reasons not to use the second variant?
Is this style a fragment from the past where type hints were not yet fully supported?

https://redd.it/1mbiq8q
@r_php
Troubles with DataFixtures references

Hi everyone !

I'm currently struggling with some problems related to DataFixtures' references.

I've got two fixtures, CategoryFixtures and ProductFixtures. So the ProductFixtures is depending on CategoryFixtures since every Product entity need a Category.

Here's the code of the fixtures below.

- CategoryFixtures
<?php

namespace App\DataFixtures;

use App\Entity\Category;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Persistence\ObjectManager;
use Symfony\Component\String\Slugger\SluggerInterface;

class CategoryFixtures extends Fixture
{
private int $count = 1;
public static array $non_parent = [];

public function __construct(private SluggerInterface $slugger){}

public function createCategoryFixtures(
string $name,
Category|null $parent = null,
ObjectManager $manager
) : Category {
$category = new Category();
$category
->setName($name)
->setSlug($this->slugger->slug($category->getName())->lower())
->setParent($parent)
->setSortOrder($this->count)
;
$manager->persist($category);
$this->addReference('cat-'.$this->count, $category);
if($parent != null){
self::$non_parent[] = $this->count;
};
$this->count++;
return $category;
}

public function load(ObjectManager $manager): void
{
# First fake category
$parent = $this->createCategoryFixtures('Boulangerie', null, $manager);
$this->createCategoryFixtures('Pâtisserie', $parent, $manager);
$this->createCategoryFixtures('Viennoiseries', $parent, $manager);

# Second fake category
$parent2 = $this->createCategoryFixtures('Informatique', null, $manager);
$this->createCategoryFixtures('Écran', $parent2, $manager);
$this->createCategoryFixtures('Ordinateur', $parent2, $manager);
$this->createCategoryFixtures('Souris', $parent2, $manager);

# Third fake category
$parent3 = $this->createCategoryFixtures('Vêtements', null, $manager);
$this->createCategoryFixtures('Maillot', $parent3, $manager);
$this->createCategoryFixtures('Pantalon', $parent3, $manager);
$this->createCategoryFixtures('Veste', $parent3, $manager);

# Flush all fake categories
$manager->flush();
}
}


- ProductFixtures :
<?php

namespace App\DataFixtures;

use App\Entity\Product;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Symfony\Component\String\Slugger\SluggerInterface;
use Faker;

class ProductFixtures extends Fixture implements DependentFixtureInterface
{
public const int PRODUCT_COUNT = 20;

public function __construct(private SluggerInterface $slugger){}

public function getDependencies() : array {return [CategoryFixtures::class];}

public function load(ObjectManager $manager): void
{
$faker = Faker\Factory::create('fr_FR');
for($i = 0; $i < self::PRODUCT_COUNT; $i++){
$product = new Product;
$product
->setName($faker->text(15))
->setDenoscription($faker->text())
->setSlug($this->slugger->slug($product->getName())->lower())
->setPrice($faker->numberBetween(500, 70000)) //Price displayed in cents.
->setStock($faker->numberBetween(0, 2000))
;
$category = $this->getReference(
'cat-'.CategoryFixtures::$non_parent[
rand(0, count(CategoryFixtures::$non_parent) - 1)
],
CategoryFixtures::class
);
$product->setCategory($category);
$this->setReference('prod-'.$i, $product);
$manager->persist($product);
};
$manager->flush();
}
}


So the problem I've got is that this error always happen when I try to load
Troubles with DataFixtures references

Hi everyone !

I'm currently struggling with some problems related to DataFixtures' references.

I've got two fixtures, CategoryFixtures and ProductFixtures. So the ProductFixtures is depending on CategoryFixtures since every Product entity need a Category.

Here's the code of the fixtures below.

- CategoryFixtures
```php
<?php

namespace App\DataFixtures;

use App\Entity\Category;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Persistence\ObjectManager;
use Symfony\Component\String\Slugger\SluggerInterface;

class CategoryFixtures extends Fixture
{
private int $count = 1;
public static array $non_parent = [];

public function __construct(private SluggerInterface $slugger){}

public function createCategoryFixtures(
string $name,
Category|null $parent = null,
ObjectManager $manager
) : Category {
$category = new Category();
$category
->setName($name)
->setSlug($this->slugger->slug($category->getName())->lower())
->setParent($parent)
->setSortOrder($this->count)
;
$manager->persist($category);
$this->addReference('cat-'.$this->count, $category);
if($parent != null){
self::$non_parent[] = $this->count;
};
$this->count++;
return $category;
}

public function load(ObjectManager $manager): void
{
# First fake category
$parent = $this->createCategoryFixtures('Boulangerie', null, $manager);
$this->createCategoryFixtures('Pâtisserie', $parent, $manager);
$this->createCategoryFixtures('Viennoiseries', $parent, $manager);

# Second fake category
$parent2 = $this->createCategoryFixtures('Informatique', null, $manager);
$this->createCategoryFixtures('Écran', $parent2, $manager);
$this->createCategoryFixtures('Ordinateur', $parent2, $manager);
$this->createCategoryFixtures('Souris', $parent2, $manager);

# Third fake category
$parent3 = $this->createCategoryFixtures('Vêtements', null, $manager);
$this->createCategoryFixtures('Maillot', $parent3, $manager);
$this->createCategoryFixtures('Pantalon', $parent3, $manager);
$this->createCategoryFixtures('Veste', $parent3, $manager);

# Flush all fake categories
$manager->flush();
}
}
```

- ProductFixtures :
```php
<?php

namespace App\DataFixtures;

use App\Entity\Product;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Symfony\Component\String\Slugger\SluggerInterface;
use Faker;

class ProductFixtures extends Fixture implements DependentFixtureInterface
{
public const int PRODUCT_COUNT = 20;

public function __construct(private SluggerInterface $slugger){}

public function getDependencies() : array {return [CategoryFixtures::class];}

public function load(ObjectManager $manager): void
{
$faker = Faker\Factory::create('fr_FR');
for($i = 0; $i < self::PRODUCT_COUNT; $i++){
$product = new Product;
$product
->setName($faker->text(15))
->setDenoscription($faker->text())
->setSlug($this->slugger->slug($product->getName())->lower())
->setPrice($faker->numberBetween(500, 70000)) //Price displayed in cents.
->setStock($faker->numberBetween(0, 2000))
;
$category = $this->getReference(
'cat-'.CategoryFixtures::$non_parent[
rand(0, count(CategoryFixtures::$non_parent) - 1)
],
CategoryFixtures::class
);
$product->setCategory($category);
$this->setReference('prod-'.$i, $product);
$manager->persist($product);
};
$manager->flush();
}
}
```

So the problem I've got is that this error always happen when I try to load
the fixtures using the command `symfony console doctrine:fixture:load`. :
> Reference to "cat-10" for class "App\DataFixtures\CategoryFixtures" does not exist
> Reference to "cat-11" for class "App\DataFixtures\CategoryFixtures" does not exist
> Reference to "cat-6" for class "App\DataFixtures\CategoryFixtures" does not exist

I tried to add a `dd($this)` at the end of the CategoryFixtures, and here's what I've got. :
```fix
^ App\DataFixtures\CategoryFixtures^ {#6546
#referenceRepository: Doctrine\Common\DataFixtures\ReferenceRepository^ {#5853
-referencesByClass: array:1 [
"App\Entity\Category" => array:11 [
"cat-1" => App\Entity\Category^ {#7128
-id: 122
-name: "Boulangerie"
-sort_order: 1
-parent: null
-categories: Doctrine\ORM\PersistentCollection^ {#5790
#collection: Doctrine\Common\Collections\ArrayCollection^ {#2166
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#7128}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#6521 …}
-backRefFieldName: "parent"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#6762 …}
}
-products: Doctrine\ORM\PersistentCollection^ {#386
#collection: Doctrine\Common\Collections\ArrayCollection^ {#6652
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#7128}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#3106 …}
-backRefFieldName: "category"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#7051 …}
}
-slug: "boulangerie"
}
"cat-2" => App\Entity\Category^ {#7702
-id: 123
-name: "Pâtisserie"
-sort_order: 2
-parent: App\Entity\Category^ {#7128}
-categories: Doctrine\ORM\PersistentCollection^ {#6399
#collection: Doctrine\Common\Collections\ArrayCollection^ {#7685
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#7702}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#6521 …}
-backRefFieldName: "parent"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#6762 …}
}
-products: Doctrine\ORM\PersistentCollection^ {#1396
#collection: Doctrine\Common\Collections\ArrayCollection^ {#6876
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#7702}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#3106 …}
-backRefFieldName: "category"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#7051 …}
}
-slug: "patisserie"
}
"cat-3" => App\Entity\Category^ {#6669
-id: 124
-name: "Viennoiseries"
-sort_order: 3
-parent: App\Entity\Category^ {#7128}
-categories: Doctrine\ORM\PersistentCollection^ {#5205
#collection: Doctrine\Common\Collections\ArrayCollection^ {#6643
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#6669}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#6521 …}
-backRefFieldName: "parent"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#6762 …}
}
-products: Doctrine\ORM\PersistentCollection^ {#1653
#collection: Doctrine\Common\Collections\ArrayCollection^ {#7725
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#6669}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#3106 …}
-backRefFieldName: "category"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#7051 …}
}
-slug: "viennoiseries"
}
"cat-4" => App\Entity\Category^ {#1013
-id: 125
-name: "Informatique"
-sort_order: 4
-parent: null
-categories: Doctrine\ORM\PersistentCollection^ {#3755
#collection: Doctrine\Common\Collections\ArrayCollection^ {#1983
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#1013}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#6521 …}
-backRefFieldName: "parent"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#6762 …}
}
-products: Doctrine\ORM\PersistentCollection^ {#7709
#collection: Doctrine\Common\Collections\ArrayCollection^ {#3777
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#1013}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#3106 …}
-backRefFieldName: "category"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#7051 …}
}
-slug: "informatique"
}
"cat-5" => App\Entity\Category^ {#6823
-id: 126
-name: "Écran"
-sort_order: 5
-parent: App\Entity\Category^ {#1013}
-categories: Doctrine\ORM\PersistentCollection^ {#7677
#collection: Doctrine\Common\Collections\ArrayCollection^ {#2904
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#6823}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#6521 …}
-backRefFieldName: "parent"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#6762 …}
}
-products: Doctrine\ORM\PersistentCollection^ {#7683
#collection: Doctrine\Common\Collections\ArrayCollection^ {#6435
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#6823}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#3106 …}
-backRefFieldName: "category"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#7051 …}
}
-slug: "ecran"
}
"cat-6" => App\Entity\Category^ {#2131
-id: 127
-name: "Ordinateur"
-sort_order: 6
-parent: App\Entity\Category^ {#1013}
-categories: Doctrine\ORM\PersistentCollection^ {#7681
#collection: Doctrine\Common\Collections\ArrayCollection^ {#6814
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#2131}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#6521 …}
-backRefFieldName: "parent"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#6762 …}
}
-products: Doctrine\ORM\PersistentCollection^ {#7684
#collection: Doctrine\Common\Collections\ArrayCollection^ {#5216
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#2131}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#3106 …}
-backRefFieldName: "category"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#7051 …}
}
-slug: "ordinateur"
}
"cat-7" => App\Entity\Category^ {#6523
-id: 128
-name: "Souris"
-sort_order: 7
-parent: App\Entity\Category^ {#1013}
-categories: Doctrine\ORM\PersistentCollection^ {#7660
#collection: Doctrine\Common\Collections\ArrayCollection^ {#6629
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#6523}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#6521 …}
-backRefFieldName: "parent"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#6762 …}
}
-products: Doctrine\ORM\PersistentCollection^ {#7378
#collection: Doctrine\Common\Collections\ArrayCollection^ {#6547
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#6523}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#3106 …}
-backRefFieldName: "category"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#7051 …}
}
-slug: "souris"
}
"cat-8" => App\Entity\Category^ {#2501
-id: 129
-name: "Vêtements"
-sort_order: 8
-parent: null
-categories: Doctrine\ORM\PersistentCollection^ {#7661
#collection: Doctrine\Common\Collections\ArrayCollection^ {#1016
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#2501}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#6521 …}
-backRefFieldName: "parent"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#6762 …}
}
-products: Doctrine\ORM\PersistentCollection^ {#7636
#collection: Doctrine\Common\Collections\ArrayCollection^ {#6712
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#2501}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#3106 …}
-backRefFieldName: "category"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#7051 …}
}
-slug: "vetements"
}
"cat-9" => App\Entity\Category^ {#2669
-id: 130
-name: "Maillot"
-sort_order: 9
-parent: App\Entity\Category^ {#2501}
-categories: Doctrine\ORM\PersistentCollection^ {#7589
#collection: Doctrine\Common\Collections\ArrayCollection^ {#6392
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#2669}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#6521 …}
-backRefFieldName: "parent"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#6762 …}
}
-products:
Doctrine\ORM\PersistentCollection^ {#7691
#collection: Doctrine\Common\Collections\ArrayCollection^ {#4078
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#2669}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#3106 …}
-backRefFieldName: "category"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#7051 …}
}
-slug: "maillot"
}
"cat-10" => App\Entity\Category^ {#6499
-id: 131
-name: "Pantalon"
-sort_order: 10
-parent: App\Entity\Category^ {#2501}
-categories: Doctrine\ORM\PersistentCollection^ {#7694
#collection: Doctrine\Common\Collections\ArrayCollection^ {#1962
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#6499}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#6521 …}
-backRefFieldName: "parent"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#6762 …}
}
-products: Doctrine\ORM\PersistentCollection^ {#7697
#collection: Doctrine\Common\Collections\ArrayCollection^ {#1998
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#6499}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#3106 …}
-backRefFieldName: "category"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#7051 …}
}
-slug: "pantalon"
}
"cat-11" => App\Entity\Category^ {#6217
-id: 132
-name: "Veste"
-sort_order: 11
-parent: App\Entity\Category^ {#2501}
-categories: Doctrine\ORM\PersistentCollection^ {#7706
#collection: Doctrine\Common\Collections\ArrayCollection^ {#786
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#6217}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#6521 …}
-backRefFieldName: "parent"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#6762 …}
}
-products: Doctrine\ORM\PersistentCollection^ {#7614
#collection: Doctrine\Common\Collections\ArrayCollection^ {#1987
-elements: []
}
#initialized: true
-snapshot: []
-owner: App\Entity\Category^ {#6217}
-association: Doctrine\ORM\Mapping\OneToManyAssociationMapping {#3106 …}
-backRefFieldName: "category"
-isDirty: false
-em: Doctrine\ORM\EntityManager^ {#3210 …11}
-typeClass: Doctrine\ORM\Mapping\ClassMetadata {#7051 …}
}
-slug: "veste"
}
]
]
-identitiesByClass: array:1 [
"App\Entity\Category" => array:11 [
"cat-1" => array:1 [
"id" => 122
]
"cat-2" => array:1 [
"id" => 123
]
"cat-3" => array:1 [
"id" => 124
]
"cat-4" => array:1 [
"id" => 125
]
"cat-5" => array:1 [
"id" => 126
]
"cat-6" => array:1 [
"id" => 127
]
"cat-7" => array:1 [
"id" => 128
]
"cat-8" => array:1 [
"id" => 129
]
"cat-9" => array:1 [
"id" => 130
]
"cat-10" => array:1 [
"id" => 131
]
"cat-11" => array:1 [
"id" => 132
]
]
]
-manager: Doctrine\ORM\EntityManager^ {#3210 …11}
}
-count: 12
-slugger: Symfony\Component\String\Slugger\AsciiSlugger^ {#1487
-symbolsMap: array:1 [
"en" => array:2 [
"@" => "at"
"&" => "and"
]
]
-emoji: false
-transliterators: array:1 [
"en" => null
]
-defaultLocale: "en"
}
}
```

So the references seems to be OK. But I get that error again when I try a `dd($this->getReference('cat-10', self::class));` instead. :
> Reference to "cat-10" for class "App\DataFixtures\CategoryFixtures" does not exist

So I can't figure out what the \*\*\*\* is going on, and it's been two whole weeks I keep getting stuck with this problem because I cannot find any help anywhere else on the internet.

If someone has any information or solution, thanks in advance !

https://redd.it/1mbtoj3
@r_php