Change method boot
use Carbon\Carbon;
public function boot()
{
config(['app.locale' => 'id']);
| <script type="text/javascript"> | |
| $(document).ready(function() { | |
| // The event listener for the file upload | |
| document.getElementById('txtFileUpload').addEventListener('change', upload, false); | |
| // Method that checks that the browser supports the HTML5 File API | |
| function browserSupportFileUpload() { | |
| var isCompatible = false; | |
| if (window.File && window.FileReader && window.FileList && window.Blob) { |
| <?php | |
| // requires php5 | |
| define('UPLOAD_DIR', 'images/'); | |
| $img = $_POST['img']; | |
| $img = str_replace('data:image/png;base64,', '', $img); | |
| $img = str_replace(' ', '+', $img); | |
| $data = base64_decode($img); | |
| $file = UPLOAD_DIR . uniqid() . '.png'; | |
| $success = file_put_contents($file, $data); |