Skip to content

Commit 50258ce

Browse files
committed
Update README.md
1 parent b95d2a7 commit 50258ce

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,23 @@ LaravelStub::from(__DIR__ . 'model.stub')
312312
->generateIf(true);
313313
```
314314

315+
<a name="generate-unless"></a>
316+
### `generateUnless`
317+
318+
If you want to generate a stub file if given boolean expression evaluates to `false`, you can use the `generateIf` method:
319+
320+
```php
321+
LaravelStub::from(__DIR__ . 'model.stub')
322+
->to(__DIR__ . '/App')
323+
->name('new-model')
324+
->ext('php')
325+
->replaces([
326+
'NAMESPACE' => 'App',
327+
'CLASS' => 'Milwad'
328+
])
329+
->generateUnless(true);
330+
```
331+
315332
<a name="contributors"></a>
316333
## Contributors
317334

0 commit comments

Comments
 (0)