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 年前3Laravel 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 年前3Laravel 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 年前3Laravel 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 年前3Laravel 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 年前3Falcon v3.0.0-b2 Documentation
= ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError, StorageError status = falcon.HTTP_201 resp.location = '/%s/things/%s' % (user_id, proper_thing['id']) # The app instance is an ASGI callable app = falcon.asgi.App(middleware=[ # AuthMiddleware(), RequireJSON(), JSONTranslator() = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError, StorageError0 码力 | 340 页 | 1.15 MB | 1 年前3Falcon v3.0.0 Documentation
= ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError, StorageError status = falcon.HTTP_201 resp.location = '/%s/things/%s' % (user_id, proper_thing['id']) # The app instance is an ASGI callable app = falcon.asgi.App(middleware=[ # AuthMiddleware(), RequireJSON(), JSONTranslator() = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError, StorageError0 码力 | 344 页 | 1.16 MB | 1 年前3Falcon v3.0.1 Documentation
= ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError, StorageError status = falcon.HTTP_201 resp.location = '/%s/things/%s' % (user_id, proper_thing['id']) # The app instance is an ASGI callable app = falcon.asgi.App(middleware=[ # AuthMiddleware(), RequireJSON(), JSONTranslator() = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError, StorageError0 码力 | 344 页 | 1.16 MB | 1 年前3Falcon v3.1.1-b3 Documentation
= ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError, StorageError Documentation Falcon Documentation, Release 3.1.1b3 (continued from previous page) # The app instance is an ASGI callable app = falcon.asgi.App( middleware=[ # AuthMiddleware(), RequireJSON(), JSONTranslator() = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError, StorageError0 码力 | 378 页 | 1.29 MB | 1 年前3Falcon v3.1.1-b1 Documentation
= ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError, StorageError Documentation Falcon Documentation, Release 3.1.1b1 (continued from previous page) # The app instance is an ASGI callable app = falcon.asgi.App( middleware=[ # AuthMiddleware(), RequireJSON(), JSONTranslator() = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError, StorageError0 码力 | 378 页 | 1.29 MB | 1 年前3
共 67 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7