Skip to content

Commit

Permalink
Add Laravel 10.x support (#30)
Browse files Browse the repository at this point in the history
* Add Laravel 10.x support

* Remove windows

* Lock Carbon

---------

Co-authored-by: Ralph J. Smit <[email protected]>
  • Loading branch information
tjardoo and ralphjsmit authored Feb 17, 2023
1 parent 777c649 commit 360b08a
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 64 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, windows-latest ]
php: [ 8.0 ]
laravel: [ 8.*, 9.* ]
os: [ ubuntu-latest ]
php: [ 8.1, 8.2 ]
laravel: [ 9.*, 10.* ]
stability: [ prefer-lowest, prefer-stable ]
include:
- laravel: 8.*
testbench: ^6.23
- laravel: 9.*
testbench: ^7.0
- laravel: 10.*
testbench: ^8.0

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand Down
24 changes: 9 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ It will render the SEO tags directly on your page:
<html>
<head>
{!! seo()->for($post) !!}
{{-- No need to separately render a <title> tag or any other meta tags! --}}
</head>
```
Expand All @@ -45,11 +45,11 @@ It even allows you to **dynamically retrieve SEO data from your model**, without
class Post extends Model
{
use HasSEO;

public function getDynamicSEOData(): SEOData
{
$pathToFeaturedImageRelativeToPublicPath = // ..;

// Override only the properties you want:
return new SEOData(
title: $this->title,
Expand All @@ -70,7 +70,7 @@ composer require ralphjsmit/laravel-seo

Publish the migration and configuration file:

```
```sh
php artisan vendor:publish --tag="seo-migrations"
php artisan vendor:publish --tag="seo-config"
```
Expand Down Expand Up @@ -211,7 +211,7 @@ use RalphJSmit\Laravel\SEO\Support\HasSEO;
class Post extends Model
{
use HasSEO;

// ...
```

Expand Down Expand Up @@ -381,7 +381,7 @@ SchemaCollection::initialize()->addBreadcrumbs(
});
}
);
```
```

This code will generate `BreadcrumbList` JSON-LD structured data with the following four pages:

Expand All @@ -403,7 +403,7 @@ use RalphJSmit\Laravel\SEO\Facades\SEOManager;
SEOManager::SEODataTransformer(function (SEOData $SEOData): SEOData {
// This will change the title on *EVERY* page. Do any logic you want here, e.g. based on the current request.
$SEOData->title = 'Transformed Title';

return $SEOData;
});
```
Expand All @@ -417,10 +417,10 @@ You can also **register closures that can modify the final collection of generat
```php
SEOManager::tagTransformer(function (TagCollection $tags): TagCollection {
$tags = $tags->reject(fn(Tag $tag) => $tag instanceof OpenGraphTag);

$tags->push(new MetaTag(name: 'custom-tag', content: 'My custom content'));
// Will render: <meta name="custom-tag" content="My custom content">

return $tags;
});
```
Expand All @@ -440,9 +440,3 @@ PRs are welcome, so feel free to fork and submit a pull request. I'll be happy t
🙌 If you want to contribute, please submit a pull request. All PRs will be fully credited. If you're unsure whether I'd accept your idea, feel free to contact me!

🙋‍♂️ [Ralph J. Smit](https://ralphjsmit.com)






89 changes: 45 additions & 44 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,70 @@
{
"name": "ralphjsmit/laravel-seo",
"description": "A package to handle the SEO in any Laravel application, big or small.",
"keywords": [
"name" : "ralphjsmit/laravel-seo",
"description" : "A package to handle the SEO in any Laravel application, big or small.",
"keywords" : [
"ralphjsmit",
"laravel",
"laravel-seo"
],
"homepage": "https://github.com/ralphjsmit/laravel-seo",
"license": "MIT",
"authors": [
"homepage" : "https://github.com/ralphjsmit/laravel-seo",
"license" : "MIT",
"authors" : [
{
"name": "Ralph J. Smit",
"email": "[email protected]",
"role": "Developer"
"name" : "Ralph J. Smit",
"email" : "[email protected]",
"role" : "Developer"
}
],
"require": {
"php": "^8.0",
"illuminate/contracts": "^8.79|^9.0",
"ralphjsmit/laravel-helpers": "^1.5",
"spatie/laravel-package-tools": "^1.9.2"
"require" : {
"php" : "^8.0",
"illuminate/contracts" : "^9.0|^10.0",
"ralphjsmit/laravel-helpers" : "^1.5",
"spatie/laravel-package-tools" : "^1.9.2"
},
"require-dev": {
"nunomaduro/collision": "^5.10|^6.0",
"orchestra/testbench": "^6.22|^7.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"phpunit/phpunit": "^9.5",
"spatie/laravel-ray": "^1.26",
"spatie/pest-plugin-test-time": "^1.0"
"require-dev" : {
"nesbot/carbon" : "^2.66",
"nunomaduro/collision" : "^5.10|^6.0",
"orchestra/testbench" : "^7.0|^8.0",
"pestphp/pest" : "^1.21",
"pestphp/pest-plugin-laravel" : "^1.1",
"phpunit/phpunit" : "^9.5",
"spatie/laravel-ray" : "^1.26",
"spatie/pest-plugin-test-time" : "^1.0"
},
"autoload": {
"psr-4": {
"RalphJSmit\\Laravel\\SEO\\": "src",
"RalphJSmit\\Laravel\\SEO\\Database\\Factories\\": "database/factories"
"autoload" : {
"psr-4" : {
"RalphJSmit\\Laravel\\SEO\\" : "src",
"RalphJSmit\\Laravel\\SEO\\Database\\Factories\\" : "database/factories"
},
"files": [
"files" : [
"src/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"RalphJSmit\\Laravel\\SEO\\Tests\\": "tests"
"autoload-dev" : {
"psr-4" : {
"RalphJSmit\\Laravel\\SEO\\Tests\\" : "tests"
}
},
"scripts": {
"test": "vendor/bin/pest",
"test-coverage": "vendor/bin/pest --coverage"
"scripts" : {
"test" : "vendor/bin/pest",
"test-coverage" : "vendor/bin/pest --coverage"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
"config" : {
"sort-packages" : true,
"allow-plugins" : {
"pestphp/pest-plugin" : true
}
},
"extra": {
"laravel": {
"providers": [
"extra" : {
"laravel" : {
"providers" : [
"RalphJSmit\\Laravel\\SEO\\LaravelSEOServiceProvider"
],
"aliases": {
"SEOManager": "RalphJSmit\\Laravel\\SEO\\Facades\\SEOManager"
"aliases" : {
"SEOManager" : "RalphJSmit\\Laravel\\SEO\\Facades\\SEOManager"
}
}
},
"minimum-stability": "dev",
"prefer-stable": true
"minimum-stability" : "dev",
"prefer-stable" : true
}

0 comments on commit 360b08a

Please sign in to comment.