Skip to content

Commit

Permalink
Merge pull request #29 from chriskonnertz/2.0-dev
Browse files Browse the repository at this point in the history
2.0 dev into master
  • Loading branch information
chriskonnertz authored Apr 18, 2019
2 parents 5cd5d04 + 25d1648 commit db0cebd
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 122 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ language: php
dist: precise

php:
- 5.3
- 5.6
- 7.2
- 7.1
- 7.3

before_script:
- curl -s http://getcomposer.org/installer | php
- php composer.phar install --dev
- php composer.phar require "phpunit/phpunit:~6"

script: phpunit
script:
- ./vendor/bin/phpunit
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Library that assists in building Open Graph meta tags.
Add `chriskonnertz/open-graph` to `composer.json` with a text editor:

```
"chriskonnertz/open-graph": "~1"
"chriskonnertz/open-graph": "~2"
```

Or via a console:
Expand All @@ -23,7 +23,7 @@ composer require chriskonnertz/open-graph

In the future use `composer update` to update to the latest version of Open Graph Builder.

> This library supports PHP >=5.3.
> This library requires PHP >=7.0.
### Framework Support

Expand All @@ -32,28 +32,28 @@ In Laravel 5.0-5.4 you have to edit your `config/app.php` config file.
You can either add an alias to the object so you can create a new instance via `new OpenGraph()` ...

```php
'aliases' => array(
'aliases' => [
...
'OpenGraph' => 'ChrisKonnertz\OpenGraph\OpenGraph',
),
],
```

...or an alias to the facade (this is what happens in Laravel >=5.5 via package auto-discovery) so you
do not have to create the instance by yourself but you can access it via pseudo-static methods.
If you choose this path you also have to add the service provider to the config file:

```php
'aliases' => array(
'aliases' => [
...
'OpenGraph' => 'ChrisKonnertz\OpenGraph\OpenGraphFacade',
),
],

...

'providers' => array(
'providers' => [
...
'ChrisKonnertz\OpenGraph\OpenGraphServiceProvider',
),
],
```

> If you need to reset the underlying instance of the facade (the `OpenGraph` object), call `OpenGraph::clear()`.
Expand All @@ -76,8 +76,6 @@ Render these tags in a template as follows:
{!! $og->renderTags() !!}
```

> In Laravel 4 you have to use ``{{ ... }}`` tags to avoid escaping.
Providing Open Graph tags enriches web pages. The downside is some extra time to spend, because every model has its own way to generate these tags. It's also important to follow the [official protocol](http://ogp.me/). Read the documentation to learn more about the tags that are available and the values they support or [check out examples](https://github.com/niallkennedy/open-graph-protocol-examples). Please note that this implementation sticks to the specification of OGP.me and does not support the enhancements created by Facebook.

## Add Tags And Attributes
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "chriskonnertz/open-graph",
"description": "Class that assists in building Open Graph meta tags",
"keywords": ["opengraph", "open graph", "ogp", "laravel", "laravel4", "laravel5"],
"keywords": ["opengraph", "open graph", "ogp", "laravel", "laravel5"],
"license": "MIT",
"authors": [
{
"name": "Chris Konnertz"
}
],
"require": {
"php": ">=5.3.7"
"php": ">=7.0"
},
"require-dev": {
"nesbot/carbon": "~1.14"
"nesbot/carbon": "~1"
},
"autoload": {
"psr-0": {
Expand Down
Loading

0 comments on commit db0cebd

Please sign in to comment.