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 Indexes ix. Foreign Keys x. Dropping Indexes xi. Dropping Timestamps & Soft Deletes xii. Storage Engines v. Migrations & Seeding i. Introduction ii. Creating Migrations iii. Running Migrations iv.0 码力 | 242 页 | 1.44 MB | 1 年前3
Laravel 5.3 中文文档orWhere 约束),需要验证第一个条件是否是正常的 where 以避免布尔逻辑问题。 如果你的作用域约束都是以 where 开头则不需要做任何调整,你可以通过 toSql 方法查看当前的 SQL 语句: 本文档由 Laravel 学院(LaravelAcademy.org)提供 Laravel 学院致力于提供优质 Laravel 中文学习资源 23 User::where('foo' 条件需要显式使用查询构建器提供的 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'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 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 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.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
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 ed_in'); }); } } When running this migration, Laravel will generate the following SQL to run against your database: ALTER TABLE `users` ADD `last_logged_in` DATETIME NULL https://riptutorial0 码力 | 216 页 | 1.58 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 Laravel 5.1 中使用了 DB:listen 事件,在 5.2 中更新代码如下: DB::listen(function ($event) { dump($event->sql); dump($event->bindings); }); 你可以去检查每个事件对象类去查看它们的公有属性。 异常处理 App\Exceptions\Handler 类的 起步 1、简介 Laravel 让连接多种数据库以及对数据库进行查询变得非常简单,不论使用原生 SQL、还是 查询构建器,还是 Eloquent ORM。目前,Laravel 支持四种类型的数据库系统: MySQL Postgres SQLite SQL Server 配置 Laravel 让连接数据库和运行查询都变得非常简单。应用的数据库配置位于0 码力 | 377 页 | 4.56 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=&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); ?> 0 码力 | 24 页 | 1.03 MB | 1 年前3
The Laravel Handbook
dogs in the table yet, but you can open the database using TablePlus and insert data using this SQL query: INSERT INTO "dogs" ("id", "name", "created_at", "updated_at") VALUES ('1', 'Roger', '2023-05-110 码力 | 111 页 | 14.25 MB | 1 年前3
共 15 条
- 1
- 2













