Browse Source

add function update address

ifah
Siti Hajar Ibrahim 5 years ago
parent
commit
91dad1d0b9
2 changed files with 18 additions and 8 deletions
  1. 17
    7
      app/Http/Controllers/Controller.php
  2. 1
    1
      routes/web.php

+ 17
- 7
app/Http/Controllers/Controller.php View File

{ {
use AuthorizesRequests, DispatchesJobs, ValidatesRequests; use AuthorizesRequests, DispatchesJobs, ValidatesRequests;


public function updateCity()
public function updateAddress()
{ {
$subscribers = Subscriber::all(); $subscribers = Subscriber::all();


foreach ($subscribers as $key => $a) { foreach ($subscribers as $key => $a) {
$a->unit_no = strtoupper($a->unit_no);
$a->building_name = strtoupper($a->building_name);
$a->street = strtoupper($a->street);
$a->city = strtoupper($a->city);
$a->state = strtoupper($a->state);
$a->save();
if($a->unit_no != '' || $a->unit_no != null){
$a->unit_no = strtoupper($a->unit_no);
}
if ($a->building_name != '' || $a->building_name != null) {
$a->building_name = strtoupper($a->building_name);
}
if ($a->street != '' || $a->street != null) {
$a->street = strtoupper($a->street);
}
if ($a->city != ''|| $a->city != null) {
$a->city = strtoupper($a->city);
}
if ($a->state != ''|| $a->state != null) {
$a->state = strtoupper($a->state);
}
$a->save();
} }


return "Done standardize city in DB"; return "Done standardize city in DB";

+ 1
- 1
routes/web.php View File

return view('index'); return view('index');
}); });


Route::get('/update-promo-price', 'Controller@deleteTodayClaim');
Route::get('/update-promo-price', 'Controller@updateAddress');


Route::get('/convert-password/{action}/', ['uses' => 'Auth\AdminController@encryptPassword']); Route::get('/convert-password/{action}/', ['uses' => 'Auth\AdminController@encryptPassword']);
Route::get('/store-claim/pdf', ['uses' => 'DS\DealerController@exportDealerJson']); Route::get('/store-claim/pdf', ['uses' => 'DS\DealerController@exportDealerJson']);

Loading…
Cancel
Save