Skip to content

Instantly share code, notes, and snippets.

View densityx's full-sized avatar
☀️
full power

Ahmad Aziz densityx

☀️
full power
View GitHub Profile
// 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 December 24, 2018 11:12
Listening global events and performing action for it
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 December 24, 2018 08:59
Dispatch job in laravel seeder after model creation
factory(User::class, 10)->create()->each(function ($user) {
GenerateUserPoster::dispatch($user);
});
@densityx
densityx / help.txt
Last active September 11, 2015 01:36
#User Model
===========
<?php
... class User
{
public function videos() {
return $this->belongsTo('Watch\Video');