Skip to content

Commit 7df64a9

Browse files
committed
Updated documentation with the upgrade guide
1 parent c648467 commit 7df64a9

File tree

2 files changed

+40
-12
lines changed

2 files changed

+40
-12
lines changed

README.md

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Laravel package to create beautiful common views like tables using only PHP code
99
![](doc/laravel-views.png)
1010

1111
- [Version compatibility](#version-compatibility)
12+
- [Upgrade guide](#upgrade-guide)
1213
- [Installation and basic usage](#installation-and-basic-usage)
1314
- [Installing laravel views](#installing-laravel-views)
1415
- [Publishing assets](#publishing-assets)
@@ -26,10 +27,10 @@ Laravel package to create beautiful common views like tables using only PHP code
2627
- [Roadmap](#roadmap)
2728

2829
# Version compatibility
29-
|Laravel views|Livewire|Laravel|
30-
|-|-|-|
31-
|2.x|2.x|7.x, 8.x|
32-
|1.x|1.x|5.x, 6.x|
30+
|Laravel views|Alpine|Livewire|Laravel|
31+
|-|-|-|-|
32+
|2.x|2.8.x, 3.x.x|2.x|7.x, 8.x|
33+
|1.x|2.8.x|1.x|5.x, 6.x|
3334

3435
# Installation and basic usage
3536

@@ -179,11 +180,21 @@ Here's the plan for what's coming:
179180

180181
## Upgrade guide
181182
### From 2.2 to 2.3
182-
- Clear your cached views `php artisan view:clear` since some of the internal components changed.
183-
- Update assets
184-
- Update components.
185-
- Update config-file.
186-
- Update the renderIf() function in your action classes as follows:
183+
**Cached views**
184+
185+
The blade directives have changed, you need to clear the cached views with `php artisan view:clear`
186+
187+
**Public assets**
188+
189+
The main assets (JS and CSS files) have changed, you need to publish the public assets again with `php artisan vendor:publish --tag=public --provider='LaravelViews\LaravelViewsServiceProvider' --force`
190+
191+
**Publish blade componentes**
192+
193+
Some of the internal components have changed, if you have published these components before to customize them, you will not have them up to date, unfourtunately you need to publish them again with `php artisan vendor:publish --tag=views --provider='LaravelViews\LaravelViewsServiceProvider'` and customize them as you need.
194+
195+
**Method `renderIf()` in actions**
196+
197+
Update the renderIf() function in your action classes adding a new `$view` parameter as follows:
187198
```php
188199
<?php
189200

@@ -200,4 +211,21 @@ Here's the plan for what's coming:
200211
}
201212
}
202213
```
203-
- **(Optional)**, if your `repository` methods are returning the query object without any query applied like `User::query()`, you can define a `protected $model = User::class;` instead, this is the default behavior now, the `repository` method is still working so you don't need to change anything if you don't want to.
214+
**Publish config file (Optional)**
215+
216+
Some new variants have been added to the config file, if you have published the config file before, you could publish it again so you can customize the new variants, this doesn't affect anything at all since the new variants will be taken from the default config file.
217+
218+
**Remove `repository` method from your views (Optional)**
219+
If your `repository` methods are returning a query object without any query applied like `User::query()`, you can define a `protected $model = User::class;` instead, this is the default behavior now, the `repository` method is still working so you don't need to change anything if you don't want to.
220+
221+
```php
222+
/* Before */
223+
public function repository(): Builder
224+
{
225+
// You are using a single query
226+
return User::query();
227+
}
228+
229+
/** After */
230+
protected $model = User::class;
231+
```

doc/laravel-views.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
# Version compatibility
2424
|Laravel views|Alpine|Livewire|Laravel|
2525
|-|-|-|-|
26-
|2.x|2.8.x|2.x|7.x, 8.x|
27-
|1.x|2.8.x|1.x|5.x, 6.x|
26+
|2.x|2.8.x, 3.x.x|2.x|7.x, 8.x|
27+
|1.x|2.8.x, 3.x.x|1.x|5.x, 6.x|
2828

2929
# Installation and basic usage
3030

0 commit comments

Comments
 (0)