Answer the question
In order to leave comments, you need to log in
Why 2 different entries belongsToMany(Tag::class) and belongsToMany('App\Tag') if the result is identical?
It seems to work fine with both entries, in one option we specify the class, and in the other through the class path. I do not see the difference, how best to record?
Answer the question
In order to leave comments, you need to log in
I propose to get acquainted with the language, more specifically with php version 5.5: php.net/manual/en/language.oop5.basic.php
Everything is obvious. If you use namespaces (and you do), it's more convenient to specify the class name without a namespace.
If you have a model in the namespace `Very\Super\Long\Name\Spa\ce\` then which entry will be shorter (do not forget to add a class to the "use" section if required):
belongsToMany( Tag::class )or
belongsToMany( 'Very\Super\Long\Name\Spa\ce\Tag' )?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question