Skip to content

Commit

Permalink
Replace helpers with their class implementation
Browse files Browse the repository at this point in the history
These helpers are deprecated and will be removed in a future version.
  • Loading branch information
driesvints committed Feb 15, 2019
1 parent 3939082 commit b394831
Show file tree
Hide file tree
Showing 3 changed files with 299 additions and 191 deletions.
3 changes: 2 additions & 1 deletion database-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ It is often useful to reset your database after each test so that data from a pr

When testing, you may need to insert a few records into your database before executing your test. Instead of manually specifying the value of each column when you create this test data, Laravel allows you to define a default set of attributes for each of your [Eloquent models](/docs/{{version}}/eloquent) using model factories. To get started, take a look at the `database/factories/UserFactory.php` file in your application. Out of the box, this file contains one factory definition:

use Illuminate\Support\Str;
use Faker\Generator as Faker;

$factory->define(App\User::class, function (Faker $faker) {
Expand All @@ -86,7 +87,7 @@ When testing, you may need to insert a few records into your database before exe
'email' => $faker->unique()->safeEmail,
'email_verified_at' => now(),
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
'remember_token' => str_random(10),
'remember_token' => Str::random(10),
];
});

Expand Down
Loading

2 comments on commit b394831

@lmj0011
Copy link

@lmj0011 lmj0011 commented on b394831 Feb 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These helpers are deprecated and will be removed in a future version.

Are you saying Illuminate\Support\Arr and Illuminate\Support\Str are being removed in a future version of Laravel? If so, is there a class that will replace them?

@driesvints
Copy link
Member Author

@driesvints driesvints commented on b394831 Feb 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmj0011 The helpers, not their class equivalents.

Please sign in to comment.