diff --git a/readme.md b/readme.md index 50a98af..9ae55c4 100644 --- a/readme.md +++ b/readme.md @@ -36,6 +36,14 @@ For Laravel users, there is a service provider you can make use of to automatica When this provider is booted, you'll gain access to a helpful `JavaScript` facade, which you may use in your controllers. +## Usage + +#### JavaScript::put(...) + +The `JavaScript` facade has two public functions. The first/main one is `JavaScript::put(...)`, which transforms the given PHP data and passes it to the front-end view file. + +For example: + ```php public function index() { @@ -61,17 +69,53 @@ console.log(age); // 29 This package, by default, binds your JavaScript variables to a "footer" view, which you will include. For example: -``` +```html