Skip to content

Commit 7dc18db

Browse files
committed
Merge branch 'main' of https://github.com/vormkracht10/laravel-static into develop
2 parents c4c059b + 9b8205d commit 7dc18db

26 files changed

+477
-309
lines changed

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: backstagephp

.github/ISSUE_TEMPLATE/config.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
4-
url: https://github.com/vormkracht10/laravel-static/discussions/new?category=q-a
4+
url: https://github.com/backstagephp/laravel-static/discussions/new?category=q-a
55
about: Ask the community for help
66
- name: Request a feature
7-
url: https://github.com/vormkracht10/laravel-static/discussions/new?category=ideas
7+
url: https://github.com/backstagephp/laravel-static/discussions/new?category=ideas
88
about: Share ideas for new features
99
- name: Report a security issue
10-
url: https://github.com/vormkracht10/laravel-static/security/policy
10+
url: https://github.com/backstagephp/laravel-static/security/policy
1111
about: Learn how to notify us for sensitive bugs
1212
- name: Report a bug
13-
url: https://github.com/vormkracht10/laravel-static/issues/new
13+
url: https://github.com/backstagephp/laravel-static/issues/new
1414
about: Report a reproducible bug

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.idea
22
.phpunit.result.cache
3+
.DS_Store
34
build
45
composer.lock
56
coverage

.phpactor.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "/phpactor.schema.json",
3+
"language_server_phpstan.enabled": false
4+
}

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) vormkracht10 <mark@vormkracht10.nl>
3+
Copyright (c) Backstage <mark@backstagephp.com>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
# Build a static with Laravel on the backend
1+
# Build a static website with Laravel on the backend
22

3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/vormkracht10/laravel-static.svg?style=flat-square)](https://packagist.org/packages/vormkracht10/laravel-static)
4-
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/vormkracht10/laravel-static/run-tests?label=tests)](https://github.com/vormkracht10/laravel-static/actions?query=workflow%3Arun-tests+branch%3Amain)
5-
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/vormkracht10/laravel-static/Fix%20PHP%20code%20style%20issues?label=code%20style)](https://github.com/vormkracht10/laravel-static/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
6-
[![Total Downloads](https://img.shields.io/packagist/dt/vormkracht10/laravel-static.svg?style=flat-square)](https://packagist.org/packages/vormkracht10/laravel-static)
3+
[![Total Downloads](https://img.shields.io/packagist/dt/backstage/laravel-static.svg?style=flat-square)](https://packagist.org/packages/backstage/laravel-static)
4+
[![Tests](https://github.com/backstagephp/laravel-static/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/backstagephp/laravel-static/actions/workflows/run-tests.yml)
5+
[![PHPStan](https://github.com/backstagephp/laravel-static/actions/workflows/phpstan.yml/badge.svg?branch=main)](https://github.com/backstagephp/laravel-static/actions/workflows/phpstan.yml)
6+
![GitHub release (latest by date)](https://img.shields.io/github/v/release/backstagephp/laravel-static)
7+
![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/backstage/laravel-static)
8+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/backstage/laravel-static.svg?style=flat-square)](https://packagist.org/packages/backstage/laravel-static)
79

810
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
911

@@ -12,7 +14,7 @@ This is where your description should go. Limit it to a paragraph or two. Consid
1214
You can install the package via composer:
1315

1416
```bash
15-
composer require vormkracht10/laravel-static
17+
composer require backstage/laravel-static
1618
```
1719

1820
You can publish and run the migrations with:
@@ -44,8 +46,7 @@ php artisan vendor:publish --tag="laravel-static-views"
4446
## Usage
4547

4648
```php
47-
$laravelStatic = new Vormkracht10\LaravelStatic();
48-
echo $laravelStatic->echoPhrase('Hello, Vormkracht10!');
49+
4950
```
5051

5152
## Testing
@@ -68,7 +69,7 @@ Please review [our security policy](../../security/policy) on how to report secu
6869

6970
## Credits
7071

71-
- [Mark van Eijk](https://github.com/vormkracht10)
72+
- [Mark van Eijk](https://github.com/backstagephp)
7273
- [All Contributors](../../contributors)
7374

7475
## License

composer.json

+17-19
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "vormkracht10/laravel-static",
2+
"name": "backstage/laravel-static",
33
"description": "Serving your Laravel app with speed using static caching",
44
"keywords": [
55
"vormkracht10",
66
"laravel",
77
"laravel-static"
88
],
9-
"homepage": "https://github.com/vormkracht10/laravel-static",
9+
"homepage": "https://github.com/backstagephp/laravel-static",
1010
"license": "MIT",
1111
"authors": [
1212
{
@@ -17,32 +17,30 @@
1717
],
1818
"require": {
1919
"php": "^8.1",
20-
"illuminate/contracts": "^9.0",
21-
"spatie/crawler": "^7.1",
22-
"spatie/laravel-package-tools": "^1.13.0",
20+
"illuminate/contracts": "^11.0 || ^12.0",
21+
"laravel/helpers": "^1.6",
22+
"spatie/crawler": "^8.0",
23+
"spatie/laravel-package-tools": "^1.15.0",
2324
"voku/html-min": "^4.5"
2425
},
2526
"require-dev": {
2627
"laravel/pint": "^1.0",
27-
"nunomaduro/collision": "^6.0",
28-
"nunomaduro/larastan": "^2.0.1",
29-
"orchestra/testbench": "^7.0",
30-
"pestphp/pest": "^1.21",
31-
"pestphp/pest-plugin-laravel": "^1.1",
32-
"phpstan/extension-installer": "^1.1",
33-
"phpstan/phpstan-deprecation-rules": "^1.0",
34-
"phpstan/phpstan-phpunit": "^1.0",
35-
"phpunit/phpunit": "^9.5"
28+
"nunomaduro/collision": "^8.5",
29+
"larastan/larastan": "^2.0.1",
30+
"orchestra/testbench": "^9.0",
31+
"pestphp/pest": "^3.5",
32+
"pestphp/pest-plugin-laravel": "^3.0",
33+
"phpstan/extension-installer": "^1.4",
34+
"phpstan/phpstan-deprecation-rules": "^1.0"
3635
},
3736
"autoload": {
3837
"psr-4": {
39-
"Vormkracht10\\LaravelStatic\\": "src",
40-
"Vormkracht10\\LaravelStatic\\Database\\Factories\\": "database/factories"
38+
"Backstage\\Laravel\\Static\\": "src"
4139
}
4240
},
4341
"autoload-dev": {
4442
"psr-4": {
45-
"Vormkracht10\\LaravelStatic\\Tests\\": "tests"
43+
"Backstage\\Laravel\\Static\\Tests\\": "tests"
4644
}
4745
},
4846
"scripts": {
@@ -61,10 +59,10 @@
6159
"extra": {
6260
"laravel": {
6361
"providers": [
64-
"Vormkracht10\\LaravelStatic\\LaravelStaticServiceProvider"
62+
"Backstage\\Laravel\\Static\\StaticServiceProvider"
6563
],
6664
"aliases": {
67-
"LaravelStatic": "Vormkracht10\\LaravelStatic\\Facades\\LaravelStatic"
65+
"Static": "Backstage\\Laravel\\Static\\Facades\\StaticCache"
6866
}
6967
}
7068
},

config/static.php

+65-31
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,53 @@
11
<?php
22

3+
use Spatie\Crawler\CrawlProfiles\CrawlInternalUrls;
4+
use Backstage\Laravel\Static\Crawler\StaticCrawlObserver;
5+
36
return [
47
/**
5-
* Path within storage disk to save files in.
8+
* The driver that will be used to cache your pages.
9+
* This can be either 'crawler' or 'routes'.
610
*/
7-
'path' => storage_path('public/static'),
11+
'driver' => 'crawler',
812

913
/**
10-
* Configure a fallback cache driver.
14+
* Enable or disable static caching (to quickly disable the creation of the static cache without detaching the middleware).
15+
* Don't forget to clear the static cache if needed, this does does not happen using this setting.
1116
*/
12-
'fallback_cache' => 'memcached',
17+
'enabled' => env('STATIC_ENABLED', true),
1318

1419
'build' => [
1520
/**
1621
* Clear static files before building static cache.
1722
* When disabled, the cache is warmed up rather by updating and overwriting files instead of starting without an existing cache.
1823
*/
19-
'clear_before_start' => false,
24+
'clear_before_start' => true,
2025

2126
/**
22-
* Concurrency for crawling to warm up static cache.
27+
* Number of concurrent http requests to build static cache.
2328
*/
2429
'concurrency' => 5,
2530

31+
/**
32+
* Whether to follow links on pages.
33+
*/
34+
'accept_no_follow' => true,
35+
36+
/**
37+
* The default scheme the crawler will use.
38+
*/
39+
'default_scheme' => 'https',
40+
41+
/**
42+
* The crawl observer that will be used to handle crawl related events.
43+
*/
44+
'crawl_observer' => StaticCrawlObserver::class,
45+
46+
/**
47+
* The crawl profile that will be used by the crawler.
48+
*/
49+
'crawl_profile' => CrawlInternalUrls::class,
50+
2651
/**
2752
* HTTP header that can be used to bypass the cache. Useful for updating the cache without needing to clear it first,
2853
* or to monitor the performance of your application.
@@ -32,34 +57,43 @@
3257
],
3358
],
3459

35-
/**
36-
* Different caches per domain.
37-
*/
38-
'include_domain' => true,
60+
'files' => [
61+
/**
62+
* The filesystem disk that will be used to cache your pages.
63+
*/
64+
'disk' => env('STATIC_DISK', 'public'),
3965

40-
/**
41-
* When query string is included, every unique query string combination creates a new static file.
42-
* When disabled, the URL is marked as identical regardless of the query string.
43-
*/
44-
'include_query_string' => true,
66+
/**
67+
* Different caches per domain.
68+
*/
69+
'include_domain' => true,
4570

46-
/**
47-
* Define if you want to save the static cache after response has been sent to browser.
48-
*/
49-
'on_termination' => false,
71+
/**
72+
* When query string is included, every unique query string combination creates a new static file.
73+
* When disabled, the URL is marked as identical regardless of the query string.
74+
*/
75+
'include_query_string' => true,
5076

51-
/**
52-
* Minify HTML before saving static file.
53-
*/
54-
'minify_html' => true,
77+
/**
78+
* Set file path maximum length (determined by operating system config)
79+
*/
80+
'filepath_max_length' => 4096,
5581

56-
/**
57-
* Set file path maximum length (determined by operating system config)
58-
*/
59-
'filepath_max_length' => 4096,
82+
/**
83+
* Set filename maximum length (determined by operating system config)
84+
*/
85+
'filename_max_length' => 255,
86+
],
6087

61-
/**
62-
* Set filename maximum length (determined by operating system config)
63-
*/
64-
'filename_max_length' => 255,
88+
'options' => [
89+
/**
90+
* Define if you want to save the static cache after response has been sent to browser.
91+
*/
92+
'on_termination' => false,
93+
94+
/**
95+
* Minify HTML before saving static file.
96+
*/
97+
'minify_html' => false,
98+
],
6599
];

database/factories/ModelFactory.php

-19
This file was deleted.

database/migrations/create_static_table.php.stub

-19
This file was deleted.

phpstan.neon.dist

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ parameters:
66
paths:
77
- src
88
- config
9-
- database
109
tmpDir: build/phpstan
1110
checkOctaneCompatibility: true
1211
checkModelProperties: true

phpunit.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
verbose="true"
2020
>
2121
<testsuites>
22-
<testsuite name="Vormkracht10 Test Suite">
22+
<testsuite name="Backstage Test Suite">
2323
<directory>tests</directory>
2424
</testsuite>
2525
</testsuites>

0 commit comments

Comments
 (0)