Open vinicius73 opened 9 years ago
That would be great! I'd like to use this package for Laravel 4.2 actually.
@rombat you can use https://github.com/vinicius73/SeoTools
Quando finalizarmos os testes vou pra essa :D
All you would have to do is remove all of the laravel helper functions (like array_forget() and array_get()) -- or better yet, include those functions in your own helpers.php file and include them via composer.json like:
"files": [
"src/resources/helpers.php"
]
but once all of the helper functions are taken care of, the package is already agnostic. Someone not using Laravel could simply not register the service provider or alias, and use:
<?php
use Artesaos\SEOTools\SEOTools as SEO;
class SomeClass
{
public function generateView()
{
SEO::setTitle('Home')->setDescription('Welcome to my website!');
echo SEO::generate();
}
}
obviously, that's an odd example, but it shows that a user can already use the package without Laravel. This is because the only thing Laravel is used for is setting up the Aliases and config (I am remove the config in my next pull, so if that is accepted, you won't have to worry about the config)
^^ As a matter of fact, someone using Laravel can even use the package without the Service Provider (once the config is gone)
Transforming the package in a package that does not depend on Laravel.
Transformar o pacote em um pacote que não dependa do Laravel.