├── 2017-andrew-css_grid_and_flexbox.markdown ├── 2017-canzoneri-email.markdown ├── 2017-mccreary-git.markdown ├── 2017-otwell-laravel54_internals.markdown ├── 2017-stauffer-containers.markdown ├── 2017-wathan-mocking.markdown ├── organized-links.markdown └── readme.markdown /2017-andrew-css_grid_and_flexbox.markdown: -------------------------------------------------------------------------------- 1 | CSS Layout in 2017 with Grid and Flexbox 2 | ---------------------------------------- 3 | 4 | _Rachel Andrew, Laracon Online 2017_ 5 | 6 | ### Introduction 7 | 8 | Rachel is: 9 | 10 | - CSS working group invited expert 11 | - Google Dev Expert for Web Tech 12 | - Co-Founder of Perch CSS (grabaperch.com) 13 | - Contact: m2@rachelandrew.co.uk 14 | 15 | She will discuss new things in CSS layout technology. 16 | 17 | - Float, inline-block, display: table, absolute & relative positions 18 | - Tons of frameworks 19 | - Frameworks remove some of the headache 20 | 21 | Modules that will redefine how we do web layout: 22 | 23 | - Flexbox, CSS Grid Layout, Box Alignment 24 | 25 | ### New CSS for Layout 26 | 27 | Newer tools allow for actual centering, more layout control, responsive by default. They give items a way to relate to one another. 28 | 29 | A big problem with modern layout tools is that all items are independent and have no idea about how they should 'react' to one another. 30 | 31 | An earlier answer to this issue was the use of 'display:table' for everything. 32 | 33 | Flexbox and Grid take the display:table concept and flesh it out into something more usable, friendly and flexible. 34 | 35 | [Flexbox and Grid examples of very basic relational layout] 36 | 37 | ### Separation of Source and Display 38 | 39 | **Flex** example 40 | 41 | ~~~~ 42 | nav ul { 43 | display: flex; 44 | justify-content: space-between; 45 | flex-direction: row-reverse; 46 | } 47 | ~~~~ 48 | 49 | **Grid** example 50 | 51 | It's possible to use automatic placement rules instead of manual specification, which 52 | is the default behavior. 53 | 54 | ~~~~ 55 | .wrapper { 56 | display: grid; 57 | grid-template-columns: 1fr 1fr 1fr 1fr; 58 | grid-template-rows: auto; 59 | } 60 | 61 | .landscape { 62 | grid-column-end: span 2; 63 | } 64 | ~~~~ 65 | 66 | Don't use Grid or Flexbox as an excuse to forget about the source order. Even worse, 67 | don't strip out semantic elements to turn everything into a grid / flex item. 68 | 69 | _Use the ordering only for visual (not logical) reordering of content._ 70 | 71 | https://vimeo.com/180566024 - Leonie Watson video on CSS accessibility 72 | 73 | ### Control of Alignment 74 | 75 | Box Alignment Module Level 3 - https://drafts.csswg.org/css-align 76 | 77 | This takes all the alignment out of the CSS spec and drops it in its own spec. 78 | 79 | It's 2017. We can now center things. :D 80 | 81 | - justify-content 82 | - align-content 83 | - justify-self 84 | - align-self 85 | - justify-items 86 | - align-items 87 | 88 | Grid has two axes to align against, whereas Flex uses one, making Grid possibly easier 89 | to understand and use. [Cheat sheet slide] 90 | 91 | ### Responsive By Default 92 | 93 | Grid and Flexbox were 'born' post-responsive world and are fluid out of the box. 94 | 95 | No longer do we have to do complex calculations to make layouts work in multiple contexts. 96 | 97 | ~~~~ 98 | nav ul{ 99 | display: flex; 100 | justify-content: space-between; 101 | } 102 | ~~~~ 103 | 104 | **Flex property**: 105 | 106 | - flex-grow (add space) 107 | - flex-shrink (remove space) 108 | - flex-basis (initial size before grow / shrink) 109 | 110 | ~~~~ 111 | .wrapper { 112 | display: flex; 113 | } 114 | .wrapper li { 115 | flex: 1 1 300px; 116 | min-width: 1px; 117 | } 118 | . wrapper li:nth-child(3) { 119 | flex-grow: 2 1; 120 | } 121 | ~~~~ 122 | 123 | https://madebymike.com.au/demos/flexbox-tester/ (flexbox calculator) 124 | 125 | ### CSS Grid Layout fr Unit 126 | 127 | The way this responsiveness works in Grid is via the fr unit. 128 | 129 | ~~~~ 130 | .wrapper { 131 | display: grid; 132 | grid-template-columns: 1fr 1fr 1fr; 133 | OR 134 | grid-template-columns: 600px 1fr 1fr; 135 | OR 136 | grid-template-columns: 600px 1fr 3fr; 137 | OR 138 | grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 139 | } 140 | ~~~~ 141 | 142 | Flexbox is for 1-dimensional layout (row or column); Grid is for 2-dimensional layout. 143 | 144 | _Imitate Flexbox auto-fill with Grid:_ 145 | 146 | ~~~~ 147 | .wrapper { 148 | display: grid; 149 | grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 150 | } 151 | ~~~~ 152 | 153 | ### Bringing It All Together 154 | 155 | [Examples of rows expanding to contain new content rather than overflowing] 156 | 157 | ~~~~ 158 | .home-hero { 159 | display: grid; 160 | grid-gap: 1px; 161 | grid-auto-rows: minmax(150px, auto); /* prevents overflow */ 162 | } 163 | ~~~~ 164 | 165 | Flexbox example of layout resilience: 166 | 167 | ~~~~ 168 | .special { 169 | display: flex; 170 | flex-direction: column; 171 | } 172 | 173 | .special h3 { 174 | margin-top: auto; 175 | } 176 | ~~~~ 177 | 178 | - http://gridbyexample.com 179 | - http://gridbyexample.com/browsers 180 | - http://caniuse.com/#feat=flexbox 181 | - http://caniuse.com/#feat=css-grid 182 | 183 | - Firefox 52 is the first browser (just released) with support for Grid. 184 | - Chrome 57 will support Grid (next week) 185 | - Safari will ship with Grid support in March / April 186 | 187 | IE and Edge still use their early implementation of CSS Grid. 188 | 189 | ### Feature Queries 190 | 191 | This is how we will deal with older browsers when using Flex / Grid. 192 | 193 | ~~~~ 194 | @supports (display: grid) { 195 | .has-grid { 196 | /* CSS for grid browsers here */ 197 | } 198 | } 199 | ~~~~ 200 | 201 | Write CSS for browsers without support 202 | Override those properties in feature queries 203 | 204 | **Grid Tips** 205 | 206 | - Floated items that become grid / flex lose the float behavior 207 | - vertical-align has no effect on a grid item 208 | - inline-block or block become grid items 209 | - Overrides change widths, margins and padding 210 | - CHECK ITEM WIDTHS if something in grid / flex uses an unexpected size 211 | 212 | http://caniuse.com/#feat=css-featurequeries 213 | 214 | _You can use feature queries to detect support for anything new in CSS._ 215 | 216 | Don't forget to have fun. :) 217 | 218 | https://rachelandrew.co.uk/speaking/event/laracon-online 219 | 220 | -------------------------------------------------------------------------------- /2017-canzoneri-email.markdown: -------------------------------------------------------------------------------- 1 | What Developers Should Know About Email 2 | --------------------------------------- 3 | 4 | _Nick Canzoneri, Laracon 2017_ 5 | 6 | ### Introduction 7 | 8 | A bit of reflection on email, Postmark, Mojang... 'everyone needs email'. 9 | 10 | ### What are MX Records? 11 | 12 | From the domain in an email address, the server needs to figure out where the recipient is. 13 | This, of course, requires DNS. A subdomain is treated completely separately from a primary 14 | domain, and needs its own separate MX records to receive mail. 15 | 16 | The records themselves consist of a server name and priority level (lower numbers are used 17 | first). The process of priority selection (in reality) is a little fuzzy and not 18 | cut-and-dried. 19 | 20 | ### How is An Email Formatted? 21 | 22 | **Headers are metadata** 23 | 24 | As an email gets relayed, each server that passes it on adds received headers. 25 | 26 | - Where did it come from? 27 | - Who has it now? 28 | - Where is it going? 29 | 30 | Google has a tool to parse received headers at toolbox.googleapps.com/apps/messageheader. 31 | 32 | **X-Headers** 33 | 34 | You can use these to add your own diagnostic info, and they are commonly used by spam 35 | filters, etc. 36 | 37 | **Body** 38 | 39 | After the newline (\r\n), comes the body. 40 | 41 | **HTML and Text** 42 | 43 | Email content is split up by boundaries. 44 | 45 | An HTML email should be a full HTML document, rather than just a snippet. 46 | 47 | **SMTP Attachments** 48 | 49 | These are also set off by boundaries. Attachments are base64-encoded, which can increase 50 | attachment size by up to 30%. 51 | 52 | ### Why Do I Need Email Authentication? 53 | 54 | You can't trust everyone, and bad actors are attempting to compromise systems all the time. 55 | 56 | **Methods: SPF, DKIM & DMARC** 57 | 58 | These provide both _spoofing protection_ and _deliverability_. Your mail is more likely 59 | to get there if it passes one of these. 60 | 61 | **SPF: openspf.org** 62 | 63 | - Whitelist and a blacklist (what's allowed, and what isn't) 64 | - The receiver of the mail actually does the evaluation based on the Return-Path 65 | - It looks at the spf record (+ is allowed, - is not allowed...) 66 | - Domain-based 67 | 68 | ~~~~ 69 | v=spf1 ip4:192.30.252.0/22 70 | include:_spf.google.com // these lines allow google and zendesk to send 71 | include:mail.zendesk.com // from your domain; 72 | ~all // soft-fail: log a fail, but deliver it 73 | ~~~~ 74 | 75 | Gotchas: 76 | 77 | - You can only have 1 DNS record for spf. If you have more, this will fail. 78 | - There can only be 10 lookups. (Use less than 10 include statements.) 79 | 80 | **DKIM (DomainKeys Identified Mail)** 81 | 82 | Uses public-key encryption to add a crypto signature to your email. Message-based. 83 | 84 | The public key is in DNS: 85 | 86 | - google.\_domainkey.github.com (last bit is the signing domain) 87 | 88 | This is put together with other info into an SMTP header that is sent with the mail. 89 | 90 | **DMARC (Domain-based Message Authentication and Conformancy - RFC 7489** 91 | 92 | The latest. The sender gets to decide criteria for pass or fail. The receiver decides 93 | what to do on pass or fail. 94 | 95 | In DNS: \_dmarc.gmail.com 96 | 97 | ~~~~ 98 | v=DMARC1\; 99 | p=none\; // policy 100 | rua=mailto:mailauth-reports@google.com // reporting email address, reports are XML 101 | ~~~~ 102 | 103 | dmarc.postmarkapp.com - can send a weekly review / digest of DMARC email reports 104 | 105 | ### How Do I Get More Features Out of Email? 106 | 107 | - Bounces // don't build any of this yourself 108 | - Opens 109 | - Inbound 110 | 111 | Postmark, SES and others provide these additional features in a nice API. 112 | 113 | **Bounces** 114 | 115 | The email you sent didn't get delivered. This is an important stat to track (make sure 116 | people are getting your mail.) You can set up custom features via X-Headers. 117 | 118 | **Opens** 119 | 120 | Don't use receipt tracking in creepy ways. Use it for stats, responsibly. :) 121 | 122 | Example feature: HelpScout (lets you know when customer viewed a support email) 123 | 124 | **Inbound Processing** 125 | 126 | Turn email into JSON. So your customer can email your app. Of course this is complex. 127 | The classic example of this is project management tools (BaseCamp, JIRA). 128 | 129 | Again, dmarc.postmarkapp.com uses this Inbound feature to build its reports. 130 | 131 | ### Questions 132 | 133 | **Q. What about PGP?** 134 | 135 | A. Not really dealt with at Postmark. 136 | 137 | **Q. When sending email on behalf of customers, and you can only send Reply-To...?** 138 | 139 | A. If you can't touch the DNS records, the only option is to use a Reply-To. Email 140 | reputation is getting more and more domain-based. 141 | 142 | **Q. Is Open tracking reliable, or no?** 143 | 144 | A. The common tactic is to use an image... it is not 100% reliable. Depending on the 145 | receiver, you may not get as much information (about open client / browser, etc.). 146 | Gmail typically handles Open tracking well, and they are the gorilla in the room in 147 | terms of email market share. 148 | -------------------------------------------------------------------------------- /2017-mccreary-git.markdown: -------------------------------------------------------------------------------- 1 | You Don't Know Git 2 | ------------------ 3 | 4 | _Jason McCreary, Laracon Online 2017_ 5 | 6 | ### Introduction 7 | 8 | Many git commands will be covered in a shotgun approach. 9 | 10 | ### Let's Git Started ... 11 | 12 | **Laravel Shift** is built on git. In the course of running Shift, Jason ran into a lot more 13 | questions about git then about Laravel / upgrading. We often use git while knowing very little 14 | about it. 15 | 16 | We need to find a **Git Master** to help us work through our issues... 17 | 18 | [Jason's Git Master, Richard] 19 | 20 | Git is an empowering tool, part of so many workflows, and it behooves us to understand and master 21 | this toolkit. 22 | 23 | ### Unfamiliar Commands 24 | 25 | **git add** 26 | 27 | A lot of us use this one incorrectly. 28 | 29 | Common usages (basically grab-all commands): 30 | 31 | ~~~~ 32 | git add . 33 | git add -A 34 | git commit -am '' 35 | ~~~~ 36 | 37 | How about this? 38 | 39 | ~~~~ 40 | git add -p // goes through all the hunks for staging 41 | ~~~~ 42 | 43 | The -i switch lists all the untracked files - use * to add all: 44 | 45 | ~~~~ 46 | git add -i // interactive - parent prompt of patch 47 | ~~~~ 48 | 49 | **git-commit** 50 | 51 | Let's say we've made a WIP commit. And we want to add to it rather than make a new one. 52 | 53 | ~~~~ 54 | git commit --amend 55 | ~~~~ 56 | 57 | You can run git log and verify that it rolled the new changes into the previous commit. One point 58 | to notice: the commit SHAs change after an --amend. If you shared a previous commit with others, 59 | this can screw you up and you'll have to deal with it via merge / rebase. Ideal for work that 60 | isn't shared yet. 61 | 62 | **git stash** 63 | 64 | This it the poor man's commit. It makes a sort of WIP commit and puts it on an internal stack and 65 | 'out of the way', temporarily removing the changes from the working area. 66 | 67 | ~~~~ 68 | git stash --include-untracked 69 | git stash list 70 | ~~~~ 71 | 72 | Note that the stashes aren't real commits and don't have SHAs, though you can save them with a 73 | message (not recommended - make real commits instead). 74 | 75 | **git push** 76 | 77 | This will push things to an existing branch or create one if it doesn't exist: 78 | 79 | ~~~~ 80 | git push origin master:staging 81 | ~~~~ 82 | 83 | **git rebase** 84 | 85 | Particularly, git rebase -i (interactive). You pass it a SHA of the first commit that you _don't_ 86 | want to be included in the rebase. 87 | 88 | The command will put you in an editor, sort of like a git log; you set the commands you want to 89 | run on each commit, and then it runs them in order and prompts for interaction where necessary. 90 | 91 | ~~~~ 92 | git rebase -i 93 | ~~~~ 94 | 95 | Note that this also changes the commit SHAs like --amend, and is thus history-breaking. 96 | 97 | **git cherry-pick** 98 | 99 | If you just want one commit to pull to master, you can use this 'surgical' command: 100 | 101 | ~~~~ 102 | git cherry-pick 103 | ~~~~ 104 | 105 | **git bisect** 106 | 107 | Let's say you have a really long commit history, and somewhere, you got a bug. You don't know 108 | when it was introduced and it's going to be very hard to track down. You _do_ know that way 109 | back when, there was a commit where the code was good (i.e., free of the bug). 110 | 111 | ~~~~ 112 | git bisect 113 | ~~~~ 114 | 115 | This will move you around in the commit history and ask if the problem is still there or not until 116 | the needle in the haystack is found. 117 | 118 | **git reflog** 119 | 120 | Let's say you messed up the rebase. 121 | 122 | ~~~~ 123 | git reflog 124 | ~~~~ 125 | 126 | This will show you all the references for recent activity. You can find a SHA in the list and 127 | checkout that point where you want to return to. This puts you in a detached HEAD state (not on 128 | a branch). This is not for regular workflow, more for weird 'oh crap' moments. Make a habit 129 | of creating a backup branch in your regular flow. 130 | 131 | ### Common Workflows 132 | 133 | **Git Flow** 134 | 135 | This is the parallel, multiple-long-running branch model. Branches for develop, release, hotfixes, 136 | features... but the trouble with this method is what to merge where. Usually this is more complex 137 | than what you need. A great example of a _good_ use of this flow is the Laravel project. 138 | 139 | **GitHub Flow** 140 | 141 | This is a more 'modern' approach, and sort of branded (obviously). It's a strategy that employs 142 | a single, long-running **master** branch and features are all developed on separate branches 143 | and then merged back in. It is a simpler process and is typically more likely to be useful. 144 | 145 | You work quickly on features and avoid most of the merge-hell issues of Git Flow. 146 | 147 | ### Helpful Shorthands / Shortcuts 148 | 149 | **HEAD:** 150 | 151 | ~~~~ 152 | git log --oneline -1 HEAD~1 // one commit before HEAD 153 | git log --oneline -1 HEAD^ // parent commit 154 | git log --oneline -1 HEAD^^ 155 | git log --oneline -1 HEAD~2^ // mix & match! 156 | git log --oneline -1 ~ 157 | ~~~~ 158 | 159 | Always want to push the topmost commit? 160 | 161 | ~~~~ 162 | git push origin HEAD 163 | ~~~~ 164 | 165 | **Branch traversal:** 166 | 167 | ~~~~ 168 | git checkout - // moves to branch you were previously on 169 | ~~~~ 170 | 171 | **Aliases:** 172 | 173 | ~~~~ 174 | git config --get-regexp alias // show your aliases 175 | git wtf // :) 176 | ~~~~ 177 | 178 | Often, git aliases lead to unnecessary obfuscation. Careful with them. If you're doing pair 179 | programming, swapping machines, etc. it can be really strange to alias common commands for a 180 | variety of reasons. 181 | 182 | Tab completion is _much_ better than aliasing for common keystroke-saving purposes. 183 | 184 | **Prompt:** 185 | 186 | ~~~~ 187 | Directory - branch name - status 188 | ~~~~ 189 | 190 | Careful of 'terminal envy'... 191 | 192 | **git open** 193 | 194 | A script of Jason's that was turned into an npm package - it can figure out where a given repo 195 | is and do a few other handy shortcut things. 196 | 197 | ### Getting Git 198 | 199 | Jason's 'Getting Git' series of over 50 videos. 200 | 201 | **20% off at https://gettinggit.com/laracon-online** 202 | 203 | ### Questions 204 | 205 | **Q. Do you have plans to build Shift for Spark?** 206 | 207 | A. It already works. :D Spark even has its own internal 'shift' process. 208 | 209 | **Q. If there are conflicts during git stash pop...?** 210 | 211 | A. Work through it just like a normal merge conflict (diff tools, etc.). 212 | 213 | **Q. Recommended changes to git config defaults?** 214 | 215 | A. Sort of like aliases... Jason doesn't want to make too many customizations. He doesn't have 216 | any specific suggestions. 217 | 218 | ### Bonus 219 | 220 | From @austinkregel in Slack chat, a pretty git log: 221 | 222 | ~~~~ 223 | git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit 224 | ~~~~ 225 | -------------------------------------------------------------------------------- /2017-otwell-laravel54_internals.markdown: -------------------------------------------------------------------------------- 1 | Laravel 5.4 Internals Walkthrough 2 | --------------------------------- 3 | 4 | _Taylor Otwell, Laracon Online 2017_ 5 | 6 | ### Introduction 7 | 8 | Taylor created Laravel while working at Userscape. Laravel is designed to be easy to use, 9 | powerful, and solve a lot of common development problems. 10 | 11 | We'll walk through how Laravel is put together at a fundamental level, so that we gain 12 | a better understanding of how Laravel works, from the HTTP side and the artisan side. 13 | 14 | ### Kernels 15 | 16 | Laravel has an HTTP kernel and a Console kernel. 17 | - app/Http/Kernel.php 18 | - app/Console/Kernel.php 19 | 20 | ### HTTP Side of Laravel 21 | 22 | **index.php** 23 | 24 | Begins with autoload, which requires vendor/autoload.php (Composer convention) Then it 25 | requires 26 | 27 | **bootstrap/app.php** 28 | 29 | ...and this creates the 'instance' of Laravel. This is basically a dependency injection 30 | container. (It was built this way because Taylor was originally going to use Silex.) 31 | First the HTTP kernel and the Console kernel are bound into the container. Immediately 32 | following is the Exception Handler. The app instance is then returned from the script. 33 | 34 | Many people ask about using the container outside Laravel. According to Taylor this is 35 | easy. :) [Example] Pull in Illuminate/Container and create an instance of 36 | 37 | - Illuminate/Container/Container, and you can pull things in (dd) 38 | 39 | Next in index.php is 40 | 41 | **Request Handling** 42 | 43 | We grab an instance of the HTTP kernel next and call the handle() method, building a 44 | request from the PHP global variables. The response is then sent out. Then 45 | kernel->terminate is called to remove any _terminable_ middleware. 46 | 47 | **The HTTP Kernel** (Foundation/Http/Kernel, not in app, which just has Middleware arrays) 48 | 49 | The App and router instances are auto-injected into the kernel at construction time. The 50 | handle method takes a request - not type-hinted because of possible PSR-7 adoption - and 51 | then begins by allowing for form request spoofing (override). But then we run 52 | sendRequestThroughRouter. 53 | 54 | [Side note: $request / Request $request is available in the container, but use of that 55 | functionality is not recommended - example used is when a class is bound into the 56 | container as a singelton.] 57 | 58 | At this point the framework still can't really _do_ anything. sendRequestThroughRouter 59 | runs the bootstrap() process, which will only run once, and this brings in the 60 | bootstrapper classes. Each of those does one thing (and these can be overridden). Examples: 61 | 62 | - LoadEnvironmentVariables 63 | - LoadConfiguration 64 | - HandleExceptions 65 | - RegisterFacades (class aliases) 66 | - RegisterProviders: loops through all service providers in the config/app.php file, 67 | binding all the additional functionality into the Container. 68 | - Encryption provider highlighted 69 | - Queue provider highlighted 70 | - BootProviders 71 | 72 | [You can do almost anything (i.e. modules) from a service provider. But you wouldn't want 73 | to try to access something in your provider's register() method from a different provider, 74 | because it's not available yet - use the boot() method instead, because these are called 75 | after all service providers are registered.] 76 | 77 | After the kernel boostrap(), we are ready to handle the passed-in request. At this point 78 | we pull in the Pipeline component - it can send objects through other objects. By default 79 | the request is sent through the global middleware and, only after that, to the router. Any 80 | of the middleware in the chain can reject the request and kick it back out (obvious 81 | example: authentication). 82 | 83 | [Side note: cannot access the current user in the constructor of a controller. In order 84 | to know the middleware we need to run, we would have to _create_ the controller first. 85 | If you need to get the user very early, for example, you can pass a closure to the 86 | middleware in the controller constructor.] 87 | 88 | The router then finds the URI, runs route-level middleware, etc. and returns the response. 89 | 90 | The response is then sent to the browser. 91 | 92 | ### Console Side 93 | 94 | This process is similar to the HTTP side - calling autoload and bootstrap to begin with. 95 | Then we create the Console kernel instance, passing in arguments, creating an output 96 | object, and returning a status code. 97 | 98 | **Foundation/Console/Kernel** 99 | 100 | The Console kernel calls a similar array of bootstrappers on setup (like the HTTP kernel). 101 | 102 | The only difference is the SetRequestForConsole boostrapper, which binds a dummy HTTP 103 | request into the container. 104 | 105 | Once bootstrapped, in the handle() method the commands are loaded. (Things like Artisan 106 | commands.) Difference from HTTP: there is no Middleware. 107 | 108 | ### Summary 109 | 110 | This simple foundation provides a lot of power, particularly via the service providers. 111 | Hopefully Laravel feels a little less like magic now than it did before. :) 112 | 113 | ### Questions 114 | 115 | **Q. How does Taylor work on Laravel?** 116 | 117 | A. He uses a Laravel application on his machine, and another repo that's just for the 118 | framework. He symlinks framework changes into his current Laravel dev site while working 119 | on changes (laracopy script). For packages, he uses a feature of Composer called 120 | path repository. He defines a repository from the package directory and use the package 121 | locally during development just like any other package from Composer. 122 | 123 | **Q. Will Dusk be available outside Laravel?** 124 | 125 | A. No current plans for that. He views these components as 'exclusive to Laravel', because 126 | they rely on a lot of power that already exists in Laravel and would require a ton of 127 | messy interfaces, etc. to be portable. 128 | 129 | **Q. Horizon?** 130 | 131 | A. Development is going well. :) Plans are to demo Horizon on stage in New York. 132 | 133 | **Q. Laracon US?** 134 | 135 | A. Sold out. Matt and Jeff are back, along with Evan and Adam. Two speakers still to be 136 | announced. Mattias Hansen and wife will talk about a successful project. Don't forget 137 | about Laracon EU! 138 | -------------------------------------------------------------------------------- /2017-stauffer-containers.markdown: -------------------------------------------------------------------------------- 1 | What is Container 2 | -------------------- 3 | 4 | _Matt Stauffer, Laracon Online 2017_ 5 | 6 | Container is a glue for Laravel 7 | 8 | * Routing 9 | * Middleware 10 | * Requests 11 | * Constructor Injection 12 | 13 | ### Naming Containers 14 | 15 | * The container 16 | * Application 17 | * IOC Container 18 | * DI Container 19 | 20 | ```php 21 | $logger = app(Illuminate\Log\Writer::class); 22 | ``` 23 | 24 | ### Autowiring 25 | 26 | Ability to instantiate a class without being given explicit instructions of how to... 27 | 28 | Framework will use reflection to determine and provide its dependencies. 29 | 30 | ### Manual Binding 31 | ```php 32 | app()->bind(MySelrvice::class, function(){ 33 | return new MyService('qwyuiyt'); 34 | }); 35 | 36 | $service = app(MyService::class); 37 | ``` 38 | 39 | Can also do with singleton: 40 | 41 | ```php 42 | app()->singleton(OnlyOne::class, function(){ 43 | return new OnlyOne(); 44 | }); 45 | 46 | app()->instance(OnlyOne::class); 47 | ``` 48 | 49 | ### Aliases 50 | ```php 51 | app()->alias(MyClass::class, 'myClass'); 52 | 53 | app()->alias( 54 | PostmarkMailer::class, 55 | Mailer::class 56 | ); 57 | 58 | ``` 59 | 60 | ### Service Providers 61 | 62 | Central location to bind services for use by your application code, usually grouped by functionality. 63 | 64 | #### Anatomy of a service provider 65 | 66 | * `register`: binding into container 67 | * `boot`: called after all registrations are complete 68 | * `defer?`: parameter that allows to avoid running service provider if certain bindings are not requested. 69 | * `provides`: if deferred, which bindings should be requested to run the service provider if deferred 70 | 71 | ### Facades 72 | 73 | They are actually rather static proxies... 74 | 75 | Examples: 76 | 77 | ```php 78 | Route::get(); 79 | Log::info(); 80 | DB::statement(); 81 | ``` 82 | 83 | Creating your facade: 84 | 85 | 1. Bind your class to container 86 | 2. Create Facade Class and point to a class name 87 | 3. Configure a facade alias 88 | 89 | #### Real Time Facades: 90 | 91 | Can prepend `Facades/` to the class name to call any class method" 92 | 93 | ```php 94 | class Thing { 95 | public function do() 96 | { 97 | //... 98 | } 99 | } 100 | 101 | Facades/Thing::do(); 102 | ``` 103 | -------------------------------------------------------------------------------- /2017-wathan-mocking.markdown: -------------------------------------------------------------------------------- 1 | Alternative Facts You've Been Told About Testing 2 | ------------------------------------------------ 3 | 4 | _Adam Wathan, Laracon Online 2017_ 5 | 6 | - **"Almost all of your tests should be unit tests."** 7 | - **"Your tests should never touch the database."** 8 | - **"If you can't test your code in isolation, it's poorly designed."** 9 | 10 | Are these true? 11 | 12 | ### An Example... (according to the lies you might have been told) 13 | 14 | [Products Controller with injected dependencies, using CommandBus, Repository] 15 | 16 | [A look at the test for ProductsController, completely using mocks] 17 | 18 | ### How Did We Do? (Measuring up to 'best practices') 19 | 20 | We passed all the alternative fact tests. :) But something isn't right. 21 | 22 | And the alternative fact folks would say "YOU'RE STILL DOING IT WRONG!" 23 | 24 | ### Let's Take Another Look... 25 | 26 | TDD is all about the red-green refactoring loop. 27 | 28 | - Write a failing test 29 | - Get it to pass 30 | - Refactor at will 31 | 32 | _If refactoring is a fundamental part of TDD, and isolated testing gets in the way of refactoring, then isolated unit testing is incompatible with TDD._ 33 | 34 | ### Diagram Time 35 | 36 | [Layout of program process and test] 37 | 38 | ### Let's Try This... 39 | 40 | **"Isolated Tests are a Scam."** - Adam Wathan, 2017 41 | 42 | ### What About External Services? 43 | 44 | How do you test making payments with Stripe, for example? 45 | 46 | ### Don't Worry About Isolation 47 | 48 | Instead, introduce boundaries _when they solve a real problem._ 49 | 50 | 51 | -------------------------------------------------------------------------------- /organized-links.markdown: -------------------------------------------------------------------------------- 1 | # Organized Links 2 | 3 | This list was posted on Slack by [luchaos](https://github.com/luchaos), and has been organized by topic. 4 | 5 | ## General 6 | * [GitHub - rodericktech/laracon-online-2017-notes: Notes from some Laracon Online 2017 presentations.](https://github.com/rodericktech/laracon-online-2017-notes) 7 | * [Comparison with Other Frameworks — Vue.js](https://vuejs.org/v2/guide/comparison.html) 8 | * [Server-Side Rendering — Vue.js](https://vuejs.org/v2/guide/ssr.html#ad) 9 | * [A Call For Web Developers To Deprecate Their CSS – CSS Perverts – Medium](https://medium.com/cool-code-pal/a-call-for-web-developers-to-deprecate-their-css-1f6430781393#.8hd1lg6f1) 10 | * [Laravel Collection “tap” Method - Laravel News](https://laravel-news.com/collection-tap) 11 | * [Laravel’s tap helper function explained - murze.be](https://murze.be/2017/02/laravels-tap-helper-function-explained/) 12 | * [GitHub - vuejs/awesome-vue: A curated list of awesome things related to Vue.js](https://github.com/vuejs/awesome-vue) 13 | * [The Laravel Certification Program](https://laravel.com/certification/) 14 | 15 | ## CSS 16 | * [Laracon Online | Rachel Andrew | Presentations](https://rachelandrew.co.uk/speaking/event/laracon-online) 17 | * [Grid by Example](http://gridbyexample.com/) 18 | * [Grid by Example - Usage examples of CSS Grid Layout](http://gridbyexample.com/examples/) 19 | * [Flexbox - CSS Reference](http://cssreference.io/flexbox/) 20 | * [CSS Reference - A free visual guide to CSS](http://cssreference.io/) 21 | * [A Complete Guide to Flexbox | CSS-Tricks](https://css-tricks.com/snippets/css/a-guide-to-flexbox/) 22 | * [Flexbox Froggy - A game for learning CSS flexbox](http://flexboxfroggy.com/) 23 | * [Learn Flexbox Through Examples](https://laracasts.com/series/learn-flexbox-through-examples) 24 | * [Léonie Watson | On CSS accessibility and drinking tea | CSS Day 2016 on Vimeo](https://vimeo.com/180566024) 25 | * [Bulma: a modern CSS framework based on Flexbox](http://bulma.io/) 26 | * [Box Alignment Cheatsheet - rachelandrew.co.uk](https://rachelandrew.co.uk/css/cheatsheets/box-alignment) 27 | * [The Holy Grail (of) Layout - Tutorial - a Collection by Steven Roberts on CodePen](http://codepen.io/collection/DEgogB/) 28 | * [Flexbox Tester · MadebyMike](https://madebymike.com.au/demos/flexbox-tester/) 29 | * [rachelandrew on CodePen](https://codepen.io/rachelandrew/) 30 | * http://caniuse.com/#feat=css-featurequeries 31 | * [CSS Grid. One layout method not the only layout method](https://rachelandrew.co.uk/archives/2017/01/18/css-grid-one-layout-method-not-the-only-layout-method/) 32 | * [GitHub - rachelandrew/cssgrid-ama: Ask me anything about CSS Grid Layout](https://github.com/rachelandrew/cssgrid-ama) 33 | 34 | ## Mobile Dev 35 | * https://framework7.io/ 36 | * [Weex](https://weex-project.io/) 37 | * [GitHub - alibaba/weex: A framework for building Mobile cross-platform UI](https://github.com/alibaba/weex) 38 | 39 | ## Tooling 40 | * [Measure and Improve Code Quality continuously with Scrutinizer](https://scrutinizer-ci.com/) 41 | * [Hyper™ - JS/HTML/CSS Terminal](https://hyper.is/) 42 | * [A Sequel Pro bundle to generate Laravel migration files from existing tables.](https://github.com/cviebrock/sequel-pro-laravel-export) 43 | * https://www.mailgun.com/ 44 | * [GitHub - github/hub: hub helps you win at git.](https://github.com/github/hub) 45 | * [Next-generation PHP infrastructure – appserver.io](http://appserver.io/) 46 | * https://laravelshift.com/ 47 | * [GitHub - bobthecow/git-flow-completion: Bash, Zsh and fish completion support for git-flow.](https://github.com/bobthecow/git-flow-completion) 48 | * [Postmark – Unmatched email delivery & troubleshooting](https://postmarkapp.com/) 49 | * [GitHub - mattstauffer/Torch: Examples of using each Illuminate component in non-Laravel applications](https://github.com/mattstauffer/torch) 50 | * [Messageheader](https://toolbox.googleapps.com/apps/messageheader/) 51 | * [Introducing Operator | News, Notes & Observations | Hoefler & Co.](https://www.typography.com/blog/introducing-operator) 52 | * [Medis - GUI Manager for Redis](http://getmedis.com/) 53 | * [GitHub - php-pm/php-pm: PPM is a process manager, supercharger and load balancer for PHP applications.](https://github.com/php-pm/php-pm) 54 | 55 | ### Packages 56 | * [Package for using ReactJS with Laravel](https://github.com/talyssonoc/react-laravel) 57 | * [GitHub - spatie/laravel-fractal: A Fractal service provider for Laravel and Lumen](https://github.com/spatie/laravel-fractal) 58 | * [GitHub - spatie/laravel-medialibrary: Associate files with Eloquent models](https://github.com/spatie/laravel-medialibrary) 59 | 60 | ### Testing Tools 61 | * [Codeception](http://codeception.com/) 62 | * [Jest · 🃏 Painless JavaScript Testing](https://facebook.github.io/jest/) 63 | 64 | ### Frameworks 65 | * [Bulma: a modern CSS framework based on Flexbox](http://bulma.io/) 66 | * [Vue.js 2 Component Framework | Vuetify.js](https://vuetifyjs.com/) 67 | 68 | ## Tutorials 69 | * [Clean up your Vue modules with ES6 Arrow Functions – dotdev](https://dotdev.co/clean-up-your-vue-modules-with-es6-arrow-functions-2ef65e348d41#.i3jmqqcqp) 70 | * [ES2015 Crash Course](https://laracasts.com/series/es6-cliffsnotes) 71 | * [Vue JS 2 - The Complete Guide (incl. Vuex) | Udemy](https://www.udemy.com/vuejs-2-the-complete-guide/) 72 | * [Flexbox Froggy - A game for learning CSS flexbox](http://flexboxfroggy.com/) 73 | * [Learn Flexbox Through Examples](https://laracasts.com/series/learn-flexbox-through-examples) 74 | * [The Holy Grail (of) Layout - Tutorial - a Collection by Steven Roberts on CodePen](http://codepen.io/collection/DEgogB/) 75 | * [Upgrading Your Test Suite for Laravel 5.4](https://adamwathan.me/2017/02/02/upgrading-your-test-suite-for-laravel-54/) 76 | * [Test-Driven Laravel at Laracon US 2016](https://adamwathan.me/2016/08/11/test-driven-laravel-at-laracon-us-2016/) 77 | * http://ohshitgit.com/ 78 | * [A successful Git branching model » nvie.com](http://nvie.com/posts/a-successful-git-branching-model/) 79 | * [git ready » reflog, your safety net](http://gitready.com/intermediate/2009/02/09/reflog-your-safety-net.html) 80 | * [Using Webpack 2 + HMR in Laravel Development – dotdev](https://dotdev.co/using-webpack-2-hmr-in-laravel-development-2f632d6d06c6#.m91dvm6bh) 81 | * [Best Zend OpCache Settings/Tuning/Config](https://www.scalingphpbook.com/blog/2014/02/14/best-zend-opcache-settings.html) 82 | * [Repositories - Composer](https://getcomposer.org/doc/05-repositories.md#path) 83 | 84 | ## Talks 85 | * [GOTO 2012 • Continuous Delivery: The Dirty Details • Mike Brittain - YouTube](https://www.youtube.com/watch?v=JR-ccCTmMKY) 86 | * [Léonie Watson | On CSS accessibility and drinking tea | CSS Day 2016 on Vimeo](https://vimeo.com/180566024) 87 | 88 | ## Slides 89 | * [Evan’s Laracon Online - Google Slides](https://docs.google.com/presentation/d/1jqxl5j2Z7v_Ykd1B-8QrJXiOzHHytu5iqRskYLgyp6k/edit#slide=id.p) 90 | * [Mastering the Illuminate Container // Speaker Deck](https://speakerdeck.com/mattstauffer/mastering-the-illuminate-container) 91 | -------------------------------------------------------------------------------- /readme.markdown: -------------------------------------------------------------------------------- 1 | Laracon Online 2017 Notes 2 | ------------------------- 3 | 4 | By request, here are the notes I took on some of the presentations given at Laracon 5 | Online 2017. 6 | 7 | Notes on Matt Stauffer's talk were added by Oleg Baranovsky ([olegvb](https://github.com/olegvb)). Thanks Oleg! 8 | 9 | The organized links from the conference were collected by [luchaos](https://github.com/luchaos) and arranged neatly by [amsphuel](https://github.com/amsphuel). Thanks to you both! 10 | 11 | Feel free to do what you like with these, but if anything interesting comes of whatever 12 | you do with them, let me know. :) 13 | --------------------------------------------------------------------------------