Skip to content

Instantly share code, notes, and snippets.

☀️
im'a dream catcher

Ahmad Aziz densityx

☀️
im'a dream catcher
  • Kuala Lumpur
View GitHub Profile
View plugin-file-and-camera.js
// window.resolveLocalFileURL(path, callback success, callback error)
// Tasks
/**
1. retrieve the app's folder. create if it doesn't exist
2. retrieve the image file
3. move image to app folder
*/
@densityx
densityx / event-service-provider.php
Created Dec 24, 2018
Listening global events and performing action for it
View event-service-provider.php
Event::listen(CommandStarting::class, function ($event) {
if ($event->command === 'migrate:fresh') {
Storage::deleteDirectory('/public/clubs');
Storage::deleteDirectory('/public/users');
}
});
@densityx
densityx / users-db-seeder.php
Created Dec 24, 2018
Dispatch job in laravel seeder after model creation
View users-db-seeder.php
factory(User::class, 10)->create()->each(function ($user) {
GenerateUserPoster::dispatch($user);
});
View help.txt
#User Model
===========
<?php
... class User
{
public function videos() {
return $this->belongsTo('Watch\Video');
You can’t perform that action at this time.