@@ -56,28 +56,42 @@ defineProps({
5656
5757 <section class =" block" aria-labelledby =" essentials" >
5858 <h2 id =" essentials" class =" sr" >The essentials, one function away</h2 >
59- <p class =" eyebrow" >The essentials, one function away </p >
59+ <p class =" eyebrow" >Ship features, not boilerplate </p >
6060 <div class =" tilebed" >
6161 <article class =" tile" >
62+ <p class =" file" >app/routes/_auth.php</p >
6263 <h3 >Auth in one line</h3 >
63- <pre class =" mono" ><span class =" fn" >auth</span >()->login([
64- <span class =" str" >'email'</span > => <span class =" fn" >request</span >()->get(<span class =" str" >'email'</span >),
65- <span class =" str" >'password'</span > => <span class =" fn" >request</span >()->get(<span class =" str" >'password'</span >),
64+ <p class =" blurb" >Login, signup, sessions and tokens, from one function.</p >
65+ <pre class =" mono" >$email = <span class =" fn" >request</span >()->get(<span class =" str" >'email'</span >);
66+ $password = <span class =" fn" >request</span >()->get(<span class =" str" >'password'</span >);
67+
68+ <span class =" fn" >auth</span >()->login([
69+ <span class =" str" >'email'</span > => $email,
70+ <span class =" str" >'password'</span > => $password,
6671]);</pre >
6772 </article >
6873 <article class =" tile" >
69- <h3 >Data without ceremony</h3 >
70- <pre class =" mono" >$posts = <span class =" fn" >db</span >()
71- ->select(<span class =" str" >'posts'</span >)
72- ->where(<span class =" str" >'published'</span >, true)
73- ->orderBy(<span class =" str" >'created_at'</span >, <span class =" str" >'desc'</span >)
74- ->all();</pre >
74+ <p class =" file" >app/database/users.yml</p >
75+ <h3 >Your database is a YAML file</h3 >
76+ <p class =" blurb" >Edit it, run <code class =" mono" >leaf db:migrate</code >, and Leaf diffs the changes in. Seeds included.</p >
77+ <pre class =" mono" ><span class =" fn" >columns</span >:
78+ <span class =" fn" >email</span >: { <span class =" fn" >type</span >: <span class =" str" >string</span >, <span class =" fn" >unique</span >: <span class =" str" >true</span > }
79+ <span class =" fn" >plan</span >: <span class =" str" >string</span >
80+ <span class =" fn" >seeds</span >:
81+ <span class =" fn" >count</span >: <span class =" str" >10</span >
82+ <span class =" fn" >data</span >:
83+ <span class =" fn" >email</span >: <span class =" str" >'@faker.unique.safeEmail'</span ></pre >
7584 </article >
7685 <article class =" tile" >
77- <h3 >Respond like you mean it</h3 >
78- <pre class =" mono" ><span class =" fn" >response</span >()->json([
86+ <p class =" file" >app/controllers/SignupController.php</p >
87+ <h3 >Heavy work leaves the request</h3 >
88+ <p class =" blurb" >Queue the slow part, respond instantly. A worker picks it up in the background.</p >
89+ <pre class =" mono" ><span class =" fn" >dispatch</span >(
90+ SendWelcomeEmail::<span class =" fn" >with</span >($user->id)
91+ );
92+
93+ <span class =" fn" >response</span >()->json([
7994 <span class =" str" >'status'</span > => <span class =" str" >'shipped'</span >,
80- <span class =" str" >'posts'</span > => $posts,
8195]);</pre >
8296 </article >
8397 </div >
@@ -146,12 +160,15 @@ h1 { font-size: 42px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.
146160section .block { padding : 56px 0 ; border-top : 1px solid var (--line ); }
147161.tilebed { margin-top : 24px ; display : grid ; grid-template-columns : 1fr ; gap : 1px ; background : var (--line ); border : 1px solid var (--line ); }
148162@media (min-width : 768px ) { .tilebed { grid-template-columns : repeat (3 , 1fr ); } }
149- .tile { background : var (--card ); padding : 26px ; transition : background .15s ; }
163+ .tile { background : var (--card ); padding : 26px ; transition : background .15s ; min-width : 0 ; }
150164.tile :hover { background : var (--card-hover ); }
165+ .tile .file { font-family : " JetBrains Mono" , monospace ; font-size : 11px ; color : var (--soft ); margin-bottom : 10px ; }
151166.tile h3 { font-size : 16px ; font-weight : 600 ; letter-spacing : -0.01em ; }
167+ .tile p .blurb { margin-top : 6px ; font-size : 13px ; line-height : 1.55 ; color : var (--muted ); }
152168.tile pre { margin-top : 14px ; font-size : 12.5px ; line-height : 1.7 ; color : var (--fg ); overflow-x : auto ; }
153169.tile pre .fn { color : #D4542B ; }
154170.tile pre .str { color : #7c8a4d ; }
171+ .tile pre .cmt { color : var (--soft ); }
155172.install-line { margin-top : 20px ; font-size : 13px ; color : var (--soft ); }
156173.install-line code { color : var (--fg ); border : 1px solid var (--line ); padding : 3px 8px ; }
157174footer { display : flex ; flex-wrap : wrap ; align-items : center ; justify-content : space-between ; gap : 8px ; padding : 18px 0 ; border-top : 1px solid var (--line ); font-size : 13px ; color : var (--soft ); font-family : " JetBrains Mono" , monospace ; }
0 commit comments