This file contains 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\Nova\Fields; | |
use Illuminate\Http\Resources\MergeValue; | |
use Laravel\Nova\Fields\KeyValue; | |
use Str; | |
trait HasJsonField | |
{ |
This file contains 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
/** | |
* Converts file to base64 | |
* | |
* @param {File} file | |
* @return {Promise<String>} | |
*/ | |
export default file => { | |
return new Promise(resolve => { | |
const reader = new FileReader(); | |
reader.readAsDataURL(file); |
This file contains 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
const DEFAULT = null; | |
const IS_LOADING = 0; | |
const IS_LOADED = 1; | |
const IS_FAILED = 2; | |
export default { | |
data: { | |
loading: DEFAULT, | |
}, |