diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php
deleted file mode 100644
index 6a247fe..0000000
--- a/app/Http/Controllers/Auth/ForgotPasswordController.php
+++ /dev/null
@@ -1,32 +0,0 @@
-middleware('guest');
- }
-}
diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php
index 7594953..36ba950 100644
--- a/app/Http/Controllers/Auth/LoginController.php
+++ b/app/Http/Controllers/Auth/LoginController.php
@@ -36,4 +36,9 @@ class LoginController extends Controller
{
$this->middleware('guest', ['except' => 'logout']);
}
+
+ public function username()
+ {
+ return 'username';
+ }
}
diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php
deleted file mode 100644
index cf726ee..0000000
--- a/app/Http/Controllers/Auth/ResetPasswordController.php
+++ /dev/null
@@ -1,39 +0,0 @@
-middleware('guest');
- }
-}
diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php
new file mode 100644
index 0000000..a3af7dd
--- /dev/null
+++ b/app/Http/Controllers/HomeController.php
@@ -0,0 +1,28 @@
+middleware('auth');
+ }
+
+ /**
+ * Show the application dashboard.
+ *
+ * @return \Illuminate\Http\Response
+ */
+ public function index()
+ {
+ return view('home');
+ }
+}
diff --git a/app/User.php b/app/User.php
index bfd96a6..9aca65b 100644
--- a/app/User.php
+++ b/app/User.php
@@ -26,4 +26,9 @@ class User extends Authenticatable
protected $hidden = [
'password', 'remember_token',
];
+
+ public function setPasswordAttribute($password)
+ {
+ $this->attributes['password'] = bcrypt($password);
+ }
}
diff --git a/artisan b/artisan
old mode 100644
new mode 100755
diff --git a/composer.json b/composer.json
index eb080e9..eadeda1 100644
--- a/composer.json
+++ b/composer.json
@@ -6,6 +6,7 @@
"type": "project",
"require": {
"php": ">=5.6.4",
+ "laravel/browser-kit-testing": "^1.0",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0"
},
diff --git a/composer.lock b/composer.lock
index 07d394d..fe9d1cc 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "96098e473b028cdb2529580554a1ae3e",
+ "content-hash": "84e5d69e0c52b9e0be3312d687b8482e",
"packages": [
{
"name": "dnoegel/php-xdg-base-dir",
@@ -236,6 +236,53 @@
"time": "2015-04-20T18:58:01+00:00"
},
{
+ "name": "laravel/browser-kit-testing",
+ "version": "v1.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/laravel/browser-kit-testing.git",
+ "reference": "0adfb725147815bff5516d157577f375a6e66ebd"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/laravel/browser-kit-testing/zipball/0adfb725147815bff5516d157577f375a6e66ebd",
+ "reference": "0adfb725147815bff5516d157577f375a6e66ebd",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "symfony/css-selector": "~3.1",
+ "symfony/dom-crawler": "~3.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Laravel\\BrowserKitTesting\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Taylor Otwell",
+ "email": "taylor@laravel.com"
+ }
+ ],
+ "description": "Provides backwards compatibility for BrowserKit testing in Laravel 5.4.",
+ "keywords": [
+ "laravel",
+ "testing"
+ ],
+ "time": "2017-02-08T22:32:37+00:00"
+ },
+ {
"name": "laravel/framework",
"version": "v5.4.17",
"source": {
@@ -1209,6 +1256,62 @@
"time": "2017-03-28T21:38:24+00:00"
},
{
+ "name": "symfony/dom-crawler",
+ "version": "v3.2.7",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/dom-crawler.git",
+ "reference": "403944e294cf4ceb3b8447f54cbad88ea7b99cee"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/403944e294cf4ceb3b8447f54cbad88ea7b99cee",
+ "reference": "403944e294cf4ceb3b8447f54cbad88ea7b99cee",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "symfony/polyfill-mbstring": "~1.0"
+ },
+ "require-dev": {
+ "symfony/css-selector": "~2.8|~3.0"
+ },
+ "suggest": {
+ "symfony/css-selector": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\DomCrawler\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony DomCrawler Component",
+ "homepage": "https://symfony.com",
+ "time": "2017-02-21T09:12:04+00:00"
+ },
+ {
"name": "symfony/event-dispatcher",
"version": "v3.2.7",
"source": {
diff --git a/config/app.php b/config/app.php
index 135e977..7380f4f 100644
--- a/config/app.php
+++ b/config/app.php
@@ -12,7 +12,7 @@ return [
| any other location as required by the application or its packages.
*/
- 'name' => env('APP_NAME', 'Laravel'),
+ 'name' => 'Grosir Obat',
/*
|--------------------------------------------------------------------------
diff --git a/config/database.php b/config/database.php
index a196943..0ecc5bc 100644
--- a/config/database.php
+++ b/config/database.php
@@ -47,8 +47,8 @@ return [
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
- 'charset' => 'utf8mb4',
- 'collation' => 'utf8mb4_unicode_ci',
+ 'charset' => 'utf8',
+ 'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php
index 7926c79..d74465d 100644
--- a/database/factories/ModelFactory.php
+++ b/database/factories/ModelFactory.php
@@ -13,12 +13,11 @@
/** @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(App\User::class, function (Faker\Generator $faker) {
- static $password;
return [
'name' => $faker->name,
- 'email' => $faker->unique()->safeEmail,
- 'password' => $password ?: $password = bcrypt('secret'),
+ 'username' => $faker->unique()->username,
+ 'password' => 'secret',
'remember_token' => str_random(10),
];
});
diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php
index 689cbee..bac8b58 100644
--- a/database/migrations/2014_10_12_000000_create_users_table.php
+++ b/database/migrations/2014_10_12_000000_create_users_table.php
@@ -16,7 +16,7 @@ class CreateUsersTable extends Migration
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
- $table->string('email')->unique();
+ $table->string('username')->unique();
$table->string('password');
$table->rememberToken();
$table->timestamps();
diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php
deleted file mode 100644
index 0d5cb84..0000000
--- a/database/migrations/2014_10_12_100000_create_password_resets_table.php
+++ /dev/null
@@ -1,32 +0,0 @@
-string('email')->index();
- $table->string('token');
- $table->timestamp('created_at')->nullable();
- });
- }
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('password_resets');
- }
-}
diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php
index e119db6..2399bf1 100644
--- a/database/seeds/DatabaseSeeder.php
+++ b/database/seeds/DatabaseSeeder.php
@@ -11,6 +11,6 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
- // $this->call(UsersTableSeeder::class);
+ $this->call(UsersTableSeeder::class);
}
}
diff --git a/database/seeds/UsersTableSeeder.php b/database/seeds/UsersTableSeeder.php
new file mode 100644
index 0000000..1c7c7ac
--- /dev/null
+++ b/database/seeds/UsersTableSeeder.php
@@ -0,0 +1,20 @@
+create([
+ 'name' => 'Administrator',
+ 'username' => 'admin',
+ ]);
+ }
+}
diff --git a/phpunit.xml b/phpunit.xml
index a2c496e..77231e9 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -27,5 +27,7 @@