Browse Source

Add agency city to show on agency profile and payment receipt

pull/3/head
Nafies Luthfi 8 years ago
parent
commit
f426666e20
  1. 2
      app/Http/Controllers/Users/AgencyController.php
  2. 1
      resources/lang/id/address.php
  3. 1
      resources/views/users/agency/edit.blade.php
  4. 1
      resources/views/users/agency/show.blade.php
  5. 5
      tests/Feature/AgencyProfileTest.php

2
app/Http/Controllers/Users/AgencyController.php

@ -30,6 +30,7 @@ class AgencyController extends Controller
'email' => 'required|email|max:255', 'email' => 'required|email|max:255',
'website' => 'required|url|max:255', 'website' => 'required|url|max:255',
'address' => 'required|string|max:255', 'address' => 'required|string|max:255',
'city' => 'required|string|max:100',
'phone' => 'required|string|max:255', 'phone' => 'required|string|max:255',
]); ]);
@ -38,6 +39,7 @@ class AgencyController extends Controller
Option::set('agency_email', request('email')); Option::set('agency_email', request('email'));
Option::set('agency_website', request('website')); Option::set('agency_website', request('website'));
Option::set('agency_address', request('address')); Option::set('agency_address', request('address'));
Option::set('agency_city', request('city'));
Option::set('agency_phone', request('phone')); Option::set('agency_phone', request('phone'));
flash(trans('agency.updated'), 'success'); flash(trans('agency.updated'), 'success');

1
resources/lang/id/address.php

@ -9,5 +9,6 @@ return [
'village' => 'Kelurahan/Desa', 'village' => 'Kelurahan/Desa',
'district' => 'Kecamatan', 'district' => 'Kecamatan',
'municipality' => 'Kota/Kab.', 'municipality' => 'Kota/Kab.',
'city' => 'Kota',
'province' => 'Propinsi', 'province' => 'Propinsi',
]; ];

1
resources/views/users/agency/edit.blade.php

@ -21,6 +21,7 @@
<div class="col-md-6">{!! FormField::text('phone', ['value' => Option::get('agency_phone')]) !!}</div> <div class="col-md-6">{!! FormField::text('phone', ['value' => Option::get('agency_phone')]) !!}</div>
</div> </div>
{!! FormField::textarea('address', ['value' => Option::get('agency_address')]) !!} {!! FormField::textarea('address', ['value' => Option::get('agency_address')]) !!}
{!! FormField::text('city', ['value' => Option::get('agency_city')]) !!}
{!! FormField::text('website', ['value' => Option::get('agency_website')]) !!} {!! FormField::text('website', ['value' => Option::get('agency_website')]) !!}
</div> </div>
{{ Form::close() }} {{ Form::close() }}

1
resources/views/users/agency/show.blade.php

@ -24,6 +24,7 @@
<tr><th>{{ trans('contact.email') }}</th><td>{{ Option::get('agency_email') }}</td></tr> <tr><th>{{ trans('contact.email') }}</th><td>{{ Option::get('agency_email') }}</td></tr>
<tr><th>{{ trans('contact.phone') }}</th><td>{{ Option::get('agency_phone') }}</td></tr> <tr><th>{{ trans('contact.phone') }}</th><td>{{ Option::get('agency_phone') }}</td></tr>
<tr><th>{{ trans('address.address') }}</th><td>{!! nl2br(Option::get('agency_address')) !!}</td></tr> <tr><th>{{ trans('address.address') }}</th><td>{!! nl2br(Option::get('agency_address')) !!}</td></tr>
<tr><th>{{ trans('address.city') }}</th><td>{{ Option::get('agency_city') }}</td></tr>
<tr><th>{{ trans('contact.website') }}</th><td>{{ Option::get('agency_website') }}</td></tr> <tr><th>{{ trans('contact.website') }}</th><td>{{ Option::get('agency_website') }}</td></tr>
</table> </table>
</div> </div>

5
tests/Feature/AgencyProfileTest.php

@ -31,6 +31,7 @@ class AgencyProfileTest extends TestCase
'email' => 'nama_agensi@domain.com', 'email' => 'nama_agensi@domain.com',
'address' => 'Jln. Kalimantan, No. 20, Kota', 'address' => 'Jln. Kalimantan, No. 20, Kota',
'phone' => '081234567890', 'phone' => '081234567890',
'city' => 'Jakarta',
'website' => 'https://example.com', 'website' => 'https://example.com',
]); ]);
@ -50,6 +51,10 @@ class AgencyProfileTest extends TestCase
'value' => 'Jln. Kalimantan, No. 20, Kota', 'value' => 'Jln. Kalimantan, No. 20, Kota',
]); ]);
$this->seeInDatabase('site_options', [ $this->seeInDatabase('site_options', [
'key' => 'agency_city',
'value' => 'Jakarta',
]);
$this->seeInDatabase('site_options', [
'key' => 'agency_phone', 'key' => 'agency_phone',
'value' => '081234567890', 'value' => '081234567890',
]); ]);

Loading…
Cancel
Save