Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1c735be

Browse filesBrowse files
committed
Fixes code example
1 parent 3bb92bf commit 1c735be
Copy full SHA for 1c735be

File tree

Expand file treeCollapse file tree

1 file changed

+51
-49
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+51
-49
lines changed

‎readme.md

Copy file name to clipboardExpand all lines: readme.md
+51-49Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -50,59 +50,61 @@ Laravel Zero provides a main command. That is the default one of your applicatio
5050

5151
Let's take a look at an example command.
5252

53-
<?php
54-
55-
namespace App\Console\Commands;
53+
```php
54+
<?php
55+
56+
namespace App\Console\Commands;
57+
58+
use App\DripEmailer;
59+
use Illuminate\Console\Command;
60+
61+
class SendEmails extends Command
62+
{
63+
/**
64+
* The name and signature of the console command.
65+
*
66+
* @var string
67+
*/
68+
protected $signature = 'email:send {email}';
69+
70+
/**
71+
* The console command description.
72+
*
73+
* @var string
74+
*/
75+
protected $description = 'Send drip e-mails to a email';
76+
77+
/**
78+
* The drip e-mail service.
79+
*
80+
* @var DripEmailer
81+
*/
82+
protected $drip;
83+
84+
/**
85+
* Create a new command instance.
86+
*
87+
* @param DripEmailer|null $drip
88+
* @return void
89+
*/
90+
public function __construct(DripEmailer $drip = null)
91+
{
92+
parent::__construct();
5693

57-
use App\DripEmailer;
58-
use Illuminate\Console\Command;
94+
$this->drip = $drip ?: new DripEmailer;
95+
}
5996

60-
class SendEmails extends Command
97+
/**
98+
* Execute the console command.
99+
*
100+
* @return mixed
101+
*/
102+
public function handle()
61103
{
62-
/**
63-
* The name and signature of the console command.
64-
*
65-
* @var string
66-
*/
67-
protected $signature = 'email:send {email}';
68-
69-
/**
70-
* The console command description.
71-
*
72-
* @var string
73-
*/
74-
protected $description = 'Send drip e-mails to a email';
75-
76-
/**
77-
* The drip e-mail service.
78-
*
79-
* @var DripEmailer
80-
*/
81-
protected $drip;
82-
83-
/**
84-
* Create a new command instance.
85-
*
86-
* @param DripEmailer|null $drip
87-
* @return void
88-
*/
89-
public function __construct(DripEmailer $drip = null)
90-
{
91-
parent::__construct();
92-
93-
$this->drip = $drip ?: new DripEmailer;
94-
}
95-
96-
/**
97-
* Execute the console command.
98-
*
99-
* @return mixed
100-
*/
101-
public function handle()
102-
{
103-
$this->drip->send($this->argument('email'));
104-
}
104+
$this->drip->send($this->argument('email'));
105105
}
106+
}
107+
```
106108

107109
You may review the documentation of the Artisan Console component [on Laravel Official Website](https://laravel.com/docs/5.4/artisan).
108110

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.