You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ models:
39
39
title: string:400
40
40
content: longtext
41
41
published_at: nullable timestamp
42
+
author_id: id:user
42
43
43
44
controllers:
44
45
Post:
@@ -47,9 +48,9 @@ controllers:
47
48
render: post.index with:posts
48
49
49
50
store:
50
-
validate: title, content
51
+
validate: title, content, author_id
51
52
save: post
52
-
send: ReviewNotification to:post.author with:post
53
+
send: ReviewPost to:post.author.email with:post
53
54
dispatch: SyncMedia with:post
54
55
fire: NewPost with:post
55
56
flash: post.title
@@ -64,10 +65,13 @@ From these simple 20 lines of YAML, Blueprint will generate all of the following
64
65
- A _controller_ class for `PostController` with `index` and `store` actions complete with code generated for each [statement](https://blueprint.laravelshift.com/docs/controller-statements/).
65
66
- _Routes_ for the `PostController` actions.
66
67
- A [_form request_](https://laravel.com/docs/validation#form-request-validation) of `StorePostRequest` validating `title` and `content` based on the `Post` model definition.
67
-
- A _mailable_ class for `ReviewNotification` complete with a `post` property set through the _constructor_.
68
+
- A _mailable_ class for `ReviewPost` complete with a `post` property set through the _constructor_.
68
69
- A _job_ class for `SyncMedia` complete with a `post` property set through the _constructor_.
69
70
- An _event_ class for `NewPost` complete with a `post` property set through the _constructor_.
70
71
- A _Blade template_ of `post/index.blade.php` rendered by `PostController@index`.
71
72
73
+
_**Note:** This example assumes features within a default Laravel application such as the `User` model and `app.blade.php
74
+
layout. Otherwise, the generated test may have failures._
75
+
72
76
## Documentation
73
77
Browse the [Blueprint Docs](https://blueprint.laravelshift.com/) for full details on [defining models](https://blueprint.laravelshift.com/docs/defining-models/), [defining controllers](https://blueprint.laravelshift.com/docs/defining-controllers/), [advanced configuration](https://blueprint.laravelshift.com/docs/advanced-configuration/), and [extending Blueprint](https://blueprint.laravelshift.com/docs/extending-blueprint/).
0 commit comments