* @var array */protected$dontReport=[\Illuminate\Auth\AuthenticationException::class,\Illuminate\Auth\Access\AuthorizationException::class,\Symfony\Component\HttpKernel\Exception\HttpException::class,\Illuminate\Database\Eloquent\ModelNotFoundException::class,\Illuminate\Validation\ValidationException::class,]; ...
<?php//观察者模式// 主题接口interfaceSubject{publicfunctionregister(Observer$observer);publicfunctionnotify();}// 观察者接口interfaceObserver{publicfunctionwatch();}// 主题classActionimplementsSubject{public$_observers=array();publicfunctionregister(Observer$observer){$this->_observers[]=$observer;}public...
{publicfunctionssoinfo(Request$request){$data=array();$data['username']=Session::get('user_login');$data['time']=Redis::get('STRING_SINGLETOKEN_MAJOR_'.$data['username']);$data['token']=Redis::get('SINGLETOKEN_MAJOR_'.$data['username']);returnredirect()->intended("http://activeadmi...
// Single category id $post->withAnyCategories(1)->get(); // Multiple category IDs array $post->withAnyCategories([1, 2, 5])->get(); // Multiple category IDs collection $post->withAnyCategories(collect([1, 2, 5]))->get(); // Single category model instance $categoryInstance = ...
protected function createReadWriteConnection(array $config) { $connection = $this->createSingleConnection($this->getWriteConfig($config)); return $connection->setReadPdo($this->createReadPdo($config)); } 注意此时的writeConnection与readConnection并不会真正的连接数据库,而是一个闭包,保存了获取连接的...
Get the SQL representation of the query. mixed|Builder find(int|string $id, array|string $columns = ['*']) Execute a query for a single record by ID. mixed|Builder findOr(mixed $id, Closure|array|string $columns = ['*'], Closure $callback = null) Execute a query for a si...
Get the mode of a given key. Enumerable collapse() Collapse the collection of items into a single array. bool contains(mixed $key, mixed $operator = null, mixed $value = null) Determine if an item exists in the collection. bool doesntContain(mixed $key, mixed $operator = null,...
->get(); 要将新数据插入表中,请使用insert()方法: DB::table('users')->insert(array('email'=>'me@ardakilicdagi.com','points'=>100) ); 要从表中更新行,请使用update()方法: DB::table('users') ->where('id',1) ->update(array('votes'=>100)); ...
in_array($data['sex'],[1,2])){echo'参数错误';}\Illuminate\Support\Facades\DB::update('update raw_test set name=:name,sex =:sex where id = :id',$data);echo'修改成功';});Route::get('rawdb/test/delete',function(){$id=request()->id;if($id<1){echo'参数错误';}\Illuminate\...
Model::select('name','surname')->where('id', 1)->get(); If you want to get columns as array use the below code: Model::select('name','surname')->where('id', 1)->get()->toArray(); If you want to get a single column try this: Model::where('id', 1)->first(['colu...