blueprint
blueprint copied to clipboard
Mailable should generate its template file
Synopsis:
Currently a mailable generates template with this:
return $this->view('view.name');
I think it could be useful to generate the relevant template file too.
Proposed Syntax:
currently existing syntax could remain unchanged, or can be extended with a parameter, like view:email.reviewPost
send: ReviewPost to:post.author with:post
Expected Behavior:
- add an optional parameter to
send
statement (view). default value could beemail.{mail}
. - generate a view for this view path, if not exists.
- pass the notification's parameters to the view, and maybe have a parameter hint at the begining of the view's file
I'd be open to this if you'd like to start a PR. The only change I would make is a snake or kebab case template name (e.g. review-post.blade.php
)
snake/kebab is on the user. I made it to be fully optional and backward compatible, so you have to provide the view:foo-bar / view:fooBar.
a decision that i made (which can be changed) is to prefix the view name with email.
automatically, so its just view:reviewPost
, and it creates the file as resources/views/emails/reviewPost.blade.php
It's not on the user. Using snake is inline with how Blueprint generates other templates with compound words. Please update it.
Copied from src/Generators/Statements/ViewGenerator.php:66 . Can you please send a counter example? Also is it also needed to be fixed?
This receives the view
which may have already been converted.
I am requesting it be changed to snake case. Please update the PR, or I can when I have time.
@jasonmccreary fixed per your request