This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Traits; | |
use Rhumsaa\Uuid\Uuid; | |
use Illuminate\Database\Eloquent\ModelNotFoundException; | |
/** | |
* Trait UuidModel | |
* @package App\Traits |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Traits; | |
use Rhumsaa\Uuid\Uuid; | |
use Illuminate\Database\Eloquent\ModelNotFoundException; | |
/** | |
* Trait UuidModel | |
* @package App\Traits |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Binds creating/saving events to create UUIDs (and also prevent them from being overwritten). | |
* | |
* @return void | |
*/ | |
public static function bootUuidModel() | |
{ | |
static::creating(function ($model) { | |
// Don't let people provide their own UUIDs, we will generate a proper one. | |
$model->uuid = Uuid::uuid4()->toString(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Scope a query to only include models matching the supplied UUID. | |
* Returns the model by default, or supply a second flag `false` to get the Query Builder instance. | |
* | |
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException | |
* | |
* @param \Illuminate\Database\Schema\Builder $query The Query Builder instance. | |
* @param string $uuid The UUID of the model. | |
* @param bool|true $first Returns the model by default, or set to `false` to chain for query builder. | |
* @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Builder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Scope a query to only include models matching the supplied ID or UUID. | |
* Returns the model by default, or supply a second flag `false` to get the Query Builder instance. | |
* | |
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException | |
* | |
* @param \Illuminate\Database\Schema\Builder $query The Query Builder instance. | |
* @param string $uuid The UUID of the model. | |
* @param bool|true $first Returns the model by default, or set to `false` to chain for query builder. | |
* @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Builder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
entry: getEntrySources(['./src/js/entry.js']), | |
output: { | |
publicPath: 'http://localhost:8080/', | |
filename: 'build/bundle.js' | |
}, | |
devtool: 'eval', | |
module: { | |
preLoaders: [ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "humaan-demo-webpack-react-app", | |
"version": "1.0.0", | |
"description": "A basic environment for writing React apps in ES6 and built using webpack", | |
"private": true, | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"webpack-server": "webpack-dev-server --hot --progress --colors", | |
"web-server": "http-server -p 3000 .", | |
"start": "npm run webpack-server & npm run web-server" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"images": { | |
"low_resolution": { | |
"url": "https://scontent.cdninstagram.com/hphotos-xfp1/t51.2885-15/s320x320/e35/12338585_1668903330056644_140182574_n.jpg", | |
"width": 320, | |
"height": 320 | |
}, | |
"thumbnail": { | |
"url": "https://scontent.cdninstagram.com/hphotos-xfp1/t51.2885-15/s150x150/e35/12338585_1668903330056644_140182574_n.jpg", | |
"width": 150, | |
"height": 150 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"images": { | |
"low_resolution": { | |
"url": "https://scontent.cdninstagram.com/hphotos-xap1/t51.2885-15/s320x320/e35/1172990_1289634271062707_99066703_n.jpg", | |
"width": 320, | |
"height": 276 | |
}, | |
"thumbnail": { | |
"url": "https://scontent.cdninstagram.com/hphotos-xap1/t51.2885-15/s150x150/e35/c73.0.934.934/1172990_1289634271062707_99066703_n.jpg", | |
"width": 150, | |
"height": 150 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Determines whether the browser supports localStorage or not. | |
* | |
* This method is required due to iOS Safari in Private Browsing mode incorrectly says it supports localStorage, when it in fact does not. | |
* | |
* @kind function | |
* @function LocalStorage#supportsLocalStorage | |
* | |
* @returns {boolean} Returns true if setting and removing a localStorage item is successful, or false if it's not. | |
*/ |
OlderNewer