https://github.com/danielme85/laravel-forceutf8
Laravel 5 service class for neitanod's forceutf8. https://github.com/neitanod/forceutf8
https://github.com/danielme85/laravel-forceutf8
Last synced: 12 months ago
JSON representation
Laravel 5 service class for neitanod's forceutf8. https://github.com/neitanod/forceutf8
- Host: GitHub
- URL: https://github.com/danielme85/laravel-forceutf8
- Owner: danielme85
- License: mit
- Created: 2016-11-02T15:38:14.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-04-16T17:37:11.000Z (about 8 years ago)
- Last Synced: 2024-11-15T18:09:29.253Z (over 1 year ago)
- Language: PHP
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# laravel-forceutf8
Simple Laravel 5 service class for neitanod's forceutf8: https://github.com/neitanod/forceutf8
### Install
Add to composer.json
```
"require": {
"danielme85/laravel-forceutf8": "dev-master",
....
}
```
If you use Laravel 5.5+ you could skip the next step as Composer/Laravel Auto-discovery has been enabled for this package.
#### Laravel 5.x
Add to your config/app.php under Service Providers
```
//Service Provider
danielme85\ForceUTF8\ForceUTF8ServiceProvider::class,
//Facade
'Encoding' => danielme85\ForceUTF8\Encoding::class,
```
#### Lumen 5.x
Add to your boostrap/app.php file
```
$app->register(danielme85\ForceUTF8\ForceUTF8ServiceProvider::class);
...
$app->configure('app');
...
class_alias('danielme85\ForceUTF8\Encoding', 'Encoding');
$app->withFacades();
```
### Usage
```
use danielme85\ForceUTF8\Encoding;
...
$newstring = Encoding::toUTF8($string);
```
Chekout neitanod's repo for more information on how to use the Encoding class:
https://github.com/neitanod/forceutf8