Laravel 5.0 Documentation
Practical Applications vii. Container Events iii. Contracts i. Introduction ii. Why Contracts? iii. Contract Reference iv. How To Use Contracts iv. Facades i. Introduction ii. Explanation iii directory. All major Laravel components implement interfaces which are located in the illuminate/contracts repository. This repository has no external dependencies. Having a convenient, centrally located injection will serve as an easy alternative option to Laravel Facades. For more information on contracts, consult the full documentation. If your application is made up entirely of controller routes,0 码力 | 242 页 | 1.44 MB | 1 年前3
Laravel 5.1 中文文档Controller 类中的 formatValidationErrors 方法,需要将类型提示由 Illuminate\Validation\Validator 改为 Illuminate\Contracts\Validation\Validator。 Eloquent create 方法 Eloquent 的 create 方法现在可以不传入任何参数进行调用,如果你在模型中要重写 create 中间件中的路由过滤器 Illuminate\Contracts\Routing\Middleware,中间件中不再需要任何 contract, Illuminate\Contracts\Routing\TerminableMiddleware 被废弃,在中间件中定义一个 terminate 方法替代实现该接口。 Illuminate\Contracts\Queue\ShouldBeQueued d 被废弃,使 用 Illuminate\Contracts\Queue\ShouldQueue Iron.io “推入队列” 被废弃, 使用 Iron.io 队列和队列监听器. Illuminate\Foundation\Bus\DispatchesCommands trait 被废弃并被重命名为 Illuminate\Foundation\Bus\DispatchesJobs0 码力 | 307 页 | 3.46 MB | 1 年前3
Laravel 5.6 中文文档类型提示作为依赖注入,需要 更新该类的引用为新的类名。或者,作为替代方案,你可以考虑将类型提示调整为标准的 Psr\Log\LoggerInterface 接口。 Illuminate\Contracts\Logging\Log 接口 该接口已经被移除,因为它和 Psr\Log\LoggerInterface 接口完全重合,需要将引用它的地方都调整为 Psr\Log\LoggerInterface 'App\Contracts\EventPusher', 'App\Services\RedisEventPusher' ); 这段代码告诉容器当一个类需要 EventPusher 的实现时将会注入 RedisEventPusher,现在我们可以在构造器或者任何其它通过服务容器注入依赖 的地方进行 EventPusher 接口的依赖注入: use App\Contracts\EventPusher; $this->pusher = $pusher; } 上下文绑定 有时侯我们可能有两个类使用同一个接口,但我们希望在每个类中注入不同实现,例如,两个控制器依 赖 Illuminate\Contracts\Filesystem\Filesystem 契约的不同实现。Laravel 为此定义了简单、平滑的接口: use Illuminate\Support\Facades\Storage;0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 6.0 中文文档function __construct($allowed, $message = '', $code = null) Illuminate\Contracts\Auth\Access\Gate 契约 影响级别:低 Illuminate\Contracts\Auth\Access\Gate 契约新增了一个新 的 inspect 方法声明,如果你自行实现过该接口,需要添加这个方 法的实现。 Carbon $post->user->update(['foo' => 'bar']); 数组化 & toArray 影响级别:中等 Eloquent 模型的 toArray 方法现在会将任何实现 了 Illuminate\Contracts\Support\Arrayable 接口的属性转化 为数组。 主键类型声明 影响级别:中等 Laravel 6.0 对整型键类型进行了性能优化,如果你使用了字符串作 为模型的主键,需要使用模型类的 学院君致力于提供优质 Laravel 中文学习资源:https://xueyuanjun.com 19 MustVerifyEmail 契约 影响级别:低 Illuminate\Contracts\Auth\MustVerifyEmail 契约中新增 了 getEmailForVerification 方法声明,如果你自行实现过该契 约,需要添加该方法的实现。这个方法应该返回与对象关联的邮箱地0 码力 | 1442 页 | 14.66 MB | 1 年前3
Laravel 5.3 中文文档................................................................................... 84 4.4 契约(Contracts) .............................................................................................. RedisEventPusher ,编写完该接口的 RedisEventPusher 实现后,就可以将其注册到服务容 器: $this->app->bind( 'App\Contracts\EventPusher', 'App\Services\RedisEventPusher' ); 这段代码告诉容器当一个类需要 EventPusher 的实现时将会注入 的实现时将会注入 RedisEventPusher,现在我们可 以在构造器或者任何其它通过服务容器注入依赖的地方进行 EventPusher 接口的依赖注入: use App\Contracts\EventPusher; /** * 创建一个新的类实例 * * @param EventPusher $pusher * @return void */ public function0 码力 | 691 页 | 9.37 MB | 1 年前3
Laravel 5.2 中文文档email 配置项,由于在 Laravel 5.2 对 email 视图路径有所改动,因此要确保该视图路径与应用实际的路径相匹 配,如果不匹配的话要更新该配置值。 Contracts 如果你实现了 Illuminate\Contracts\Auth\Authenticatable 契约但没有使 用 Authenticatable trait,那么需要添加一个新的 getAuthIdentifierName getAuthIdentifierName 方法到该契约 实现类。通常,该方法返回认证实体的主键字段名,如:id。 这对你的应用没有什么影响,除非你手动实现 了 Illuminate\Contracts\Auth\Authenticatable。 自定义驱动 如果你使用了 Auth::extend 方法自定义获取用户的方法,现在需要使 用 Auth::provider 来自定义用户提供者。一旦你自定义了提供者,就要在新 的 auth 手动捕获该异常, 那么这对之前的代码没有影响。 废弃 下面这些功能在 Laravel 5.2 中被废弃,在 Laravel 5.3 中会被彻底移除: Illuminate\Contracts\Bus\SelfHandling 契约 集合的 lists 方法被重命名为 pluck 方法。 隐式控制器路由 Route::controller 被废弃。在路由文件中请使用明确的路由注0 码力 | 377 页 | 4.56 MB | 1 年前3
Falcon v2.0.0 Documentationstatic resources and responders would be impractical. For example, you might use a sink to create a smart proxy that forwards requests to one or more backend services. Parameters • sink (callable) – A callable they don’t support. This helps overridden router logic be less fragile in terms of their interface contracts, which also makes it easier to keep Falcon backwards-compatible in the face of any future changes0 码力 | 184 页 | 671.87 KB | 1 年前3
Learning Laravelhave App/Http/ViewComposers/SomeComposer.php with: https://riptutorial.com/ 24 use Illuminate\Contracts\View\View; class SomeComposer { public function compose(View $view) { $v to interact with any of your configured disks. Alternatively, you may type-hint the Illuminate\Contracts\Filesystem\Factory contract on any class that is resolved via the Laravel service container. Retrieving DropboxFilesystemServiceProvider. In the provider's boot method, you can inject an instance of the Illuminate\Contracts\Filesystem\Factory contract and call the extend method of the injected instance. Alternatively0 码力 | 216 页 | 1.58 MB | 1 年前3
Falcon v2.0.0 Documentationstatic resources and responders would be impractical. For example, you might use a sink to create a smart proxy that forwards requests to one or more backend services. Parameters: sink (callable) – A callable they don’t support. This helps overridden router logic be less fragile in terms of their interface contracts, which also makes it easier to keep Falcon backwards-compatible in the face of any future changes0 码力 | 265 页 | 299.57 KB | 1 年前3
Falcon v3.0.0-b2 Documentationstatic resources and responders would be impractical. For example, you might use a sink to create a smart proxy that forwards requests to one or more backend services. Parameters 5.4. Framework Reference static resources and responders would be impractical. For example, you might use a sink to create a smart proxy that forwards requests to one or more backend services. Parameters • sink (callable) – A callable they don’t support. This helps overridden router logic be less fragile in terms of their interface contracts, which also makes it easier to keep Falcon backwards-compatible in the face of any future changes0 码力 | 340 页 | 1.15 MB | 1 年前3
共 58 条
- 1
- 2
- 3
- 4
- 5
- 6













