当前位置: 首页>>代码示例>>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;未经允许,请勿转载。