laravel-shift / factory-generator

MIT License
41 stars 20 forks source link

[Bug] Hash Facade is not imported #3

Open Naoray opened 3 years ago

Naoray commented 3 years ago

When generating a factory for a Model with a password column it will generate the following column in the factory file:

'password' => Hash::make('password'),

We need to add the import statement at the top or let the developer know that he hast to add it.

use Illuminate\Support\Facades\Hash;
jasonmccreary commented 3 years ago

Agreed. I noticed this myself the other day. We'll need to loop through the definition and check for common things to import, i.e. Str and Hash.