Learning LaravelChecking for Existence 21 Raw echos 21 Including Partial Views 21 Layout Inheritance 22 Sharing data to all views 24 Using View::share 24 Using View::composer 24 Closure-based composer 24 Class-based Database Seeding 60 Examples 60 Running a Seeder 60 Creating a Seed 60 Inserting Data using a Seeder 60 Inserting data with a Model Factory 61 Seeding with MySQL Dump 61 Using faker And ModelFactories 157 Examples 157 Inserting data 157 Using the DB Facade 157 Via Instantiating a Model 157 Using the create method 157 Using factory 158 Seeding && deleting old data and reseting auto-increment 1580 码力 | 216 页 | 1.58 MB | 1 年前3
Laravel 5.6 中文文档test 在终端 ping 一下任意 *.test 域名,如果 Valet 安装正确就会看到来自 127.0.0.1 的响 应: PING foobar.dev (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.069 ms 64 bytes from 127.0.0.1: icmp_seq=1 命令),这取决于进入应用的请求类型。这两个内核是所 有请求都要经过的中央处理器,现在,就让我们聚焦在位于 app/Http/Kernel.php 的 HTTP 内核。 HTTP 内核继承自 Illuminate\Foundation\Http\Kernel 类,该类定义了一个 bootstrappers 数组,这个数组中的类在请求被执行前运行,这 些 bootstrappers 配置了错误处理、日志、检测应用环境以及其它在请求被处理前需要执行的任务。 use App\Podcast; use Tests\TestCase; use Facades\App\Contracts\Publisher; use Illuminate\Foundation\Testing\RefreshDatabase; class PodcastTest extends TestCase { use RefreshDatabase;0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 6.0 中文文档命令),这取决于进入应用的请求类型。 这两个内核是所有请求都要经过的中央处理器,现在,就让我们聚焦 在位于 app/Http/Kernel.php 的 HTTP 内核。 HTTP 内核继承自 Illuminate\Foundation\Http\Kernel 类,该 类定义了一个 bootstrappers 数组,这个数组中的类在请求被执行 前运行,这些 bootstrappers 配置了错误处理、日志、检测应用环 Tests\Feature; use App\Podcast; use Tests\TestCase; use Facades\App\Contracts\Publisher; use Illuminate\Foundation\Testing\RefreshDatabase; class PodcastTest extends TestCase { use RefreshDatabase; /** * A 门面类列表 下面列出了每个门面及其对应的底层类,这对深入给定根门面的 API 文档而言是个很有用的工具。服务容器绑定键也被包含进来: 门面 类 服务容器绑定 App Illuminate\Foundation\Application app Artisan Illuminate\Contracts\Console\Kernel artisan Auth Illuminate\Auth\AuthManager0 码力 | 1442 页 | 14.66 MB | 1 年前3
Laravel 5.2 中文文档slice、chunk 和 reverse 方法现在会保留集合的键名,如果你不想这些方法保留键名,使 用集合实例的 values 方法即可。 Composer 类 Illuminate\Foundation\Support\Composer 类现在被移动 到 Illuminate\Support\Composer,如果你没有在代码中使用该类那么这一改变对程序没 有影响。 命令和处理器 自处理命令 otFoundException; use Symfony\Component\HttpKernel\Exception\HttpException; use Illuminate\Foundation\Validation\ValidationException; /** * A list of the exception types that should not be 功能,并且将邮件信息记录到日志中。 分页 为了与框架生成的其它 URL 保持一致,分页 URL 不再包含斜杠,这一改变对应用代码 不产生任何影响。 服务提供者 Illuminate\Foundation\Providers\ArtisanServiceProvider 从配置文件 app.php 的服务 提供者列表中移除。 Illuminate\Routing\ControllerServiceProvider0 码力 | 377 页 | 4.56 MB | 1 年前3
Laravel 5.1 中文文档e Iron.io “推入队列” 被废弃, 使用 Iron.io 队列和队列监听器. Illuminate\Foundation\Bus\DispatchesCommands trait 被废弃并被重命名为 Illuminate\Foundation\Bus\DispatchesJobs. Illuminate\Container\BindingResolutionException VerifyCsrfToken 中间件中将要排除的 URIs 添加到$except 属性: Foundation\Http\Middleware\VerifyCsrfToken as Ba seVerifier; class VerifyCsrfToken extends BaseVerifier 44 2.1 视图响应 如果你需要控制响应状态和响应头,还需要返回一个视图作为响应内容,可以使用 view 方 法: return response()->view('hello', $data)->header('Content-Type', $type); 当然,如果你不需要传递一个自定义的 HTTP 状态码或者自定义头,只需要简单使用全局 的帮助函数 view 即可。 20 码力 | 307 页 | 3.46 MB | 1 年前3
Laravel 5.3 中文文档发送: Foundation\Auth\User as Authenticatable; class User extends Authenticatable { use Notifiable; single job... php artisan queue:work --once 事件数据修改 多个队列任务事件如 JobProcessing 和 JobProcessed 将不再包含$data 属性,你需要更新应用调 用$event->job->payload()来获取对应数据。 失败任务表 如果你的应用有了 failed_jobs 表,需要添加 exception 字段到这张表,exception dev 在终端 ping 一下任意*.dev 域名,如果 Valet 安装正确就会看到来自 127.0.0.1 的响应: PING foobar.dev (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.069 ms 64 bytes from 127.0.0.1: icmp_seq=10 码力 | 691 页 | 9.37 MB | 1 年前3
Laravel 5.0 Documentation
vi. Push Queues vii. Failed Jobs xix. Session i. Configuration ii. Session Usage iii. Flash Data iv. Database Sessions v. Session Drivers xx. Templates i. Blade Templating ii. Other Blade Control fresh application structure to the default Laravel project. This new structure serves as a better foundation for building robust application in Laravel, as well as embraces new auto-loading standards (PSR-4) PodcastWasPurchased($podcast)); Of course, your event handler will receive the event object instead of a list of data: class ReportPodcastPurchase { public function handle(PodcastWasPurchased $event) {0 码力 | 242 页 | 1.44 MB | 1 年前3
Laravel 3.2 Documentation.................................................................................... 30 Binding Data To Views ........................................................................................ ..................................................................... 34 Redirecting With Flash Data......................................................................................... 36 Downloads constraints to both relationships and nested eager-loading you'll have complete control over your data with all of the 2 conveniences of ActiveRecord. Eloquent natively supports all of the methods0 码力 | 139 页 | 1.13 MB | 1 年前3
The Laravel Handbook
anything other than HTML. 18 But you can do lots of interesting stuff in Blade templates: insert data, add conditionals, do loops, display something if the user is authenticated or not, or show different Blade (for more I highly recommend the official Blade guide). In the route definition, you can pass data to a Blade template: Route::get('/test', function () { return view('test', ['name' => 'Flavio']); 'Flavio']); }); and use it like this:{{ $name }}
The {{ }} syntax allows you to add any data to the template, escaped. Inside it you can also run any PHP function you like, and Blade will display0 码力 | 111 页 | 14.25 MB | 1 年前3
使⽤Laravel 8
PHP主流框架打造
RESTful API1/articles/1 HTTP STATUS : 200 OK HTTP 協定 HTTP VERBS. URL. HTTP STATUS. JSON. POST { "data": { "id": 1, "title": "我是標題⽂字", "content": "我是內容", "created_at": 筆記連結:https://hackmd.io/ZDoduP_oQ5WXYsO7TyJsiQ 新建單⼀資源 POST https://localhost/api/v1/articles { "data": { "id": 1, "title": "我是標題⽂字", "content": "我是內容", "created_at": "content": "我是內容" } 查看單⼀資源 GET https://localhost/api/v1/articles/1 Response Request { "data": { "id": 1, "title": "我是標題⽂字", "content": "我是內容", "created_at":0 码力 | 22 页 | 3.41 MB | 1 年前3
共 14 条
- 1
- 2













