Skip to content

Commit 293eb78

Browse files
committed
Bump to Laravel 5.5
1 parent 3d122e7 commit 293eb78

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $factory->define(App\User::class, function (Faker\Generator $faker) {
3737
'email' => $faker->safeEmail,
3838
'password' => bcrypt($faker->password),
3939
'company_id' => factory(App\Company::class)->create()->id,
40-
'remember_token' => str_random(10),
40+
'remember_token' => Str::random(10),
4141
];
4242
});
4343
```

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"keywords": ["Laravel", "Tests", "Factory"],
55
"license": "MIT",
66
"require": {
7-
"php": ">=5.6.0",
8-
"illuminate/support": "^5.0",
9-
"illuminate/console": "^5.0",
10-
"illuminate/filesystem": "^5.0",
11-
"symfony/class-loader": "^2.3|3.*",
7+
"php": ">=7.0",
8+
"illuminate/support": "^5.5",
9+
"illuminate/console": "^5.5",
10+
"illuminate/filesystem": "^5.5",
11+
"symfony/class-loader": "~3.3",
1212
"doctrine/dbal": "~2.3"
1313
},
1414
"autoload": {

src/Console/GenerateCommand.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,8 @@ protected function getPropertiesFromMethods($model)
291291
if ($relationObj instanceof Relation) {
292292
$relatedModel = '\\' . get_class($relationObj->getRelated());
293293
$relatedObj = new $relatedModel;
294-
295-
$property = $relationObj->getForeignKey();
296-
$this->setProperty($property,'function () {
297-
return factory('.get_class($relationObj->getRelated()).'::class)->create()->'.$relatedObj->getKeyName().';
298-
}');
294+
$property = $relationObj->getForeignKeyName();
295+
$this->setProperty($property, 'factory(' . get_class($relationObj->getRelated()) . '::class)->create()->' . $relatedObj->getKeyName());
299296
}
300297
}
301298
}
@@ -362,7 +359,7 @@ protected function setProperty($name, $type = null)
362359
'user_name' => '$faker->userName',
363360
'password' => 'bcrypt($faker->password)',
364361
'url' => '$faker->url',
365-
'remember_token' => 'str_random(10)',
362+
'remember_token' => 'Str::random(10)',
366363
'uuid' => '$faker->uuid',
367364
'guid' => '$faker->uuid',
368365
];

0 commit comments

Comments
 (0)