PHPNews

Query Strings and VueJS

Quick way to make the url reflect the query string so the user can share the url and filters. This is component based VueJS building so not an SPA But I still install `"vue-router": "^3.0.1"` And load it ``` import VueRouter from 'vue-router'; Vue.use(VueRouter); ``` The on the component I set a watch on the …

Continue reading »

Written by Alfred Nutile RSS - - Aggregated on Tuesday May 8, 2018


Lambda and Github Webhooks

Related to https://developer.github.com/webhooks/ and pushing data to Lambda AWS. I can check the token by just having this check in my handler. ``` const crypto = require('crypto'); exports.handler = (event, context, callback) => { let headers = event.headers; let body = event.body; if (typeof body === …

Continue reading »

Written by Alfred Nutile RSS - - Aggregated on Tuesday May 8, 2018


Debugging AWS SAM

This took a few to get just right, for one the command needs to be in the correct order ``` sam local invoke --event fixtures/latest_not_working.json -d 5858 GithubPushes ``` From here it gave me the output I was looking for: ``` sam local invoke --event fixtures/latest_not_working.json -d 5858 GithubPushes 2018/05…

Continue reading »

Written by Alfred Nutile RSS - - Aggregated on Monday May 7, 2018


BrowserSync and Laravel

Quick reminder to take advantage of this amazing feature [https://laravel.com/docs/5.6/mix#browsersync-reloading](https://laravel.com/docs/5.6/mix#browsersync-reloading) No more reloading your browser. ``` yarn add browser-sync --dev ``` then to your `webpack.mix.js` e.g. the domain of the site you are working …

Continue reading »

Written by Alfred Nutile RSS - - Aggregated on Monday March 19, 2018


GroupBy not Sorting by latest

Just to make this easy to find. I had a report to write which had numerous daily rows of the same related model data. So in this cause I was tracking servers and security reports. My reports where daily like this | id | server_id | failed | type | | ------------- |:-------------:| -----:| ---| |1|1…

Continue reading »

Written by Alfred Nutile RSS - - Aggregated on Sunday March 18, 2018


BrowserSync and Laravel

Quick reminder to take advantage of this amazing feature [https://laravel.com/docs/5.6/mix#browsersync-reloading](https://laravel.com/docs/5.6/mix#browsersync-reloading) No more reloading your browser. ``` yarn add browser-sync --dev ``` then to your `webpack.mix.js` e.g. the domain of the site you are working …

Continue reading »

Written by Alfred Nutile RSS - - Aggregated on Thursday March 15, 2018


Wrapping Libraries in Services JS

Just a note to self that when using libraries like `sweetalert` for example and then I want to convert to `sweetalert2`, it would have saved a lot of time to wrap it into a "service" and import that. For example I made this js file `services/Alerts.js`: ``` import swal from 'sweetalert2'; export default { …

Continue reading »

Written by Alfred Nutile RSS - - Aggregated on Monday March 5, 2018


Wrapping Libraries in Services JS

Just a note to self that when using libraries like `sweetalert` for example and then I want to convert to `sweetalert2`, it would have saved a lot of time to wrap it into a "service" and import that. For example I made this js file `services/Alerts.js`: ``` import swal from 'sweetalert2'; export default { …

Continue reading »

Written by Alfred Nutile RSS - - Aggregated on Thursday March 1, 2018


Pusher and Laravel Updates

Getting error "Did you forget to specify the cluster when creating the Pusher instance" Then need to set `config/broadcasting.php`: ``` 'pusher' => [ 'driver' => 'pusher', 'key' => env('PUSHER_KEY'), 'secret' => env('PUSHER_SECRET'), 'app_id' => …

Continue reading »

Written by Alfred Nutile RSS - - Aggregated on Tuesday February 27, 2018


Passing from Blade to VueJs

A lot of posts had [this](https://medium.com/@m_ramsden/passing-data-from-laravel-to-vue-98b9d2a4bd23) style. I ended up just needing this: ![](https://dl.dropboxusercontent.com/s/huucm3vx4uyklq7/Screenshot%202018-02-23%2020.29.22.png?dl=0) The controller simply does this: ![](https://dl.dropboxusercontent.com/s/q…

Continue reading »

Written by Alfred Nutile RSS - - Aggregated on Saturday February 24, 2018


Docker Laravel and Cron

This to this post [here](https://laracasts.com/discuss/channels/servers/run-the-scheduler-in-a-docker-image/replies/325422) for the idea. Basically running cron in Docker is easy BUT once the Host had more than one Docker client cron stopped working. No clue why but to solve this I did two things One made a …

Continue reading »

Written by Alfred Nutile RSS - - Aggregated on Friday February 16, 2018


Pusher and Laravel Updates

Getting error "Did you forget to specify the cluster when creating the Pusher instance" Then need to set `config/broadcasting.php`: ``` 'pusher' => [ 'driver' => 'pusher', 'key' => env('PUSHER_KEY'), 'secret' => env('PUSHER_SECRET'), 'app_id' => …

Continue reading »

Written by Alfred Nutile RSS - - Aggregated on Wednesday February 14, 2018


Dusk and Production (with Dusk disabled)

``` In DatabaseServiceProvider.php line 78: Class 'Faker\Factory' not found ``` I had a ton if issues getting dusk on production, especially since production would run ``` composer install --no-dev --prefer-dist --no-interaction ``` To get around this issue I had to do a few things One, if you are stuck and can …

Continue reading »

Written by Alfred Nutile RSS - - Aggregated on Thursday February 8, 2018


Dusk and Production

``` In DatabaseServiceProvider.php line 78: Class 'Faker\Factory' not found ``` I had a ton if issues getting dusk on production, especially since production would run ``` composer install --no-dev --prefer-dist --no-interaction ``` To get around this issue I had to do a few things One, if you are stuck and can …

Continue reading »

Written by Alfred Nutile RSS - - Aggregated on Monday February 5, 2018