Skip to content

Commit

Permalink
Added example for passing data to view
Browse files Browse the repository at this point in the history
  • Loading branch information
chinleung committed Jul 14, 2020
1 parent 8223674 commit 9c61885
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ Route::multilingual('test')->view('welcome');
| GET\|HEAD | test | en.test | Illuminate\Routing\ViewController |
| GET\|HEAD | fr/teste | fr.test | Illuminate\Routing\ViewController |

### Passing data to the view

```php
Route::multilingual('test')->data(['name' => 'Taylor']);
Route::multilingual('test')->view('welcome', ['name' => 'Taylor']);
```

## Upgrading from 1.x to 2.x

To update from 1.x to 2.x, you simply have to rename the namespace occurrences in your application from `LaravelMultilingualRoutes` to `MultilingualRoutes`. The most common use case would be the `DetectRequestLocale` middleware.
Expand Down

0 comments on commit 9c61885

Please sign in to comment.