I have made a system where a user can create many documents which they can include in a PDF using dompdf.
Everything works fine but I've been asked if the customer can use a Wordpress-like shortcode in their documents for replacing with the company name. Something like:
[company_name]
This would return the name of the company for the current record of the active view, so it may be ABC Ltd for one and DEF Inc for another etc.
The shortcode would be inside a WYSIWYG area with the company name pulled from the active record, so something like:
Company name : ABC Ltd
Company address: A N Other Avenue, Citysville
Select documents:
- Terms of business [x]
- Contract [ ]
- Support services [x]
etc etc
When the PDF is created for this record, inside the selected documents the shortcode [company_name] will be replaced with ABC Ltd.
I've had a look for packages which could potentially handle this and have found https://github.com/webwizo/laravel-shortcodes - I'm not 100% sure if this does what I need, so if anyone has any advice as to whether this would do the trick or if there's another way to do it, it would be most appreciated. :)