Skip to content

Commit 26dd9bd

Browse files
egyjstaylorotwell
andauthored
[9.x] use Str::of method instead of re-calling Str class multiple… (#44425)
* [9.x] use `Str::of` method instead of re-calling `Str` class multiple times I believe this PR better than before, especially this is a Laravel core method * Update ForeignIdColumnDefinition.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent 7f0bc56 commit 26dd9bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Database/Schema/ForeignIdColumnDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(Blueprint $blueprint, $attributes = [])
3636
*/
3737
public function constrained($table = null, $column = 'id')
3838
{
39-
return $this->references($column)->on($table ?? Str::plural(Str::beforeLast($this->name, '_'.$column)));
39+
return $this->references($column)->on($table ?? Str::of($this->name)->beforeLast('_'.$column)->plural());
4040
}
4141

4242
/**

0 commit comments

Comments
 (0)