Problem in retriveing data using cakephp 4

Good evening to all.
I am newly using a new version of CakePHP strawberry.

I have two tables (Categories and Products).
The categories has many prodoucts and products belongs to one category
I define the relation betwwen them like this
$this->belongsTo(‘Categories’);
$this->hasMany(‘Products’)->setForeignKey(‘category_id’)->setDependent(true);

The question I need to view all categories name inside the index of products like this
product id / product name / category name

in previous version that i use the behviours {Containable}
in this version i use like this
$this->paginate = [

        'contain' => ['Categories'],

    ];

and I use to like this

$this->Products->find(‘all’)->leftJoinWith(‘Categories’);
but unfortunetly no way works with me

Any suggestions for that .Thank you

What version were you using before? And what does “no way works” mean? Do you get no products? Products with no categories? Duplicated products? Also, please expand your code around the “find” you’re using to show a bit more context about what happens with the result of that call.