Laravel 5.0 Documentation
Folder Structure Contracts Route Cache Route Middleware Controller Method Injection public function createPost(Request $request, PostRepository $posts) { // } User registration, authentication example, check out the following event: class PodcastWasPurchased { public $podcast; public function __construct(Podcast $podcast) { $this->podcast = $podcast; } } The event may be will receive the event object instead of a list of data: class ReportPodcastPurchase { public function handle(PodcastWasPurchased $event) { // } } For more information on working with0 码力 | 242 页 | 1.44 MB | 1 年前3
Learning Laravelvariable 20 Echoing an element in an array 20 Echoing an object property 21 Echoing the result of a function call 21 Checking for Existence 21 Raw echos 21 Including Partial Views 21 Layout Inheritance Cross Domain Request 46 Examples 46 Introduction 46 CorsHeaders 46 Chapter 14: Custom Helper function 48 Introduction 48 Remarks 48 Examples 48 document.php 48 HelpersServiceProvider.php 48 Use Run the migrations. * * @return void */ public function up() { Schema::create('admins', function (Blueprint $table) { $table->increments('id');0 码力 | 216 页 | 1.58 MB | 1 年前3
Laravel 5.1 中文文档@param \Closure $next * @param string $role * @return mixed */ public function handle($request, Closure $next, $role) { if (! $request->user()->hasRole($role)) { 更多关于中间件的内容,请查看中间件一节。 测试革新 Laravel 中内置的测试功能获得了引入注目的提升,多个新方法提供了平滑的,富有变现力 的接口和应用进行交互并测试响应: public function testNewUserRegistration(){ $this->visit('/register') ->type('Taylor', 'name') 模型定义一系列默认属性,然后为测试或数据库填充生成模型实例。 模型工厂还可以利用强大的 PHP 扩展库 Faker 类生成随机的属性数据。 $factory->define('App\User', function ($faker) { return [ 'name' => $faker->name, 'email' => $faker->email,0 码力 | 307 页 | 3.46 MB | 1 年前3
Laravel 5.6 中文文档中文学习资源:http://laravelacademy.org 2 Route::middleware('auth:api', 'throttle:60,1')->group(function () { Route::get('/user', function () { // }); }); 在 Laravel 5.6 中,你可以基于认证用户模型属性指定一个动态的最大请求次数,如果 中间件,以便用于计算最大请求次数计数: Route::middleware('auth:api', 'throttle:rate_limit,1')->group(function () { Route::get('/user', function () { // }); }); 广播频道类 如果你的应用消费多个不同的频道,routes/channels.php /** * Create a new channel instance. * * @return void */ public function __construct() { // } /** * Authenticate the user's access to the0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 5.2 中文文档org)提供 Laravel 学院致力于提供优质 Laravel 中文学习资源 2 use App\User; Route::get('/user/{user}', function (User $user) { return $user; }); 在 Laravel 5.1 中,你需要通过 Route::model 方法告诉 Laravel 注入 App\User 'throttle:60,1', ], ]; 然后,web 组像这样分配给路由: Route::group(['middleware' => ['web']], function () { // }); 访问频率限制 一个新的访问频率限制中间件已经被内置到框架中,从而允许你轻松限制给定 IP 地址在 指定时间内对某个路由发起请求的数目。例如,要限制某个 制某个 IP 地址每分钟只能访问某个 路由 60 次,你可以这么做: Route::get('/api/users', ['middleware' => 'throttle:60,1', function () { // }]); 数组输入验证 在 Laravel 5.2 可轻松实现表单字段的数组输入验证。例如,要验证给定数组输入字段中 的每一个 email 是唯一的,可以这么实现:0 码力 | 377 页 | 4.56 MB | 1 年前3
Laravel 6.0 中文文档判断用户是否可以查看指定的航班. * * @param \App\User $user * @param \App\Flight $flight * @return mixed */ public function view(User $user, Flight $flight) { return $this->deny('Explanation of denial.'); } 本文档由学院君提供 * @return void */ public function handle() { Redis::throttle('key')->block(0)->allow(1)->every (5)->then(function () { info('Lock obtained...'); // 处理任务... }, function () { // 无法获取到锁... return */ public function handle($job, $next) { Redis::throttle('key') ->block(0)->allow(1)->every(5) ->then(function () use ($job, $next) { // Lock obtained... $next($job); }, function () use ($job)0 码力 | 1442 页 | 14.66 MB | 1 年前3
Laravel 5.3 中文文档升: /* * Authenticate the channel subscription... */ Broadcast::channel('orders.*', function ($user, $orderId) { return $user->placedOrder($orderId); }); Laravel Echo,通过 NPM 安装的全新的 status', ]); 此外,Passport 还包含了用于验证访问令牌认证请求包含必要令牌域的中间件: Route::get('/orders/{order}/status', function (Order $order) { // Access token has "check-status" scope... })->middleware('scope:check-status'); /** * Build the message. * * @return $this */ public function build() 本文档由 Laravel 学院(LaravelAcademy.org)提供 Laravel 学院致力于提供优质 Laravel 中文学习资源 90 码力 | 691 页 | 9.37 MB | 1 年前3
Laravel 3.2 DocumentationDOCUMENTATION The Basics Welcome to the Laravel documentation. These documents were designed to function both as a getting-started guide and as a feature reference. Even though you may jump into any first parameter is the route that you're "registering" with the router. The second parameter is the function containing the logic for that route. Routes are defined without a front-slash. The only exception /": Route::get('/', function() { return "Hello World!"; }); Registering a route that is valid for any HTTP verb (GET, POST, PUT, and DELETE): Route::any('/', function() { return "Hello0 码力 | 139 页 | 1.13 MB | 1 年前3
The Laravel Handbook
options in config files, like the ones you see above, make use of the env() Laravel helper function to get the environment variable. While options stored directly in the config folder hardcoded using the GET HTTP method (the one used when you open the page in the browser): Route::get('/', function () { return view('welcome'); }); To do this we use the view() Laravel helper, which that URL! Now let’s add a second page. In routes/web.php , add: //... Route::get('/test', function () { return view('welcome'); }); This will render the welcome view also when the /test0 码力 | 111 页 | 14.25 MB | 1 年前3
《Slides Dev Web》 05. JavaScript & DOM
const et let • Types : – Primitifs : Boolean Null Undefined Number String Symbol – Objets : Object Function • Particularités – Prototypes18 – Fermetures19 – Promesses20 (MDN21, Google22) Fonctions • valeur • Sans retour, valeur spéciale : undefined • Pas de surcharge (la dernière définie prime) • function est un type • Fonctions imbriquées, anonymes • Fonctions globales : 16http://www.howtogeek.com Script/Guide/Le_mod%C3%A8le_objet_JavaScript_en_d%C3%A9tai ls 19http://www.w3schools.com/js/js_function_closures.asp 20https://www.promisejs.org/ 21https://developer.mozilla.org/en/docs/Web/JavaScrip0 码力 | 10 页 | 91.95 KB | 1 年前3
共 13 条
- 1
- 2













