Browse Source

get database

hajar
Siti Hajar Ibrahim 4 years ago
parent
commit
9a5903b1dd
1 changed files with 7 additions and 3 deletions
  1. 7
    3
      app/Http/Controllers/Controller.php

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

@@ -120,9 +120,13 @@ class Controller extends BaseController

public function getDatabase(Request $request)
{
$subscriber = Subscriber::where('city', 'ALOR GAJAH, MELAKA')->first();
$subscriber->city = "ALOR GAJAH";
$subscriber->save();
$subscriber = Subscriber::where('city', 'ALOR GAJAH, MELAKA')->get();
foreach ($subscriber as $key => $s) {
# code..
$s->city = "ALOR GAJAH";
$s->save();
}


return count($subscriber) . $subscriber;
}

Loading…
Cancel
Save