 Laravel 5.1 中文文档Eloquent 查询构建器的 find 方法: public static function find($id, $columns = ['*']){ $model = static::query()->find($id, $columns); // ... return $model; } lists 方法 lists 方法现在返回一个 Collection Collection 实例而不是包含 Eloquent 查询结果的数组,如果你想 将 Collection 转化为数组,使用 all 方法: User::lists('id')->all(); 注意:Query Builder 的 lists 返回的仍然是数组。 日期格式化 以前,模型中的 Eloquent 日期字段存储格式可以通过重写 getDateFormat 方法来修改,现 在依然可以这么做; ntainer\BindingResolutionException.  服务容器的 bindShared 方法被废弃,使用 singleton 方法。  Eloquent 和 query builder 的 pluck 方法被废弃并重命名为 value.  Collection 的 fetch 方法被废弃,使用 pluck 方法.  array_fetch 帮助函数被废弃,0 码力 | 307 页 | 3.46 MB | 1 年前3 Laravel 5.1 中文文档Eloquent 查询构建器的 find 方法: public static function find($id, $columns = ['*']){ $model = static::query()->find($id, $columns); // ... return $model; } lists 方法 lists 方法现在返回一个 Collection Collection 实例而不是包含 Eloquent 查询结果的数组,如果你想 将 Collection 转化为数组,使用 all 方法: User::lists('id')->all(); 注意:Query Builder 的 lists 返回的仍然是数组。 日期格式化 以前,模型中的 Eloquent 日期字段存储格式可以通过重写 getDateFormat 方法来修改,现 在依然可以这么做; ntainer\BindingResolutionException.  服务容器的 bindShared 方法被废弃,使用 singleton 方法。  Eloquent 和 query builder 的 pluck 方法被废弃并重命名为 value.  Collection 的 fetch 方法被废弃,使用 pluck 方法.  array_fetch 帮助函数被废弃,0 码力 | 307 页 | 3.46 MB | 1 年前3
 Laravel 5.2 中文文档d connection.{name}.rollingBack Illuminate\Database\Events\TransactionRolledBack illuminate.query Illuminate\Database\Events\QueryExecuted illuminate.queue.after Illuminate\Queue\Events\JobProcessed ; 如果你已经有了一个查询构建器实例并且希望添加一个查询列到已存在的 select 子句,可 以使用 addSelect 方法: $query = DB::table('users')->select('name'); $users = $query->addSelect('age')->get(); 原生表达式 有时候你希望在查询中使用原生表达式,这些表达式将会以字符串的形式注入到查询中, DB::table('users') ->where('name', '=', 'John') ->orWhere(function ($query) { $query->where('votes', '>', 100) ->where('title', '<>', 'Admin');0 码力 | 377 页 | 4.56 MB | 1 年前3 Laravel 5.2 中文文档d connection.{name}.rollingBack Illuminate\Database\Events\TransactionRolledBack illuminate.query Illuminate\Database\Events\QueryExecuted illuminate.queue.after Illuminate\Queue\Events\JobProcessed ; 如果你已经有了一个查询构建器实例并且希望添加一个查询列到已存在的 select 子句,可 以使用 addSelect 方法: $query = DB::table('users')->select('name'); $users = $query->addSelect('age')->get(); 原生表达式 有时候你希望在查询中使用原生表达式,这些表达式将会以字符串的形式注入到查询中, DB::table('users') ->where('name', '=', 'John') ->orWhere(function ($query) { $query->where('votes', '>', 100) ->where('title', '<>', 'Admin');0 码力 | 377 页 | 4.56 MB | 1 年前3
 Laravel 5.3 中文文档条件需要显式使用查询构建器提供的 where 方法: $query->join('table', function($join) { $join->on('foo', 'bar')->where('bar', 'baz'); }); $bindings 属性也被移除,要直接操作 join 绑定可以使用 addBinding 方法: $query->join(DB::raw('('.$subquery->toSql() 先,消费者应用要生成一个重定向请求到应用的 /oauth/authorize 路由: Route::get('/redirect', function () { $query = http_build_query([ 'client_id' => 'client-id', 'redirect_uri' => 'http://example.com/callback' 'scope' => '', ]); return redirect('http://your-app.com/oauth/authorize?'.$query); 本文档由 Laravel 学院(LaravelAcademy.org)提供 Laravel 学院致力于提供优质 Laravel 中文学习资源 275 }); 注:记住,0 码力 | 691 页 | 9.37 MB | 1 年前3 Laravel 5.3 中文文档条件需要显式使用查询构建器提供的 where 方法: $query->join('table', function($join) { $join->on('foo', 'bar')->where('bar', 'baz'); }); $bindings 属性也被移除,要直接操作 join 绑定可以使用 addBinding 方法: $query->join(DB::raw('('.$subquery->toSql() 先,消费者应用要生成一个重定向请求到应用的 /oauth/authorize 路由: Route::get('/redirect', function () { $query = http_build_query([ 'client_id' => 'client-id', 'redirect_uri' => 'http://example.com/callback' 'scope' => '', ]); return redirect('http://your-app.com/oauth/authorize?'.$query); 本文档由 Laravel 学院(LaravelAcademy.org)提供 Laravel 学院致力于提供优质 Laravel 中文学习资源 275 }); 注:记住,0 码力 | 691 页 | 9.37 MB | 1 年前3
 Laravel 5.6 中文文档Nginx 如果你使用的是 Nginx,使用如下站点配置指令就可以支持 URL 美化: location / { try_files $uri $uri/ /index.php?$query_string; } 当然,使用 Homestead 或 Valet 的话,以上配置已经为你配置好,无需额外操作。 环境配置 基于应用运行的环境不同设置不同的配置值能够给我们开发带来 my.org 27 charset utf-8; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location $request->url(); // 包含查询字符串 $url_with_query = $request->fullUrl(); 例如,我们请求 http://domain.com/user/1?token=laravelacademy.org,则上述 $url 的值是 http://domain.com/user/1, $url_with_query 的值是 http://blog.test/user/10 码力 | 377 页 | 14.56 MB | 1 年前3 Laravel 5.6 中文文档Nginx 如果你使用的是 Nginx,使用如下站点配置指令就可以支持 URL 美化: location / { try_files $uri $uri/ /index.php?$query_string; } 当然,使用 Homestead 或 Valet 的话,以上配置已经为你配置好,无需额外操作。 环境配置 基于应用运行的环境不同设置不同的配置值能够给我们开发带来 my.org 27 charset utf-8; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location $request->url(); // 包含查询字符串 $url_with_query = $request->fullUrl(); 例如,我们请求 http://domain.com/user/1?token=laravelacademy.org,则上述 $url 的值是 http://domain.com/user/1, $url_with_query 的值是 http://blog.test/user/10 码力 | 377 页 | 14.56 MB | 1 年前3
 Laravel 6.0 中文文档fluent query builder instance. * * @param \Closure|\Illuminate\Database\Query\Builde r|string $table * @param string|null $as * @param string|null $connection * @return \Illuminate\Database\Query\Builder 中文学习资源:https://xueyuanjun.com 17 如果你想要通过 BelongsTo 方法更新模型的所属对象,并获取批量 赋值更新保护和事件触发,需要在模型自身上调用 update 方法: // Ad-hoc query... no mass assignment protection or ev ents... $post->user()->update(['foo' => 'bar']); // Model [L] Nginx 如果你使用的是 Nginx,使用如下站点配置指令就可以支持 URL 美 化: location / { try_files $uri $uri/ /index.php?$query_string; } 当然,使用 Homestead 或 Valet 的话,以上配置已经为你配置好, 可以忽略上述配置。 本文档由学院君提供 学院君致力于提供优质 Laravel 中文学0 码力 | 1442 页 | 14.66 MB | 1 年前3 Laravel 6.0 中文文档fluent query builder instance. * * @param \Closure|\Illuminate\Database\Query\Builde r|string $table * @param string|null $as * @param string|null $connection * @return \Illuminate\Database\Query\Builder 中文学习资源:https://xueyuanjun.com 17 如果你想要通过 BelongsTo 方法更新模型的所属对象,并获取批量 赋值更新保护和事件触发,需要在模型自身上调用 update 方法: // Ad-hoc query... no mass assignment protection or ev ents... $post->user()->update(['foo' => 'bar']); // Model [L] Nginx 如果你使用的是 Nginx,使用如下站点配置指令就可以支持 URL 美 化: location / { try_files $uri $uri/ /index.php?$query_string; } 当然,使用 Homestead 或 Valet 的话,以上配置已经为你配置好, 可以忽略上述配置。 本文档由学院君提供 学院君致力于提供优质 Laravel 中文学0 码力 | 1442 页 | 14.66 MB | 1 年前3
 Laravel 5.0 Documentation
Connections iii. Running Queries iv. Database Transactions v. Accessing Connections vi. Query Logging ii. Query Builder i. Introduction ii. Selects iii. Joins iv. Advanced Wheres v. Aggregates vi Basic Usage iii. Mass Assignment iv. Insert, Update, Delete v. Soft Deleting vi. Timestamps vii. Query Scopes viii. Global Scopes ix. Relationships x. Querying Relations xi. Eager Loading xii. Inserting cleaner default User model file out of the box. A new simplePaginate method was added to the query and Eloquent builder which allows for more efficient queries when using simple "Next" and "Previous"0 码力 | 242 页 | 1.44 MB | 1 年前3 Laravel 5.0 Documentation
Connections iii. Running Queries iv. Database Transactions v. Accessing Connections vi. Query Logging ii. Query Builder i. Introduction ii. Selects iii. Joins iv. Advanced Wheres v. Aggregates vi Basic Usage iii. Mass Assignment iv. Insert, Update, Delete v. Soft Deleting vi. Timestamps vii. Query Scopes viii. Global Scopes ix. Relationships x. Querying Relations xi. Eager Loading xii. Inserting cleaner default User model file out of the box. A new simplePaginate method was added to the query and Eloquent builder which allows for more efficient queries when using simple "Next" and "Previous"0 码力 | 242 页 | 1.44 MB | 1 年前3
 Laravel 3.2 Documentation..................................................................................... 78 Other Query Methods.......................................................................................... .................................................................................... 79 Fluent Query Builder ......................................................................................... conveniences of ActiveRecord. Eloquent natively supports all of the methods from Laravel's Fluent query-builder.  Application Logic can be implemented within your application either using controllers0 码力 | 139 页 | 1.13 MB | 1 年前3 Laravel 3.2 Documentation..................................................................................... 78 Other Query Methods.......................................................................................... .................................................................................... 79 Fluent Query Builder ......................................................................................... conveniences of ActiveRecord. Eloquent natively supports all of the methods from Laravel's Fluent query-builder.  Application Logic can be implemented within your application either using controllers0 码力 | 139 页 | 1.13 MB | 1 年前3
 Learning LaravelDB Connections in Laravel 133 Examples 133 Initial Steps 133 Using Schema builder 133 Using DB query builder 134 Using Eloquent 134 From Laravel Documentation 134 Chapter 43: Naming Files when uploading mysql connection Table::on('mysql')->select(...)->get() Database/Query Builder You may also specify another connection using the query builder: // Using the sqlite connection DB::connection('sqlite been configured in your config/database.php configuration file. To understand usage of eloquent query builder during development you may use php artisan ide- https://riptutorial.com/ 70 helper:generate0 码力 | 216 页 | 1.58 MB | 1 年前3 Learning LaravelDB Connections in Laravel 133 Examples 133 Initial Steps 133 Using Schema builder 133 Using DB query builder 134 Using Eloquent 134 From Laravel Documentation 134 Chapter 43: Naming Files when uploading mysql connection Table::on('mysql')->select(...)->get() Database/Query Builder You may also specify another connection using the query builder: // Using the sqlite connection DB::connection('sqlite been configured in your config/database.php configuration file. To understand usage of eloquent query builder during development you may use php artisan ide- https://riptutorial.com/ 70 helper:generate0 码力 | 216 页 | 1.58 MB | 1 年前3
 《Slides Dev Web》02. Introduction aux frameworks PHP
niveau de compréhension de PHP et d’une forme de complexité. query string `page= 《Slides Dev Web》02. Introduction aux frameworks PHP
niveau de compréhension de PHP et d’une forme de complexité. query string `page=- &id= - `. $page = $_GET["page"] ?? null; $id = (int) ($_GET["id"] ?? 0); // Connexion php // Contenu if ("equipe" === $page): $query = $db->query("SELECT * FROM `personnes` WHERE `id` = :id;"); $query->execute(compact('id')); $personne = $query->fetch(PDO::FETCH_OBJ); ?> - query->execute(compact('id')); $personne = $query->fetch(PDO::FETCH_OBJ); 16 // Mais dites 0 码力 | 24 页 | 1.03 MB | 1 年前3
 《Slides Dev Web》 03. Laravel
com/LaravelDaily/laravel-tips 34https://hackr.io/blog/laravel-cheat-sheet 35https://laracasts.com/search?query=laravel%209 36http://learninglaravel.net/tags/tutorials 37https://www.tutsmake.com/laravel-10-res0 码力 | 8 页 | 224.34 KB | 1 年前3 《Slides Dev Web》 03. Laravel
com/LaravelDaily/laravel-tips 34https://hackr.io/blog/laravel-cheat-sheet 35https://laracasts.com/search?query=laravel%209 36http://learninglaravel.net/tags/tutorials 37https://www.tutsmake.com/laravel-10-res0 码力 | 8 页 | 224.34 KB | 1 年前3
共 12 条
- 1
- 2













