I’ve been using the Atom text editor lately, which is getting really solid. I decided to port some of my Laravel and PHP snippets into an Atom package to get a feel for how to create packages and snippets in Atom. I am pleased with how easy it was to get started. I just typed Command + Shift + P and selected Package Generator: Generate Package. Specifically, check out Hacking Atom in the Atom flight manual to get started.

Check out my package on Atom.io Packages, the source code on Github or install it with APM: apm install larasnippets. You can also search “larasnippets” in the Atom settings and install it from the UI.

Larasnippets Atom Package

I like how I was able to easily break up snippets into separate .cson (CoffeeScript-Object-Notation) files, so its easy for developers to peek around at various snippet files instead of cramming them all into one file. I’ve tried to logically separate them in a way that makes it easy to find things.

I don’t plan on making an exhaustive list of snippets for Laravel; I just have a hand-full I go for that I use often. Since I write tests often, it makes sense for me to tab complete test and generate a new PHP unit test. I can also generate a new test case with testcase that imports Laravel’s migration traits. While I still bounce between PhpStorm and text editors, Atom is really starting to feel polished.


I decided to automate generated snippet documentation, learn more about how you can generate documentation for all your Atom plugin’s CSON snippets.