Hello World Agung Prasetyo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function run() | |
{ | |
for ($i=1; $i < 10; $i++) { | |
User::create([ | |
'name' => "user0$i", | |
'email' => "user0$i@gmail.com", | |
'password' => Hash::make('12345678'), | |
'created_at' => date('Y-m-d H:i:s'), | |
'updated_at' => date('Y-m-d H:i:s'), | |
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use App\Traits\Uuids; | |
class User extends Model | |
{ | |
use Uuids; | |
/** | |
* The attributes that are mass assignable. | |
* | |
* @var string[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function up() | |
{ | |
Schema::create('users', function (Blueprint $table) { | |
$table->uuid('id')->unique(); | |
$table->string('name'); | |
$table->string('email')->unique(); | |
$table->timestamp('email_verified_at')->nullable(); | |
$table->string('password'); | |
$table->rememberToken(); | |
$table->timestamps(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Traits; | |
use Illuminate\Support\Str; | |
trait Uuids | |
{ | |
/** |