Skip to content

Commit 62c7ac0

Browse files
committed
Fix usage populateStub
1 parent 43b8889 commit 62c7ac0

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

src/Migrations/MigrationCreator.php

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,6 @@
66

77
class MigrationCreator extends IlluminateMigrationCreator
88
{
9-
10-
protected $name = null;
11-
12-
/**
13-
* Create a new migration at the given path.
14-
*
15-
* @param string $name
16-
* @param string $path
17-
* @param string|null $table
18-
* @param bool $create
19-
* @return string
20-
*
21-
* @throws \Exception
22-
*/
23-
public function create($name, $path, $table = null, $create = false)
24-
{
25-
$this->name = $name;
26-
return parent::create($name, $path, $table = null, $create = false);
27-
}
28-
299
/**
3010
* Populate the place-holders in the migration stub.
3111
*
@@ -36,13 +16,14 @@ public function create($name, $path, $table = null, $create = false)
3616
*/
3717
protected function populateStub($stub, $label)
3818
{
39-
$stub = str_replace('{{class}}', studly_case($name), $stub);
40-
4119
// Here we will replace the label place-holders with the label specified by
4220
// the developer, which is useful for quickly creating a labels creation
4321
// or update migration from the console instead of typing it manually.
44-
if (!is_null($label)) {
45-
$stub = str_replace('{{label}}', $label, $stub);
22+
if (! is_null($label)) {
23+
$stub = str_replace(
24+
['{{ label }}', '{{label}}'],
25+
$label, $stub
26+
);
4627
}
4728

4829
return $stub;

0 commit comments

Comments
 (0)