ben-g
7/24/2014 - 8:11 PM

laravel-louisville-show-notes.md

Charles Griffin

Populating chart.js with query data

Look at the docs for the specifics on how to setup a div that can be referenced by the chart.js api.

http://www.chartjs.org/docs/

Each link points to a laravel.io paste viewer

Dynamically adding filters and sorters to Query Builder

Brian Webb

Laravel Tips / Tricks

Database Query Logging

HTML / Form Macros how-to

Automatic Dependency Injection w/ IoC

Artisan Tinker + Framework usage of Carbon

  • php artisan tinker is an interactive PHP session with the framework loaded.
  • Laravel automatically converts model attributes that it knows are dates (updated_at, created_at, deleted_at) to Carbon\Carbon objects. So you can call useful Carbon methods on them.
    • echo "\n\n". $c->addHours(2)->addMinutes(10)->timezone('America/New_York') ."\n\n";

Pro Tools / Packages you should checkout

codesleeve/laravel-stapler

Easily manage attachments / file uploads on your models. This package takes care of everything from path, url, deleting the files when a model object is deleted, processing alternate representations, saving to S3 etc.

venturecraft/revisionable

This package allows you to painlessly track what fields of a model where changed (from and to) by who (Auth integration) and when.

  • Add use \Venturecraft\Revisionable\RevisionableTrait; to your model
  • Magically now have $myModel->revisionHistory()

tijsverkoyen/css-to-inline-styles

This packages allows you to convert HTML and CSS into one big ball of HTML with all your stylesheet styles inlined on the appropriate HTML tags. Without hitting any remote API.

Blade Template

<p class="alert alert-success">
    <b>{{ $changed_by }}</b> updated the doc making the changes shown below on <b>{{ $changed_on }}</b>.  Click <a href="{{ route('docs.show', $doc_id) }}">here</a> to see the current version of the doc.
</p>

Compiled HTML for the email

<p class=3D"alert alert-success" style=3D"orphans: 3; widows: 3; -m=
oz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: bord=
er-box; margin: 0 0 10px; border: 1px solid transparent; border-radius: 4px=
; margin-bottom: 20px; padding: 15px; background-color: #dff0d8; border-col=
or: #d6e9c6; color: #3c763d;"> <b style=3D"font-weight: 700; -moz-box-sizing: border-box; -web=
kit-box-sizing: border-box; box-sizing: border-box;">Brian Webb</b>=20 updated the doc making the changes shown below on <b style=3D"font-weight: 700; -moz-box-sizing: border-box; -web=
kit-box-sizing: border-box; box-sizing: border-box;">Tuesday July 22nd 2014=
 at 03:53:45 PM</b>. Click <a href=3D"http://mandrillapp.com/track/click.php?u=3D302=
47258&id=3D7a9bbce7654a444585098dc5092fbb87&url=3Dhttp%3A%2F%2Fdocs=
tack.io%2Fdocs%2F81&url_id=3D69d8f5e245c7d6ffe7af35cfc1af18f8c1a28ca8" =
style=3D"background: 0 0; text-decoration: none; -moz-box-sizing: border-bo=
x; -webkit-box-sizing: border-box; box-sizing: border-box; color: #428bca;"=
>here</a> to see the current version of the doc.
</p>