/**
  * All page (get).
  *
  * @Get("all", as="admin.twitter-user.all")
  *
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function getAll()
 {
     $users = $this->twitterUser->all();
     return view('admin.twitter-users.all', compact('users'));
 }
示例#2
0
 /**
  * Add user id and screen_name to twitter_users table.
  *
  * @param string $id
  * @param string $screen_name
  */
 protected function addUserToTable($id, $screen_name)
 {
     $twitter_user = new TwitterUser();
     $hasUser = $twitter_user->select('id')->get()->contains($id);
     if ($hasUser) {
         return;
     }
     $twitter_user->fill(compact('id', 'screen_name'));
     $twitter_user->save();
 }
示例#3
0
 /**
  * Test insert method.
  *
  * @dataProvider insertDataProvider
  *
  * @param mixed $id
  * @param mixed $screen_name
  * @param bool  $hasError
  */
 public function testInsert($id, $screen_name, $hasError)
 {
     $data = compact('id', 'screen_name');
     $response = $this->twitterUser->insert($data);
     $this->checkError($response, $hasError);
 }