error infomation: Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation...\laravel\framework\src\Illuminate\Database\Connection.php:664 660| // If an exception occurs...\laravel\framework\src\Illuminate\Database\Connection.php:458 2 PDOStatement::execute() D:...\WWW\test\vendor\laravel\framework\src\Illuminate\Database\Connection.php:458 Please use the argument...解决: 索引长度 & Mysql / MariaDB Laravel 默认使用 utf8mb4 编码,它支持在数据库中储存 emojis 。
`deleted_at` is null order by `id` desc) at D:\\phpstudy_pro\\WWW\\projzqb1b\\vendor\\laravel\\framework...\\src\\Illuminate\\Database\\Connection.php:664, ErrorException(code: 0): Packets out of order....Packet size=85 at D:\\phpstudy_pro\\WWW\\projzqb1b\\vendor\\laravel\\framework\\src\\Illuminate\\Database...\\Connection.php:332) 另外一段报错源码如下 (也是跟数据库连接有关): [2024-07-04 16:14:53] local.ERROR: Allowed memory size...\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php:330) [stacktrace] SQLSTATE[HY000]: General
\laravel\framework\src\Illuminate\Database\MySqlConnection.php:65 61| * @return \Doctrine\DBAL...Exception trace: 1 Illuminate\Database\MySqlConnection::getDoctrineDriver() E:\code\test\ruku...\ruku\vendor\laravel\framework\src\Illuminate\Database\Connection.php:887 2 Illuminate\Database\...Connection::getDoctrineSchemaManager("processes") E:\code\test\ruku\ruku\vendor\encore\laravel-admin...\src\Console\ResourceGenerator.php:224 Please use the argument -v to see more details.
报错信息: Migrating: 2014_10_12_000000_create_users_table Illuminate\Database\QueryException SQLSTATE[42S01...timestamp null) default character set utf8mb4 collate ‘utf8mb4_unicode_ci’) at D:\phpstudy_pro\WWW\blog\vendor...\laravel\framework\src\Illuminate\Database\Connection.php:712 708▕ // If an exception occurs when attempting...SQL, which will make this exception a 710▕ // lot more helpful to the developer instead of just the database...php namespace App\Providers; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades
直接通过编辑器的跳转功能点击 update() 方法就会跳转到 laravel/framework/src/Illuminate/Database/Query/Builder.php 的 update(...这个就要一步一步来看了,前面其实我们已经看到了 laravel/framework/src/Illuminate/Database/Query/Builder.php 这个对象的类文件,那么我们是怎么通过...这个对象继承的 laravel/framework/src/Illuminate/Database/Connection.php 类中,就有一个 table() 方法。...// laravel/framework/src/Illuminate/Database/Connection.php public function table($table, $as = null)...use Illuminate\Database\Query\Builder as QueryBuilder; // laravel/framework/src/Illuminate/Database/
接下来我们找到 beginTransaction() 的实现方法,就是在 laravel/framework/src/Illuminate/Database/Connection.php 类所引用的 laravel.../framework/src/Illuminate/Database/Concerns/ManagesTransactions.php 特性中。...找到 laravel/framework/src/Illuminate/Database/Connection.php 中的 select() 方法,也就是 原生语句 执行的地方。...卖个关子,大家在 laravel/framework/src/Illuminate/Database/Query/Builder.php 中找一下 toArray() 的源码实现,然后再去看一下所有 Model...的基类 laravel/framework/src/Illuminate/Database/Eloquent/Model.php 实现了哪个接口,相信大家马上就能明白了。
\laravel\framework\src\Illuminate\Database\Connectors\PostgresConnector.php改名KingBaseConnector.php#修改...KingBaseConnector.php 文件PostgresConnector修改成KingBaseConnectorpgsql: 改成kdb:#修改工产类文件路径:\vendor\laravel\...framework\src\Illuminate\Database\Connectors\ConnectionFactory.php#修改 createConnector 方法 return...\laravel\framework\src\Illuminate\Database\复制PostgresConnection.php类改名KingBaseConnection.php#修改数据库驱动\...vendor\laravel\framework\src\Illuminate\Database\PDO 新建kingbase驱动类<?
找到 laravel/framework/src/Illuminate/Database/Connection.php 中的 select() 方法,可以看到它还有第三个参数。...: $this->getPdo(); } // $this->readPdo laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php.../framework/src/Illuminate/Database/Connectors/ConnectionFactory.php 连接工厂类看看,发现 createReadWriteConnection...在执行 update() 操作时,我们最后进入了 laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php 这个对象中。.../framework/src/Illuminate/Database/Connection.php 中的 insert() 方法来执行。
一、Laravel ORM 概要 Illuminate database(Laravel ORM) 组件 在 GitHub 的地址 1.1 Laravel ORM 简介 Illuminate database...1.3 Laravel ORM 下载安装 git clone [email protected]:illuminate/database.git composer install 1.4 Laravel...ORM 目录结构 |---- vendor |---- composer composer 包管理生成的自动加载文件 |---- doctrine...symfony |---- composer.json composer 包管理配置文件 本系列重点解析 illuminate/database Laravel ORM 组件的分析,仅当有设计到其它组件时再做相关分析...二、 Laravel ORM 核心组件目录结构 前面我们大致了解了 Laravel ORM 系统整体的目录结构,本节我们重点走进 illuminate/database 文件夹,即 Laravel ORM
: /var/dev/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php:1264 => [64]...=> [128] [29260 (Loop 4252)] /var/dev/vendor/laravel/framework/src/Illuminate/Foundation/Application.php...29260 (Loop 4252)] /var/dev/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:403 =...:35 => [3280] [29260 (Loop 4252)] /var/dev/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars...这里举例看一下/var/dev/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:403 cat /var/dev/
源码中的处理逻辑 1) 找到/vendor/laravel/framework/src/Illuminate/View/Compilers/ViewServiceProvider.php 第134...2) 进入/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler .php 找到其父类 /vendor/laravel.../framework/src/Illuminate/View/Compilers/Compiler.php:51/vendor/laravel/framework/src/Illuminate/View.../Compilers/Compiler.php /vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php /vendor.../laravel/framework/src/Illuminate/View/Compilers/Compiler.php /vendor/laravel/framework/src/Illuminate
', 653, Array) #1 /home/web/vendor/laravel/lumen-framework/src/Application.php(653): class_alias('IlluminateSupp...', 'Event') #2 /home/web/vendor/laravel/lumen-framework/src/Application.php(631): LaravelLumenApplication...->withAliases(Array) #3 /home/web/vendor/laravel/lumen-framework/src/Application.php(766): LaravelLumenApplication...->withFacades(true) #4 /home/web/vendor/laravel/lumen-framework/src/Console/Kernel.php(54): LaravelLumenApplication...', Array) #8 /home/web/vendor/laravel/lumen-framework/src/Application.php(211): IlluminateContainerContainer
啃源码 我花了 5 分钟跟完源代码,发现它在 Illuminate\Http\Response 中有这么一段来完成 JSON 转化的: vendor/laravel/framework/src/Illuminate.../laravel/framework/src/Illuminate/Http/Response.php protected function shouldBeJson($content) {.../laravel/framework/src/Illuminate/Http/Response.php protected function morphToJson($content) { if...答案是可以: 在 Illuminate\Http\Resources\Json\JsonResource 中有一个 toResponse 方法: vendor/laravel/framework/src...的 toResponse 的方法做为返回值: vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceResponse.php
在 laravel/framework/src/Illuminate/Database/Connection.php 文件中,我们可以找到 insert() 、update()、delete() 这些方法...DB_CONNECTION_LARAVEL8=mysql DB_HOST_LARAVEL8=127.0.0.1 DB_PORT_LARAVEL8=3306 DB_DATABASE_LARAVEL8=laravel8...在使用 DB 门面的情况下,我们会通过服务容器注册门面并实例化一个 laravel/framework/src/Illuminate/Database/DatabaseManager.php 对象,它的.../framework/src/Illuminate/Database/Connectors/ConnectionFactory.php 对象。...接下来,调用它的 connect() 方法,这时我们会进入 laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php
Illuminate\Database\Query\Builder 调用方法去完成整个SQL。...这个文件在你项目目录中的 vendor/laravel/framework/src/Illuminate/Database/Query 下,你可以自行去查看。...门面直接调用 Illuminate\Database\DatabaseManager 类。...], 'db.connection' => [\Illuminate\Database\Connection::class, \Illuminate\Database...$parameters); } 转发,调用的是 Illuminate\Database\Connection ,用户处理 table()方法,随后会通过 table() 方法指向 Illuminate\
[ 'email_verified_at' => 'datetime', ]; } 我们修改的User实现了 MustVerifyEmailContract 接口 查看其源码 vendor.../laravel/framework/src/illuminate/Contracts/Auth/MustVerifyEmail laravel/framework/src/illuminate/Auth/MustVerifyEmail.php laravel/framework/src/illuminate/Foundation/Auth/RegistersUsers.php 我们主要看 register方法 public function.../laravel/framework/src/Illuminate/Auth/Listeners/SendEmailVerificationNotification.php 里面就一个handle方法
中已经实现的类 Collection类实现/vendor/laravel/framework/src/Illuminate/Support/Collection.php 据说:facade来源于法语,本质可以理解为外表高大上...$bootstrappers),注意这个bootstartps里面的数组对象是硬编码的(定义在BilibiiLaravel/vendor/laravel/framework/src/Illuminate.../Kernel.php->bootstrappers) 然后每个facades类中都会有个bootstrap方法,类似每个provider都会有个register方法一样~ 以下代码及注释,来自于 /vendor.../laravel/framework/src/Illuminate/Foundation/Application.php public function bootstrapWith(array $bootstrappers...他们在 /vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap中有具体体现.注意他需要一个参数这个参数就是
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel DB_USERNAME=root DB_PASSWORD=...// laravel/framework/src/Illuminate/Foundation/Application.php foreach ($bootstrappers as $bootstrapper.../framework/src/Illuminate/Foundation/Http/Kernel.php 中的类变量 // laravel/framework/src/Illuminate/Foundation...// laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadEnvironmentVariables.php $this->createDotenv...后面的文章也都会以这样的方式进行,需要注意的是,我们的源码都是在 vendor 目录下的,所以有的文章中这个路径我就没有写了。
Container 服务容器 打开 laravel/framework/src/Illuminate/Foundation/Application.php 文件,我们可以看到这个类继承的是一个叫做 Container.../laravel/framework/src/Illuminate/Foundation/Http/Kernel.php 的 handle() 方法之后继续查看 sendRequestThroughRouter...// vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php public function bootstrap() {.../laravel/framework/src/Illuminate/Foundation/Application.php 中的 bootstrapWith() 方法来加载这些预定义的服务提供者。.../laravel/framework/src/Illuminate/Foundation/Application.php 中的 registerConfiguredProviders() 方法。
上一节课我们学了laravel5.3的新特性 https://my.oschina.net/lilugirl2005/blog/787478 这节课主要讲一些laravel5.2的新特性在laravel5.3...相应的修改/database/factories/ModelFactory.php文件 $faker->userName可以生成不重复的假用户名 ?...按图索骥观察 vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php文件 ?...然后查看代码auth的路由定义代码 vendor/laravel/framework/src/Illuminate//Routing/Router.php ?...\Bus\Queueable; use Illuminate\Queue\SerializesModels; use Illuminate\Queue\InteractsWithQueue; use Illuminate