Laravel 5.0 Documentation
Introduction ii. Basic Controllers iii. Controller Middleware iv. Implicit Controllers v. RESTful Resource Controllers vi. Dependency Injection & Controllers vii. Route Caching iv. Requests i. Obtaining Controllers Introduction Basic Controllers Controller Middleware Implicit Controllers RESTful Resource Controllers Dependency Injection & Controllers Route Caching Requests Obtaining A Request Instance Middleware Introduction Basic Controllers Controller Middleware Implicit Controllers RESTful Resource Controllers Dependency Injection & Controllers Route Caching Instead of defining all of your0 码力 | 242 页 | 1.44 MB | 1 年前3Learning Laravel
41 Basic Controllers 41 Controller Middleware 41 Resource Controller 42 Example of how a Resource Controller look 42 Actions Handled By Resource Controller 44 Chapter 12: Cron basics 45 Introduction Using Gates Gates are closures that determine if a user is allowed to perform a certain action on a resource. Gates are typically defined in the boot method of AuthServiceProvider and succinctly named to for you. Policies Policies are classes that help you organise authorisation logic around a model resource. Using our previous example, we might have a ContentPolicy that manages user access to the Content0 码力 | 216 页 | 1.58 MB | 1 年前3Laravel 5.6 中文文档
You are not allowed to access this resource! @endcomponent 或者,如果组件没有额外插槽,可以使用组件别名作为 Blade 指令: @alert You are not allowed to access this resource! @endalert Argon2 密码哈希 如果你在构建一个基于 PHP 请求,使用 Artisan 命令 make:controller,我们可以快速创建这样的控制器: php artisan make:controller PostController --resource 该 Artisan 命令将会生成一个控制器文件 app/Http/Controllers/PostController.php,这个控制器包含了每一个资源操作对应的方法: resource. 本文档由 Laravel 学院提供 Laravel 学院致力于提供优质 Laravel 中文学习资源:http://laravelacademy.org 650 码力 | 377 页 | 14.56 MB | 1 年前3Laravel 6.0 中文文档
请求,使用 Artisan 命 令 make:controller,我们可以快速创建这样的控制器: php artisan make:controller PostController --resource 该 Artisan 命令将会生成一个控制器文 件 app/Http/Controllers/PostController.php,这个控制器包 含了每一个资源操作对应的方法: 本文档由学院君提供 /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response } 本文档由学院君提供 学院君致力于提供优质 Laravel 中文学习资源:https://xueyuanjun.com 230 /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response0 码力 | 1442 页 | 14.66 MB | 1 年前3Laravel 5.3 中文文档
29 路由 资源路由参数默认是单数 之前版本的 Laravel 中,使用 Route::resource 注册的路由参数并没有“单数化”,这可能会在注册 路由模型绑定的时候引起一些非预期的行为,例如,给定如下 Route::resource 调用: Route::resource('photos', 'PhotoController'); show 路由的 URI 将会定义如下: 将会定义如下: /photos/{photos} 在 Laravel 5.3 中,所有资源路由参数默认都是单数化的,因此,同样调用 Route::resource,将 会注册 URI 如下: /photos/{photo} 如 果 你 想 要 继 续 维 护 之 前 版 本 的 行 为 而 不 是 自 动 单 数 化 资 源 路 由 参 数 , 可 以 在 AppServiceProvider Route::resource 的时候 URI 前缀将不再影响分配给路由的路由名称,如果在 Route::group 中使用 Route::resource 时调用了指定的 prefix 选项,则需要检查所有对 route 辅助函数的调 用以验证不再追加 URI 的 prefix 到路由名称。 如果这一改动导致同一名称下有两个路由,可以在调用 Route::resource 的时候使用 names0 码力 | 691 页 | 9.37 MB | 1 年前3Laravel 5.1 中文文档
app/Http/Controllers/PhotoController.php,这 个控制器包含了每一个资源操作对应的方法。 接下来,可以为该控制器注册一个资源型的路由: Route::resource('photo', 'PhotoController'); 这个路由声明创建了处理图片资源 RESTful 动作的多个路由,同样的,生成的控制器也已 经为这些动作设置了对应的处理方法。 4.2 只定义部分资源路由 声明资源路由时可以指定该路由处理的动作子集: Route::resource('photo', 'PhotoController', ['only' => ['index', 'show']]); Route::resource('photo', 'PhotoController', ['except' Route::resource('photo', 'PhotoController', ['names' => ['create' => 'photo.build']]); 4.4 嵌套资源 有时候我们需要定义路由到“嵌套”资源。例如,一个图片资源可能拥有多条“评论”,要“嵌套” 资源控制器,在路由声明中使用“.”号即可: Route::resource('photos0 码力 | 307 页 | 3.46 MB | 1 年前3Laravel 5.2 中文文档
make:controller PhotoController --resource 该 Artisan 命令将会生成一个控制器文件 app/Http/Controllers/PhotoController.php, 这个控制器包含了每一个资源操作对应的方法。 接下来,可以为该控制器注册一个资源路由: Route::resource('photo', 'PhotoController'); 中文学习资源 40 只定义部分资源路由 声明资源路由时可以指定该路由处理的动作子集: Route::resource('photo', 'PhotoController', ['only' => ['index', 'show']]); Route::resource('photo', 'PhotoController', ['except' => ['create', 'store' Route::resource('photo', 'PhotoController', ['names' => ['create' => 'photo.build']]); 补充资源控制器 如果有必要在默认资源路由之外添加额外的路由到资源控制器,应该在调 用 Route::resource 之前定义这些路由;否则,通过 resource 方法定义的路由可能无意0 码力 | 377 页 | 4.56 MB | 1 年前3The Laravel Handbook
protected $fillable = ['name']; } A model is a resource, and once you define a model you’ll later be able to create a new resource, delete, update it. Now let’s build a form to add a new dog0 码力 | 111 页 | 14.25 MB | 1 年前3《Slides Dev Web》 09. Services Web
– orientée service2 : atome : service (traitement) : RPC (SOAP) 1https://en.wikipedia.org/wiki/Resource-oriented_architecture 2https://fr.wikipedia.org/wiki/Architecture_orient%C3%A9e_services 1 Service0 码力 | 6 页 | 47.90 KB | 1 年前3
共 9 条
- 1