Bootstrap 3 and Webpack

My time spent learning Laravel recently has forced me to take a look at webpack. Laravel uses webpack as the frontend tool of choice for compiling javascript and css files. Laravel ships with an abstraction on top of the tool called Laravel Mix that takes care of some of the configuration and makes the process a little easier. Having used it a little bit I became curious about implementing webpack in a couple of smaller projects independently.

I decided to start with something simple–jquery and bootstrap, but quickly found that even something that simple was not as simple as it would appear. After some searching and some comparisons I was able to make something work. I’m going to detail what I found, since I wasn’t able to find a lot out there that was complete and simplified.

Continue reading “Bootstrap 3 and Webpack”

Laravel API Authentication Middleware

Laravel 5.6 has a native API authentication middleware as an alternative to Passport (https://laravel.com/docs/5.6/passport). If you are not running an up-to-date version of PHP on your servers however, you are going to have some difficulties using Password (as I learned the hard way). After doing some digging I ran across an article for versions 5.2 and 5.3 (see link below) which I found still applicable.

Continue reading “Laravel API Authentication Middleware”

Logging Email with Laravel

Laravel provides the Mail facadeĀ (as of version 5.6) which acts as a wrapper around the PHP email library Swift Mailer.

Any application that sends emails needs to have logging for send events. No one wants to go wading through Linux sendmail logs or bothering sysadmins to go through Exchange logs.

Swift Mailer provides a couple of different logging plugins natively. Laravel provides decent documentation around their Mail facade but omit some details. One feature they leave out are Swift Mailer’s plugins and how to access them using the wrapper.

Continue reading “Logging Email with Laravel”