 Laravel 5.2 中文文档sitory; class UserController extends Controller { /** * The user repository instance. */ protected $users; /** * 创建新的控制器实例 * * @param UserRepository ('FooBar', function ($app) { return new FooBar($app['SomethingElse']); }); 绑定实例 你还可以使用 instance 方法绑定一个已存在的对象实例到容器,随后对容器的调用将总是 返回给定的实例: $fooBar = new FooBar(new SomethingElse); 本文档由 Laravel Laravel 学院(LaravelAcademy.org)提供 Laravel 学院致力于提供优质 Laravel 中文学习资源 77 $this->app->instance('FooBar', $fooBar); 绑定接口到实现 服务容器的一个非常强大的特性是其绑定接口到实现的能力。我们假设有一 个 EventPusher 接口及其 RedisEventPusher 实现,编写完该接口的0 码力 | 377 页 | 4.56 MB | 1 年前3 Laravel 5.2 中文文档sitory; class UserController extends Controller { /** * The user repository instance. */ protected $users; /** * 创建新的控制器实例 * * @param UserRepository ('FooBar', function ($app) { return new FooBar($app['SomethingElse']); }); 绑定实例 你还可以使用 instance 方法绑定一个已存在的对象实例到容器,随后对容器的调用将总是 返回给定的实例: $fooBar = new FooBar(new SomethingElse); 本文档由 Laravel Laravel 学院(LaravelAcademy.org)提供 Laravel 学院致力于提供优质 Laravel 中文学习资源 77 $this->app->instance('FooBar', $fooBar); 绑定接口到实现 服务容器的一个非常强大的特性是其绑定接口到实现的能力。我们假设有一 个 EventPusher 接口及其 RedisEventPusher 实现,编写完该接口的0 码力 | 377 页 | 4.56 MB | 1 年前3
 Laravel 5.6 中文文档use App\User; use App\Order; class OrderChannel { /** * Create a new channel instance. * * @return void */ public function __construct() { // * @var UserRepository */ protected $users; /** * Create a new controller instance. * * @param UserRepository $users * @return void 本文档由 Laravel 学院提供 HelpSpot\API($app->make('HttpClient')); }); 绑定实例 你还可以使用 instance 方法绑定一个已存在的对象实例到容器,随后调用容器将总是返回给定的实例: $api = new HelpSpot\API(new HttpClient); $this->app->instance('HelpSpot\Api', $api); 绑定原始值 你可能有一个接收注入类的类0 码力 | 377 页 | 14.56 MB | 1 年前3 Laravel 5.6 中文文档use App\User; use App\Order; class OrderChannel { /** * Create a new channel instance. * * @return void */ public function __construct() { // * @var UserRepository */ protected $users; /** * Create a new controller instance. * * @param UserRepository $users * @return void 本文档由 Laravel 学院提供 HelpSpot\API($app->make('HttpClient')); }); 绑定实例 你还可以使用 instance 方法绑定一个已存在的对象实例到容器,随后调用容器将总是返回给定的实例: $api = new HelpSpot\API(new HttpClient); $this->app->instance('HelpSpot\Api', $api); 绑定原始值 你可能有一个接收注入类的类0 码力 | 377 页 | 14.56 MB | 1 年前3
 Laravel 5.3 中文文档学院致力于提供优质 Laravel 中文学习资源 72 protected $users; /** * Create a new controller instance. * * @param UserRepository $users * @return void */ public FooBar($app->make('HttpClient')); }); 绑定实例 你还可以使用 instance 方法绑定一个已存在的对象实例到容器,随后 调用 容器将总是返回给 定的实例: $api = new HelpSpot\API(new HttpClient); $this->app->instance('HelpSpot\Api', $api); 绑定原始值 你可能有一个接收 Illuminate\Encryption\Encrypter encrypter DB Illuminate\Database\DatabaseManager db DB (Instance) Illuminate\Database\Connection Event Illuminate\Events\Dispatcher events File Illumi0 码力 | 691 页 | 9.37 MB | 1 年前3 Laravel 5.3 中文文档学院致力于提供优质 Laravel 中文学习资源 72 protected $users; /** * Create a new controller instance. * * @param UserRepository $users * @return void */ public FooBar($app->make('HttpClient')); }); 绑定实例 你还可以使用 instance 方法绑定一个已存在的对象实例到容器,随后 调用 容器将总是返回给 定的实例: $api = new HelpSpot\API(new HttpClient); $this->app->instance('HelpSpot\Api', $api); 绑定原始值 你可能有一个接收 Illuminate\Encryption\Encrypter encrypter DB Illuminate\Database\DatabaseManager db DB (Instance) Illuminate\Database\Connection Event Illuminate\Events\Dispatcher events File Illumi0 码力 | 691 页 | 9.37 MB | 1 年前3
 Laravel 6.0 中文文档更新为接收数据表别名作为第二个参数,如果你在 Laravel 应用之 外使用了 illuminate/database,需要更新相应的方法调用: /** * Get a fluent query builder instance. * * @param \Closure|\Illuminate\Database\Query\Builde r|string $table * @param string|null 不再约束或验证密码。因为密码验证逻辑已经 由 ResetPasswordController 控制器处理,导致 broker 的验证逻 辑变得冗余,并且不能被自定义,如果你在内置 的 ResetPasswordController 之外使用了 PasswordBroker 或 者 Password 门面,需要在传递它们到 broker 之前先验证它们。 队列 本文档由学院君提供 学院君致力于提供优质 Laravel 本文档由学院君提供 学院君致力于提供优质 Laravel 中文学习资源:https://xueyuanjun.com 120 /** * Create a new controller instance. * * @param UserRepository $users * @return void */ public function __construct(UserRepository0 码力 | 1442 页 | 14.66 MB | 1 年前3 Laravel 6.0 中文文档更新为接收数据表别名作为第二个参数,如果你在 Laravel 应用之 外使用了 illuminate/database,需要更新相应的方法调用: /** * Get a fluent query builder instance. * * @param \Closure|\Illuminate\Database\Query\Builde r|string $table * @param string|null 不再约束或验证密码。因为密码验证逻辑已经 由 ResetPasswordController 控制器处理,导致 broker 的验证逻 辑变得冗余,并且不能被自定义,如果你在内置 的 ResetPasswordController 之外使用了 PasswordBroker 或 者 Password 门面,需要在传递它们到 broker 之前先验证它们。 队列 本文档由学院君提供 学院君致力于提供优质 Laravel 本文档由学院君提供 学院君致力于提供优质 Laravel 中文学习资源:https://xueyuanjun.com 120 /** * Create a new controller instance. * * @param UserRepository $users * @return void */ public function __construct(UserRepository0 码力 | 1442 页 | 14.66 MB | 1 年前3
 Laravel 5.0 Documentation
vi. Dependency Injection & Controllers vii. Route Caching iv. Requests i. Obtaining A Request Instance ii. Retrieving Input iii. Old Input iv. Cookies v. Files vi. Other Request Information v. use SerializesModels; protected $user, $podcast; /** * Create a new command instance. * * @return void Authentication Scaffolding Event Objects Commands / Queueing } When the Laravel IoC container identifies that the class it is injecting is a FormRequest instance, the request will automatically be validated. This means that if your controller action is called0 码力 | 242 页 | 1.44 MB | 1 年前3 Laravel 5.0 Documentation
vi. Dependency Injection & Controllers vii. Route Caching iv. Requests i. Obtaining A Request Instance ii. Retrieving Input iii. Old Input iv. Cookies v. Files vi. Other Request Information v. use SerializesModels; protected $user, $podcast; /** * Create a new command instance. * * @return void Authentication Scaffolding Event Objects Commands / Queueing } When the Laravel IoC container identifies that the class it is injecting is a FormRequest instance, the request will automatically be validated. This means that if your controller action is called0 码力 | 242 页 | 1.44 MB | 1 年前3
 Learning LaravelChapter 39: Macros In Eloquent Relationship 128 Introduction 128 Examples 128 We can fetch one instance of hasMany relationship 128 Chapter 40: Mail 129 Examples 129 Basic example 129 Chapter 41: Examples 147 Getting input 147 Chapter 51: Requests 148 Examples 148 Obtain an Instance of HTTP Request 148 Request Instance with other Parameters from routes in controller method 148 Chapter 52: Route Chapter 56: Services 166 Examples 166 Binding an Interface To Implementation 166 Binding an Instance 166 Binding a Singleton to the Service Container 166 Introduction 167 Using the Service Container0 码力 | 216 页 | 1.58 MB | 1 年前3 Learning LaravelChapter 39: Macros In Eloquent Relationship 128 Introduction 128 Examples 128 We can fetch one instance of hasMany relationship 128 Chapter 40: Mail 129 Examples 129 Basic example 129 Chapter 41: Examples 147 Getting input 147 Chapter 51: Requests 148 Examples 148 Obtain an Instance of HTTP Request 148 Request Instance with other Parameters from routes in controller method 148 Chapter 52: Route Chapter 56: Services 166 Examples 166 Binding an Interface To Implementation 166 Binding an Instance 166 Binding a Singleton to the Service Container 166 Introduction 167 Using the Service Container0 码力 | 216 页 | 1.58 MB | 1 年前3
 Laravel 3.2 Documentationthe controller is registered in the container, and if it is, will use the container to resolve an instance of the controller. Note: Before diving into controller dependency injection, you may wish to read receive the class name of the controller that needs to be resolved. All you need to do is return an instance of the controller. MODELS & LIBRARIES Models Models are the heart of your application. Your a model are:  Database Interactions  File I/O  Interactions with Web Services For instance, perhaps you are writing a blog. You will likely want to have a "Post" model. Users may want to0 码力 | 139 页 | 1.13 MB | 1 年前3 Laravel 3.2 Documentationthe controller is registered in the container, and if it is, will use the container to resolve an instance of the controller. Note: Before diving into controller dependency injection, you may wish to read receive the class name of the controller that needs to be resolved. All you need to do is return an instance of the controller. MODELS & LIBRARIES Models Models are the heart of your application. Your a model are:  Database Interactions  File I/O  Interactions with Web Services For instance, perhaps you are writing a blog. You will likely want to have a "Post" model. Users may want to0 码力 | 139 页 | 1.13 MB | 1 年前3
 Laravel 5.1 中文文档rRepository; class UserController extends Controller { /** * The user repository instance. */ protected $users; /** * 创建新的控制器实例 * * @param UserRepository FooBar($app['SomethingElse']); }); 绑定实例 你还可以使用 instance 方法绑定一个已存在的对象实例到容器,随后对容器的调用将总是 返回给定的实例: $fooBar = new FooBar(new SomethingElse); $this->app->instance('FooBar', $fooBar); 2.1 绑定接口到实现 服务容器的一 Artisan Illuminate\Console\Application artisan Auth Illuminate\Auth\AuthManager auth Auth (Instance) Illuminate\Auth\Guard Blade Illuminate\View\Compilers\BladeCompiler blade.compiler Bus0 码力 | 307 页 | 3.46 MB | 1 年前3 Laravel 5.1 中文文档rRepository; class UserController extends Controller { /** * The user repository instance. */ protected $users; /** * 创建新的控制器实例 * * @param UserRepository FooBar($app['SomethingElse']); }); 绑定实例 你还可以使用 instance 方法绑定一个已存在的对象实例到容器,随后对容器的调用将总是 返回给定的实例: $fooBar = new FooBar(new SomethingElse); $this->app->instance('FooBar', $fooBar); 2.1 绑定接口到实现 服务容器的一 Artisan Illuminate\Console\Application artisan Auth Illuminate\Auth\AuthManager auth Auth (Instance) Illuminate\Auth\Guard Blade Illuminate\View\Compilers\BladeCompiler blade.compiler Bus0 码力 | 307 页 | 3.46 MB | 1 年前3
共 8 条
- 1













