diff --git a/README.md b/README.md index b135bb3d..d98d30ab 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Ziggy supports all versions of Laravel from `5.4` to `7.x`. - [Advanced Whitelisting using Groups](#advanced-whitelisting-using-groups) - [Other Useful Methods](#other-useful-methods) - [`current()`](#current) + - [`check()`](#check) - [`url()`](#url) - [Artisan Command](#artisan-command) - [Using with Vue Components](#using-with-vue-components) @@ -211,6 +212,15 @@ route().current('events.*'); // returns true ``` +#### `check()` + +Ziggy can check if a given named route is defined: + +```js +route().check('home'); +// returns true if a route name 'home' exists, false otherwise +``` + #### `url()` Ziggy returns a wrapper of the JavaScript [String primitive](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), which behaves exactly like a string in almost all cases. In rare cases, such as when third-party libraries use strict type checking, you may need an actual string literal.