當前位置: 首頁>>代碼示例>>PHP>>正文


PHP User::where方法代碼示例

本文整理匯總了PHP中Model\User::where方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::where方法的具體用法?PHP User::where怎麽用?PHP User::where使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Model\User的用法示例。


在下文中一共展示了User::where方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _previewAdminVideo

 protected function _previewAdminVideo($params)
 {
     $user = User::where(['name' => 'admin'])->first();
     $this->be($user);
     Session::start();
     $response = $this->call('POST', '/admin/video', $params + ['_token' => csrf_token()]);
     $result = json_decode($response->getContent());
     $this->assertEquals(200, $response->getStatusCode());
     $this->assertEquals(true, $result->result);
     $this->assertNotEmpty($result->model->preview);
     $getHeaders = @get_headers($result->model->preview);
     $this->assertEquals(true, is_numeric(stripos($getHeaders[0], '200 OK')));
     $this->assertNotEmpty(exif_imagetype($result->model->preview));
     $response = $this->call('DELETE', '/admin/video/' . $result->model->id, ['_token' => csrf_token()]);
     $result = json_decode($response->getContent());
     $this->assertEquals(true, $result->result);
 }
開發者ID:Ognestraz,項目名稱:lumen-admin,代碼行數:17,代碼來源:VideoAdminServiceTest.php

示例2: testUser2AdminSite

 public function testUser2AdminSite()
 {
     $user = User::where(['name' => 'user1'])->first();
     $this->be($user);
     $this->_testGetAdmin(['assertRedirectedTo' => '/', 'getStatusCode' => 302]);
 }
開發者ID:Ognestraz,項目名稱:lumen-admin,代碼行數:6,代碼來源:UserAccessTest.php

示例3: _simpleAdminControllerSoftDeletes

 protected function _simpleAdminControllerSoftDeletes($controller, $storeParams = [], $ex = [])
 {
     $user = User::where(['name' => 'admin'])->first();
     $this->be($user);
     Session::start();
     $this->_indexAction($controller);
     if ($storeParams) {
         $id = $this->_storeAction($controller, $storeParams, $ex);
         $this->_showAction($id, $controller, $storeParams, $ex);
         $this->_deleteAction($id, $controller);
         $this->_showActionDeleted($id, $controller, $ex);
         $this->_restoreAction($id, $controller);
         $this->_showAction($id, $controller, $storeParams, $ex);
         $this->_destroyAction($id, $controller);
         $this->_showActionDeleted($id, $controller, $ex);
         $id = $this->_storeAction($controller, $storeParams, $ex);
         $this->_deleteAction($id, $controller);
         $this->_destroyAction($id, $controller);
     }
 }
開發者ID:Ognestraz,項目名稱:lumen-admin,代碼行數:20,代碼來源:TestCase.php


注:本文中的Model\User::where方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。