Skip to content

Commit 8fcc00b

Browse files
committed
feat: build package
1 parent f0fa6ff commit 8fcc00b

15 files changed

+706
-124
lines changed

composer.json

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"name": "jorisnoo/statamic-imageboss",
3-
"description": "This is my package statamic-imageboss",
3+
"description": "ImageBoss integration for Statamic with Glide fallback",
44
"keywords": [
5-
"Joris Noordermeer",
6-
"laravel",
7-
"statamic-imageboss"
5+
"statamic",
6+
"imageboss",
7+
"images",
8+
"responsive",
9+
"srcset",
10+
"glide"
811
],
912
"homepage": "https://github.com/jorisnoo/statamic-imageboss",
1013
"license": "MIT",
@@ -16,9 +19,10 @@
1619
}
1720
],
1821
"require": {
19-
"php": "^8.4",
22+
"php": "^8.2",
2023
"spatie/laravel-package-tools": "^1.16",
21-
"illuminate/contracts": "^11.0||^12.0"
24+
"illuminate/contracts": "^11.0||^12.0",
25+
"statamic/cms": "^5.0||^6.0"
2226
},
2327
"require-dev": {
2428
"laravel/pint": "^1.14",
@@ -31,8 +35,7 @@
3135
},
3236
"autoload": {
3337
"psr-4": {
34-
"Noo\\StatamicImageboss\\": "src/",
35-
"Noo\\StatamicImageboss\\Database\\Factories\\": "database/factories/"
38+
"Noo\\StatamicImageboss\\": "src/"
3639
}
3740
},
3841
"autoload-dev": {
@@ -53,19 +56,24 @@
5356
"sort-packages": true,
5457
"allow-plugins": {
5558
"pestphp/pest-plugin": true,
56-
"phpstan/extension-installer": true
59+
"phpstan/extension-installer": true,
60+
"pixelfear/composer-dist-plugin": true
5761
}
5862
},
5963
"extra": {
64+
"statamic": {
65+
"name": "ImageBoss",
66+
"description": "ImageBoss integration with Glide fallback"
67+
},
6068
"laravel": {
6169
"providers": [
6270
"Noo\\StatamicImageboss\\StatamicImagebossServiceProvider"
6371
],
6472
"aliases": {
65-
"StatamicImageboss": "Noo\\StatamicImageboss\\Facades\\StatamicImageboss"
73+
"ImageBoss": "Noo\\StatamicImageboss\\Facades\\ImageBoss"
6674
}
6775
}
6876
},
6977
"minimum-stability": "dev",
7078
"prefer-stable": true
71-
}
79+
}

config/statamic-imageboss.php

Lines changed: 94 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,99 @@
11
<?php
22

3-
// config for Noo/StatamicImageboss
43
return [
4+
/*
5+
|--------------------------------------------------------------------------
6+
| ImageBoss Source
7+
|--------------------------------------------------------------------------
8+
|
9+
| Your ImageBoss source identifier. When this is not set, the package
10+
| will automatically fall back to using Statamic's built-in Glide
11+
| for image transformations.
12+
|
13+
*/
514

15+
'source' => env('IMAGEBOSS_SOURCE'),
16+
17+
/*
18+
|--------------------------------------------------------------------------
19+
| ImageBoss Secret
20+
|--------------------------------------------------------------------------
21+
|
22+
| Optional HMAC secret for signing ImageBoss URLs. When set, all URLs
23+
| will be signed using SHA-256 to prevent URL tampering.
24+
|
25+
*/
26+
27+
'secret' => env('IMAGEBOSS_SECRET'),
28+
29+
/*
30+
|--------------------------------------------------------------------------
31+
| ImageBoss Base URL
32+
|--------------------------------------------------------------------------
33+
|
34+
| The base URL for ImageBoss CDN. You typically don't need to change this.
35+
|
36+
*/
37+
38+
'base_url' => 'https://img.imageboss.me',
39+
40+
/*
41+
|--------------------------------------------------------------------------
42+
| Default Width
43+
|--------------------------------------------------------------------------
44+
|
45+
| The default width to use when url() is called without an explicit width.
46+
|
47+
*/
48+
49+
'default_width' => 1000,
50+
51+
/*
52+
|--------------------------------------------------------------------------
53+
| Width Interval
54+
|--------------------------------------------------------------------------
55+
|
56+
| The default step size when generating srcset width variants.
57+
|
58+
*/
59+
60+
'width_interval' => 200,
61+
62+
/*
63+
|--------------------------------------------------------------------------
64+
| Presets
65+
|--------------------------------------------------------------------------
66+
|
67+
| Define named presets for common image configurations. Each preset can
68+
| specify min/max widths, aspect ratio, and interval.
69+
|
70+
| Available options per preset:
71+
| - min: Minimum width for srcset (required)
72+
| - max: Maximum width for srcset (required)
73+
| - ratio: Aspect ratio as width/height (optional)
74+
| - interval: Width step size, overrides default (optional)
75+
|
76+
*/
77+
78+
'presets' => [
79+
'default' => [
80+
'min' => 320,
81+
'max' => 2560,
82+
],
83+
'thumbnail' => [
84+
'min' => 200,
85+
'max' => 700,
86+
'ratio' => 1,
87+
'interval' => 250,
88+
],
89+
'card' => [
90+
'min' => 300,
91+
'max' => 800,
92+
'ratio' => 4 / 5,
93+
],
94+
'hero' => [
95+
'min' => 640,
96+
'max' => 3840,
97+
],
98+
],
699
];

database/factories/ModelFactory.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

database/migrations/create_statamic_imageboss_table.php.stub

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/Commands/StatamicImagebossCommand.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/Facades/ImageBoss.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace Noo\StatamicImageboss\Facades;
4+
5+
use Illuminate\Support\Facades\Facade;
6+
use Noo\StatamicImageboss\ImageBossBuilder;
7+
use Statamic\Assets\Asset;
8+
9+
/**
10+
* @method static ImageBossBuilder from(Asset $asset)
11+
*
12+
* @see \Noo\StatamicImageboss\ImageBoss
13+
*/
14+
class ImageBoss extends Facade
15+
{
16+
protected static function getFacadeAccessor(): string
17+
{
18+
return \Noo\StatamicImageboss\ImageBoss::class;
19+
}
20+
}

src/Facades/StatamicImageboss.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/ImageBoss.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace Noo\StatamicImageboss;
4+
5+
use Statamic\Assets\Asset;
6+
7+
class ImageBoss
8+
{
9+
public function from(Asset $asset): ImageBossBuilder
10+
{
11+
return new ImageBossBuilder($asset);
12+
}
13+
}

0 commit comments

Comments
 (0)