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
| export default { | |
| name: 'broadcasting', | |
| data() { | |
| return { | |
| broadcasting: this.$broadcasting | |
| } | |
| }, | |
| computed: { | |
| ...mapState('auth', { | |
| currentUser: (state) => state.currentUser, |
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
| Detect users Timezone from javascript | |
| We have awesome library moment.js in JS world which can do all sorts of things with time, parse, validate, manipulate, and display dates and times in any formatting, it has also support to handle the timezone. | |
| Pull the following in libraries: | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.20.1/moment.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.14/moment-timezone.min.js"></script> | |
| Now if you check you chrome developer console you will have access to following methods provided by moment. |
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
| export default class ExceptionRenderer{ | |
| constructor(html) { | |
| this.html = html | |
| } | |
| /** | |
| * Render Exception | |
| */ | |
| render(){ | |
| if(this.html && !document.getElementById('exception')){ |
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
| export default class Response { | |
| constructor(response) { | |
| this.data = response.data | |
| this.headers = response.headers | |
| this.status = response.status | |
| } | |
| /** | |
| * Is response invalid? |
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
| export default class Validator{ | |
| constructor(){ | |
| this.message = null | |
| this.exception = null | |
| this.messageBag = {} | |
| } | |
| /** | |
| * Make New Instance | |
| * @param data |
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; | |
| trait HasMemoization | |
| { | |
| protected static $memoized = []; | |
| /** | |
| * Memoize Operation Result | |
| * @param $key |
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; | |
| use Illuminate\Support\Facades\Cache; | |
| class GithubWiki | |
| { | |
| // GithubWiki::make('MyPage') | |
| const CACHE = 60*60*24; | |
| const ENDPOINT = 'https://raw.githubusercontent.com/wiki/username/repo/'; |
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 = { | |
| prefix: '', | |
| important: false, | |
| separator: ':', | |
| theme: { | |
| screens: { | |
| sm: '640px', | |
| md: '768px', | |
| lg: '1024px', | |
| xl: '1280px', |
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 | |
| public function upload() | |
| { | |
| $this->validate($this->request, [ | |
| 'file' => 'required|image', | |
| ]); | |
| $file = $this->request->file('file'); |
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
| <script> | |
| import { FormField, HandlesValidationErrors } from 'laravel-nova' | |
| export default { | |
| mixins: [FormField, HandlesValidationErrors], | |
| props: ['resourceName', 'resourceId', 'field'], | |
| data: () =>({ | |
| results: [ | |
| // { label: "British Virgin Islands, (VG)", value: 41198 }, | |
| // { label: "Zambia", value: 41203 }, | |
| ], |