public function joiningTable($related)
{
// The joining table name, by convention, is simply the snake cased models
// sorted alphabetically and concatenated with an underscore, so we can
// just sort the models and join them together to get the table name.
$base = Str::snake(class_basename($this));
$related = Str::snake(class_basename($related));
$models = [$related, $base];
// Now that we have the model names in an array we can just sort them and
// use the implode function to join them together with an underscores,
// which is typically used by convention within the database system.
sort($models);
return strtolower(implode('_', $models));
}