Upgrading | laravel-html | Spatie

 SPATIE

  Laravel HTML
===============

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-html](https://spatie.be/docs/laravel-html/v3)  Upgrading

 Version   v3   v2   v1

 Other versions for crawler [v3](https://spatie.be/docs/laravel-html/v3) [v2](https://spatie.be/docs/laravel-html/v2) [v1](https://spatie.be/docs/laravel-html/v1)

- [ Introduction ](https://spatie.be/docs/laravel-html/v3/introduction)
- [ Postcardware ](https://spatie.be/docs/laravel-html/v3/postcardware)
- [ Installation &amp; setup in Laravel ](https://spatie.be/docs/laravel-html/v3/installation-setup)
- [ Upgrading ](https://spatie.be/docs/laravel-html/v3/upgrading)
- [ Questions and issues ](https://spatie.be/docs/laravel-html/v3/questions-issues)
- [ Changelog ](https://spatie.be/docs/laravel-html/v3/changelog)

General usage
-------------

- [ Core concepts ](https://spatie.be/docs/laravel-html/v3/general-usage/core-concepts)
- [ Extending the package ](https://spatie.be/docs/laravel-html/v3/general-usage/extending)
- [ HTML builder ](https://spatie.be/docs/laravel-html/v3/general-usage/html-builder)
- [ Element classes ](https://spatie.be/docs/laravel-html/v3/general-usage/element-classes)
- [ Element methods ](https://spatie.be/docs/laravel-html/v3/general-usage/element-methods)
- [ The class() helper ](https://spatie.be/docs/laravel-html/v3/general-usage/the-class-helper)

 Upgrading
=========

### From v1 to v2

Version 2 was created because the typehints in version 1 was holding the package back in some cases (like multiple select which requires an array of values instead of a string which was assumed).

Luckily, bumping the version number in `composer.json` and running `composer update` should be non-breaking. Here are some caveats to look out for:

- The package now ships with a `html()` function by default, which returns an instance of the `Html` builder class. If you've defined your own method, you'll need to remove it.
- Various type hints have been removed throughout the package, if you've extended a class to override it's methods, you'll need to update them accordingly (everything still behaves the same!)
