diff --git a/app/Http/Controllers/InstallationController.php b/app/Http/Controllers/InstallationController.php index 7b7eddd..e44e794 100755 --- a/app/Http/Controllers/InstallationController.php +++ b/app/Http/Controllers/InstallationController.php @@ -19,15 +19,15 @@ class InstallationController extends Controller $this->middleware('guest'); } - public function getRegister() + public function index() { if (User::count()) { return redirect()->route('auth.login'); } - return view('auth.register'); + return view('auth.app-install'); } - public function postRegister(RegisterRequest $request) + public function store(RegisterRequest $request) { $agencyData = collect($request->only('agency_name', 'agency_website', 'email')) ->map(function ($value, $key) { diff --git a/resources/lang/id/app_install.php b/resources/lang/id/app_install.php new file mode 100644 index 0000000..fe42b58 --- /dev/null +++ b/resources/lang/id/app_install.php @@ -0,0 +1,10 @@ + 'Install '.config('app.name').'', + 'agency_info_text' => 'Silakan isi formulir di bawah ini untuk membuat Agensi.', + 'admin_info_text' => 'Silakan isi formulir di bawah ini untuk membuat akun Administrator.', + 'admin_name' => 'Nama Administrator', + 'admin_email' => 'Email Administrator', + 'button' => 'Install Free PMO', +]; diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/app-install.blade.php similarity index 51% rename from resources/views/auth/register.blade.php rename to resources/views/auth/app-install.blade.php index f9e2e91..30d1fce 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/app-install.blade.php @@ -1,45 +1,45 @@ @extends('layouts.guest') -@section('title', trans('auth.register')) +@section('title', 'Install '.config('app.name')) @section('content')
-
+ +
-
- {!! appLogoImage(['style' => 'width:150px']) !!} -

{{ config('app.name') }}

-
-
- {!! Form::open(['route' => 'app.install', 'class' => '']) !!} -

Silakan isi formulir di bawah ini untuk membuat akun Administrator dan Agensi.

+ {!! Form::open(['route' => 'app.install']) !!}
-
- {!! FormField::text('agency_name', ['required' => true, 'label' => trans('agency.name')]) !!} +
+
+ {!! appLogoImage(['style' => 'width:150px']) !!} +

{{ config('app.name') }}

+
-
+
+

{{ trans('app_install.agency_info_text') }}

+ {!! FormField::text('agency_name', ['required' => true, 'label' => trans('agency.name')]) !!} {!! FormField::text('agency_website', ['required' => true, 'label' => trans('agency.website')]) !!}
+
+

{{ trans('app_install.admin_info_text') }}

-
- {!! FormField::text('name', ['required' => true, 'label' => trans('user.name')]) !!} +
+ {!! FormField::text('name', ['required' => true, 'label' => trans('app_install.admin_name')]) !!}
-
- {!! FormField::email('email', ['required' => true, 'label' => trans('auth.email')]) !!} +
+ {!! FormField::email('email', ['required' => true, 'label' => trans('app_install.admin_email')]) !!}
-
+
{!! FormField::password('password', ['required' => true, 'label' => trans('auth.password')]) !!}
-
+
{!! FormField::password('password_confirmation', ['required' => true, 'label' => trans('auth.password_confirmation')]) !!}
-
- {!! Form::submit(trans('auth.register'), ['class' => 'btn btn-success']) !!} -
+ {!! Form::submit(trans('app_install.button'), ['class' => 'btn btn-success btn-block btn-lg']) !!} {!! Form::close() !!}
diff --git a/resources/views/layouts/partials/footer.blade.php b/resources/views/layouts/partials/footer.blade.php index 62afaaf..6e61b78 100755 --- a/resources/views/layouts/partials/footer.blade.php +++ b/resources/views/layouts/partials/footer.blade.php @@ -2,9 +2,7 @@
Powered by Free PMO, and developed with pleasure by the - - Contributors - + Contributors.
{{-- Free PMO is an opensource software you are free to remove this footer text or section. --}} diff --git a/routes/web/account.php b/routes/web/account.php index edea9c5..f8c0c4e 100644 --- a/routes/web/account.php +++ b/routes/web/account.php @@ -3,8 +3,8 @@ * Installation Routes */ Route::group(['middleware' => 'web'], function () { - Route::get('app-install', ['as' => 'app.install', 'uses' => 'InstallationController@getRegister']); - Route::post('app-install', ['as' => 'app.install', 'uses' => 'InstallationController@postRegister']); + Route::get('app-install', ['as' => 'app.install', 'uses' => 'InstallationController@index']); + Route::post('app-install', ['as' => 'app.install', 'uses' => 'InstallationController@store']); }); // Authentication Routes... diff --git a/tests/Feature/InstallationTest.php b/tests/Feature/InstallationTest.php index e5303a2..59d1fa8 100644 --- a/tests/Feature/InstallationTest.php +++ b/tests/Feature/InstallationTest.php @@ -13,7 +13,7 @@ use Tests\TestCase; class InstallationTest extends TestCase { /** @test */ - public function user_cannot_visit_register_page_if_user_already_exists_in_database() + public function user_cannot_visit_install_page_if_user_already_exists_in_database() { factory(User::class)->create(['email' => 'member@app.dev']); $this->visit(route('app.install')); @@ -21,13 +21,13 @@ class InstallationTest extends TestCase } /** @test */ - public function registration_validation() + public function application_install_form_validation() { $this->visit(route('app.install')); $this->seePageIs(route('app.install')); - $this->submitForm(trans('auth.register'), [ + $this->submitForm(trans('app_install.button'), [ 'name' => 'Nama Member', 'email' => 'email', 'password' => 'password', @@ -38,12 +38,12 @@ class InstallationTest extends TestCase } /** @test */ - public function member_register_successfully() + public function application_install_successfully() { $this->visit(route('app.install')); $this->seePageIs(route('app.install')); - $this->submitForm(trans('auth.register'), [ + $this->submitForm(trans('app_install.button'), [ 'agency_name' => 'Nama Agensi', 'agency_website' => 'https://example.com', 'name' => 'Nama Admin',