For the begginers in coding like me who are struggling to implement the great Signature Pad librairy in Laravel framework. I've decided to use AJAX to POST it.
PHP : PHP 7.1.23
Laravel : Laravel Framework 5.8.27
https://github.com/szimek/signature_pad
I have used Bootstrap already available in Laravel https://laravel.com/docs/5.8/frontend
I have used 3 CDN:
<!-- Jquery -->
<script src="http://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Ajax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<!-- Signature Pad -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/signature_pad.min.js"></script>
1 / See the signature_pad.umd.js file in ressources->js->signature_pad.umd.js
Don't forget to require this file in app.js, ressources->js->app.js :
require('./signature_pad');
2 / See the CSS class .wrapper and .signature-pad in the file app.css, public->css->app.css
In this app my model is 'Signature' with the string attribut 'file'