Skip to content

Commit 209bbcd

Browse files
committed
More tiny tweaks
1 parent 4af91e5 commit 209bbcd

File tree

6 files changed

+192
-38
lines changed

6 files changed

+192
-38
lines changed

docs/components/MarkdownContent.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import MarkdownSampleC from '../components/MarkdownSampleC.mdx'
2+
3+
export default MarkdownSampleC

docs/components/MarkdownSampleC.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
12
# I'm Walking Away From the Product I Spent a Year Building
23

34
Here I sit, in a cabin on Lake Superior by the fire, with late-season snow pelting the windows and ominous waves crashing against the rocky shore.
45

56
Despite the treacherous terrain that surrounds me, I feel at peace with the decision I’ve been weighing. I’ve decided it’s time to take a step back from building [Level](https://level.app) as a standalone alternative to Slack.
67

8+
| Breakpoints | Original | Minified | Gzip | Brotli |
9+
| ------------- | -------: | -------: | -----: | -----: |
10+
| 4 _(default)_ | 783.5kb | 603.3kb | 78.0kb | 22.6kb |
11+
| 3 | 624.0kb | 481.3kb | 62.7kb | 20.8kb |
12+
| 2 | 464.6kb | 359.4kb | 47.4kb | 19.2kb |
13+
| 1 | 305.1kb | 237.5kb | 32.1kb | 17.6kb |
14+
715
I’ve become comfortable sharing the behind-the-scenes journey on my weekly podcast, The Art of Product, in hopes that it will be helpful to someone, somewhere. Keeping with that tradition, this my in-depth retrospective on what happened, the thought process that brought me here, and what’s coming next.
816

917
## The Backstory
@@ -34,6 +42,8 @@ Despite being encouraged, I was determined not to fall into the trap of proceedi
3442

3543
Around 40 people ended up booking a time slot! The calls felt productive, and by the end, I felt like I wasn’t learning much that I hadn’t already heard. Many folks echoed the sentiments from the manifesto:
3644

45+
> “Ugh, Slack distracts me so often. You’re right; everything feels urgent even when it’s not. I’m super interested in what you’re building here. We’re pretty open to change at my company – I don’t see switching being too big of a deal.”
46+
>
3747
> “Ugh, Slack distracts me so often. You’re right; everything feels urgent even when it’s not. I’m super interested in what you’re building here. We’re pretty open to change at my company – I don’t see switching being too big of a deal.”
3848
3949
Some folks were fans of my podcast but were not really in my target market. Others were not decision makers, so I had to take their feedback with a grain of salt. However, I didn’t interpret much of what I heard as unfavorable.

docs/components/MarkdownSampleF.mdx

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Laravel Docs
2+
3+
## Introduction
4+
5+
Artisan is the command-line interface included with Laravel. It provides a number of helpful commands that can assist you while you build your application. To view a list of all available Artisan commands, you may use the `list` command:
6+
7+
php artisan list
8+
9+
Every command also includes a "help" screen which displays and describes the command's available arguments and options. To view a help screen, precede the name of the command with `help`:
10+
11+
php artisan help migrate
12+
13+
### Tinker (REPL)
14+
15+
Laravel Tinker is a powerful REPL for the Laravel framework, powered by the [PsySH](https://github.com/bobthecow/psysh) package.
16+
17+
#### Installation
18+
19+
All Laravel applications include Tinker by default. However, you may install it manually if needed using Composer:
20+
21+
composer require laravel/tinker
22+
23+
#### Usage
24+
25+
Tinker allows you to interact with your entire Laravel application on the command line, including the Eloquent ORM, jobs, events, and more. To enter the Tinker environment, run the `tinker` Artisan command:
26+
27+
php artisan tinker
28+
29+
You can publish Tinker's configuration file using the `vendor:publish` command:
30+
31+
php artisan vendor:publish --provider="Laravel\Tinker\TinkerServiceProvider"
32+
33+
> {note} The `dispatch` helper function and `dispatch` method on the `Dispatchable` class depends on garbage collection to place the job on the queue. Therefore, when using tinker, you should use `Bus::dispatch` or `Queue::push` to dispatch jobs.
34+
35+
#### Command Whitelist
36+
37+
Tinker utilizes a white-list to determine which Artisan commands are allowed to be run within its shell. By default, you may run the `clear-compiled`, `down`, `env`, `inspire`, `migrate`, `optimize`, and `up` commands. If you would like to white-list more commands you may add them to the `commands` array in your `tinker.php` configuration file:
38+
39+
'commands' => [
40+
// App\Console\Commands\ExampleCommand::class,
41+
],
42+
43+
#### Classes That Should Not Be Aliased
44+
45+
Typically, Tinker automatically aliases classes as you require them in Tinker. However, you may wish to never alias some classes. You may accomplish this by listing the classes in the `dont_alias` array of your `tinker.php` configuration file:
46+
47+
'dont_alias' => [
48+
App\User::class,
49+
],
50+
51+
## Writing Commands
52+
53+
In addition to the commands provided with Artisan, you may also build your own custom commands. Commands are typically stored in the `app/Console/Commands` directory; however, you are free to choose your own storage location as long as your commands can be loaded by Composer.
54+
55+
<a name="generating-commands"></a>
56+
### Generating Commands
57+
58+
To create a new command, use the `make:command` Artisan command. This command will create a new command class in the `app/Console/Commands` directory. Don't worry if this directory does not exist in your application, since it will be created the first time you run the `make:command` Artisan command. The generated command will include the default set of properties and methods that are present on all commands:
59+
60+
php artisan make:command SendEmails
61+
62+
<a name="command-structure"></a>
63+
### Command Structure
64+
65+
After generating your command, you should fill in the `signature` and `description` properties of the class, which will be used when displaying your command on the `list` screen. The `handle` method will be called when your command is executed. You may place your command logic in this method.
66+
67+
> {tip} For greater code reuse, it is good practice to keep your console commands light and let them defer to application services to accomplish their tasks. In the example below, note that we inject a service class to do the "heavy lifting" of sending the e-mails.
68+
69+
Let's take a look at an example command. Note that we are able to inject any dependencies we need into the command's `handle` method. The Laravel [service container](/docs/{{version}}/container) will automatically inject all dependencies that are type-hinted in this method's signature:
70+
71+
<?php
72+
73+
namespace App\Console\Commands;
74+
75+
use App\DripEmailer;
76+
use App\User;
77+
use Illuminate\Console\Command;
78+
79+
class SendEmails extends Command
80+
{
81+
/**
82+
* The name and signature of the console command.
83+
*
84+
* @var string
85+
*/
86+
protected $signature = 'email:send {user}';
87+
88+
/**
89+
* The console command description.
90+
*
91+
* @var string
92+
*/
93+
protected $description = 'Send drip e-mails to a user';
94+
95+
/**
96+
* Create a new command instance.
97+
*
98+
* @return void
99+
*/
100+
public function __construct()
101+
{
102+
parent::__construct();
103+
}
104+
105+
/**
106+
* Execute the console command.
107+
*
108+
* @param \App\DripEmailer $drip
109+
* @return mixed
110+
*/
111+
public function handle(DripEmailer $drip)
112+
{
113+
$drip->send(User::find($this->argument('user')));
114+
}
115+
}

docs/components/PreviewComponent.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
4+
5+
6+
7+
8+
import MarkdownContent from './MarkdownContent.jsx'
9+
10+
export default function Preview() {
11+
return (
12+
<div className="mx-auto prose prose-xl">
13+
<MarkdownContent />
14+
</div>
15+
)
16+
}

docs/pages/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ import MarkdownSampleB from '../components/MarkdownSampleB.mdx'
55
import MarkdownSampleC from '../components/MarkdownSampleC.mdx'
66
import MarkdownSampleD from '../components/MarkdownSampleD.mdx'
77
import MarkdownSampleE from '../components/MarkdownSampleE.mdx'
8+
import MarkdownSampleF from '../components/MarkdownSampleF.mdx'
89

910
export default () => {
1011
const [size, setSize] = useState('default')
11-
const [sample, setSample] = useState('B')
12+
const [sample, setSample] = useState('A')
1213

1314
const SampleComponent = {
1415
A: MarkdownSample,
1516
B: MarkdownSampleB,
1617
C: MarkdownSampleC,
1718
D: MarkdownSampleD,
1819
E: MarkdownSampleE,
20+
F: MarkdownSampleF,
1921
}[sample]
2022

2123
return (
@@ -31,7 +33,7 @@ export default () => {
3133
{s}
3234
</button>
3335
))}
34-
{['A', 'B', 'C', 'D', 'E'].map((s) => (
36+
{['A', 'B', 'C', 'D', 'E', 'F'].map((s) => (
3537
<button
3638
key={s}
3739
type="button"

0 commit comments

Comments
 (0)