Skip to content

Commit

Permalink
Update field.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tabuna authored Nov 4, 2024
1 parent 1a9a7e4 commit aafe29d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/en/docs/field.md
Original file line number Diff line number Diff line change
Expand Up @@ -1109,15 +1109,19 @@ Button::make('Delete')

> **Tip:** Use clear and concise messaging in `confirm()` so the user understands the consequences.
### Sending Data to an External URL
### Specifying the URL for Data Submission

To send data to an external URL, use the `action()` method. This is useful if you need to submit a form to a destination outside the current screen.
To specify the URL where the form data should be sent, use the `action()` method. Typically, this will be the URL of a controller within your application where the request is processed after the button is clicked.

```php
Button::make('Submit')
->action('https://orchid.software');

Button::make('Submit')
->action(route('controller.method'));
```


### File Download

To initiate a file download when clicking a button, use the `download()` method. This signals the system that the result of the method execution will be a downloadable file rather than simply displaying it in the browser.
Expand Down

0 comments on commit aafe29d

Please sign in to comment.