Learning Laravelfunction 48 Introduction 48 Remarks 48 Examples 48 document.php 48 HelpersServiceProvider.php 48 Use 49 Chapter 15: CustomException class in Laravel 50 Introduction 50 Examples 50 CustomException 143 Examples 143 Creating Policies 143 Chapter 48: Queues 144 Introduction 144 Examples 144 Use-cases 144 Queue Driver Configuration 144 sync 144 database 144 sqs 144 iron 145 redis 145 beanstalkd Catching all routes except already defined 154 Routes are matched in the order they are declared 155 Case-insensitive routes 155 Chapter 54: Seeding 157 Remarks 157 Examples 157 Inserting data 157 Using0 码力 | 216 页 | 1.58 MB | 1 年前3
Laravel 3.2 Documentationadded to your application. You can either download a bundle repository to your bundles directory or use the "Artisan" command-line tool to automatically install them. The Eloquent ORM is the most advanced applications. Reverse Routing allows you to create links to named routes. When creating links just use the route's name and Laravel will automatically insert the correct URI. This allows you to change and from loading unnecessary components when they won't be used. Want to use a library or model? Don't bother loading it, just use it. Laravel will handle the rest. View Composers are blocks of code0 码力 | 139 页 | 1.13 MB | 1 年前3
Laravel 5.0 Documentation
Container Events iii. Contracts i. Introduction ii. Why Contracts? iii. Contract Reference iv. How To Use Contracts iv. Facades i. Introduction ii. Explanation iii. Practical Usage iv. Creating Facades repository has no external dependencies. Having a convenient, centrally located set of interfaces you may use for decoupling and dependency injection will serve as an easy alternative option to Laravel Facades sample command: class PurchasePodcast extends Command implements SelfHandling, ShouldBeQueued { use SerializesModels; protected $user, $podcast; /** * Create a new command instance.0 码力 | 242 页 | 1.44 MB | 1 年前3
The Laravel Handbook
Introduction to Laravel 2. Getting started 3. Blade 4. Dynamic routes 5. Adding a database 6. How to use migrations to create and modify the database schema 7. Using forms to accept user input and store same level of Rails and Django. If you know/prefer Ruby you use Rails. If you know/prefer Python you use Django. If you know/prefer PHP you use Laravel. Generally speaking I mean, because each of those on how you installed PHP on your machine. Hopefully you haven’t any and we can go on. On macOS, use Homebrew (install Homebrew first if you haven’t already) and install both PHP and Composer using0 码力 | 111 页 | 14.25 MB | 1 年前3
Laravel 5.6 中文文档app/Broadcasting 目录下: php artisan make:channel OrderChannel 接下来,在 routes/channels.php 文件中注册这个频道类: use App\Broadcasting\OrderChannel; Broadcast::channel('order.{order}', OrderChannel::class); 最后,可以将频道的授权逻辑放到频道类的 方法。join 方法中的代码等同于之前位于频道授权闭包中的处理逻辑。当然,你还可以使用频道模 型绑定: use App\User; use App\Order; class OrderChannel { /** * Create a new channel instance. * Str::orderedUuid,orderedUuid 方法会生成一个时间戳最靠前的 UUID,通过诸如 MySQL 的数据库来索引,更简单,也更高效。两个方法都会返回 Ramsey\Uuid\Uuid 对象: use Illuminate\Support\Str; return (string) Str::uuid(); return (string) Str::orderedUuid(); Collision0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 5.3 中文文档到模型让模型变得可搜索: use Laravel\Scout\Searchable; use Illuminate\Database\Eloquent\Model; class Post extends Model { use Searchable; } trait 被添加到模型之后,当保存模型实例的时候其信息将会被同步到搜索索引: ,而不再需要在 闭包中自定义邮件信息,例如,你可以定义一个简单的邮寄对象用作欢迎邮件: class WelcomeMessage extends Mailable { use Queueable, SerializesModels; /** * Build the message. * * @return $this namespace App; use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable { use Notifiable; } 注 : 不0 码力 | 691 页 | 9.37 MB | 1 年前3
Laravel 5.1 中文文档之前验证被授予指定“角色”的认证用户,可以创建一个 RoleMiddleware 来接收角 色名称作为额外参数: use Closure; class RoleMiddleware { /** * 运行请求过滤器. * * @param \Illuminate\Http\Request 你可以通过在 VerifyCsrfToken 中间件中将要排除的 URIs 添加到$except 属性: use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Ba seVerifier; class VerifyCsrfToken extends OldMiddleware,在这个 中间件中,我们只允许提供的 age 大于 200 的访问路由,否则,我们将用户重定向到主页: use Closure; class OldMiddleware { /** * 返回请求过滤器 * * @param \Illuminate\Http\Request0 码力 | 307 页 | 3.46 MB | 1 年前3
Laravel 5.2 中文文档设你有一个路由 定义如下: 本文档由 Laravel 学院(LaravelAcademy.org)提供 Laravel 学院致力于提供优质 Laravel 中文学习资源 2 use App\User; Route::get('/user/{user}', function (User $user) { return $user; }); 在 Laravel 属性应该被更新为至少包含以下异常类型的其 中一个: use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Database\Eloquent\ModelNotFoundException; use Symfony\Component\HttpKernel\Exception\HttpException; use Illuminate\F 要实现这一目的,你需要在 VerifyCsrfToken 中间件中将要排除的 URL 添加 到 $except 属性: use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier; class VerifyCsrfToken extends0 码力 | 377 页 | 4.56 MB | 1 年前3
Laravel 6.0 中文文档Laravel 6.0 中,该业务逻辑可以被提取到任务中间件中,从而 将你的任务 handle 方法从频率限制中解放出来: use Illuminate\Support\Facades\Redis; 本文档由学院君提供 学院君致力于提供优质 Laravel 中文学习资源:https://xueyuanjun.com 6 class Redis::throttle('key') ->block(0)->allow(1)->every(5) ->then(function () use ($job, $next) { // Lock obtained... $next($job); }, function () use ($job) { // Could not obtain lock... $job->release(5); }); 学院君致力于提供优质 Laravel 中文学习资源:https://xueyuanjun.com 7 创建完中间件后,可以通过在任务类的 middleware 方法中返回中间 件数组来将其追加到队列任务中: use App\Jobs\Middleware\RateLimited; /** * Get the middleware the job should pass through. * * @return0 码力 | 1442 页 | 14.66 MB | 1 年前3
《Slides Dev Web》02. Introduction aux frameworks PHP
org/lang/fr/ 20 $ composer install puis use RedBeanPHP\Facade as R; Enfin, nous pouvons réduire le nombre de require et include à un seul, en 37http://www.php-fig.org/psr/psr-7/ 21 use function FastRoute\simpleDispatcher; use FastRouter\Dispatcher; $dispatcher = simpleDispatcher(function($r) { $r->addRoute('GET' case Dispatcher::NOT_FOUND: case Dispatcher::METHOD_NOT_ALLOWED: 22 /* ... */break; case Dispatcher::FOUND: try { echo call_user_func_array( $routeInfo[1]0 码力 | 24 页 | 1.03 MB | 1 年前3
共 14 条
- 1
- 2













