Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use App\User;
- use Illuminate\Support\Facades\DB;
- // Migrate from WP Users > Laravel Users
- DB::table('wp_users')
- ->orderBy('id')
- ->chunk(100, function ($wp_users) {
- foreach ($wp_users as $wp_user) {
- // add new user (if doesn't exist)
- User::firstOrCreate(
- [
- 'email' => $wp_user->user_email,
- ],
- [
- 'name' => $wp_user->user_nicename,
- 'password' => $wp_user->user_pass
- ]
- );
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement