Skip to content

Commit cce824e

Browse files
committed
Update references to 'bucket' in config docs.
In the docs, 'bucket' should be 'Bucket' inside the s3 config.
1 parent f297913 commit cce824e

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Description:
6363
* **region**: The region name of your bucket (e.g. 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1'). Determines the base url where your objects are stored at (e.g a region of us-west-2 has a base url of s3-us-west-2.amazonaws.com). The default value for this field is an empty (US Standard *). You can go [here](http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) for a more complete list/explanation of regions.
6464
* **scheme**: The protocol for the URLs generated to your S3 assets. Can be either 'http' or 'https'. Defaults to 'http' when your ACL is 'public-read' (the default) and 'https' when your ACL is anything else.
6565
* **s3_object_config**
66-
* **bucket**: The bucket where you wish to store your objects. Every object in Amazon S3 is stored in a bucket. If the specified bucket doesn't exist Stapler will attempt to create it. The bucket name will not be interpolated.
66+
* **Bucket**: The bucket where you wish to store your objects. Every object in Amazon S3 is stored in a bucket. If the specified bucket doesn't exist Stapler will attempt to create it. The bucket name will not be interpolated.
6767
* **ACL**: This is a string/array that should be one of the canned access policies that S3 provides (private, public-read, public-read-write, authenticated-read, bucket-owner-read, bucket-owner-full-control). The default for Stapler is public-read. An associative array (style => permission) may be passed to specify permissions on a per style basis.
6868
* **path**: This is the key under the bucket in which the file will be stored. The URL will be constructed from the bucket and the path. This is what you will want to interpolate. Keys should be unique, like filenames, and despite the fact that S3 (strictly speaking) does not support directories, you can still use a / to separate parts of your file name.
6969

docs/examples.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ Class Photo extends Eloquent implements StaplerableInterface
1717
{
1818
// We'll need to use the Stapler Eloquent trait in our model (see setup for more info).
1919
use EloquentTrait;
20-
20+
2121
/**
22-
* We can add our attachments to the fillable array so that they're
22+
* We can add our attachments to the fillable array so that they're
2323
* mass assignable on the model.
2424
*
2525
* @var array
2626
*/
2727
protected $fillable = ['foo', 'bar', 'baz', 'qux', 'quux'];
28-
28+
2929
/**
3030
* Inside our model's constructor, we'll define some stapler attachments:
3131
*
3232
* @param attributes
3333
*/
34-
public function __construct(array $attributes = array())
34+
public function __construct(array $attributes = array())
3535
{
36-
// Define an attachment named 'foo', with both thumbnail (100x100) and large (300x300) styles,
36+
// Define an attachment named 'foo', with both thumbnail (100x100) and large (300x300) styles,
3737
// using custom url and default_url configurations:
3838
$this->hasAttachedFile('foo', [
3939
'styles' => [
@@ -43,9 +43,9 @@ Class Photo extends Eloquent implements StaplerableInterface
4343
'url' => '/system/:attachment/:id_partition/:style/:filename',
4444
'default_url' => '/:attachment/:style/missing.jpg'
4545
]);
46-
47-
// Define an attachment named 'bar', with both thumbnail (100x100) and large (300x300) styles,
48-
// using custom url and default_url configurations, with the keep_old_files flag set to true
46+
47+
// Define an attachment named 'bar', with both thumbnail (100x100) and large (300x300) styles,
48+
// using custom url and default_url configurations, with the keep_old_files flag set to true
4949
// (so that older file uploads aren't deleted from the file system) and image cropping turned on:
5050
$this->hasAttachedFile('bar', [
5151
'styles' => [
@@ -55,7 +55,7 @@ Class Photo extends Eloquent implements StaplerableInterface
5555
'url' => '/system/:attachment/:id_partition/:style/:filename',
5656
'keep_old_files' => true
5757
]);
58-
58+
5959
// Define an attachment named 'baz' that has a watermarked style. Here, we define a style named 'watermarked'
6060
// that's a closure (so that we can do some complex watermarking stuff):
6161
$this->hasAttachedFile('baz', [
@@ -80,9 +80,9 @@ Class Photo extends Eloquent implements StaplerableInterface
8080
],
8181
'url' => '/system/:attachment/:id_partition/:style/:filename'
8282
]);
83-
83+
8484
// Define an attachment named 'qux'. In this attachment, we'll use alternative style notation to define a slightly more
85-
// complex thumbnail style. In this example, the thumbnail style will be a 100x100px auto-oriented image with 100% quality:
85+
// complex thumbnail style. In this example, the thumbnail style will be a 100x100px auto-oriented image with 100% quality:
8686
$this->hasAttachedFile('qux', [
8787
'styles' => [
8888
'thumbnail' => ['dimensions' => '100x100', 'auto-orient' => true, 'convert_options' => ['quality' => 100]],
@@ -91,7 +91,7 @@ Class Photo extends Eloquent implements StaplerableInterface
9191
'url' => '/system/:attachment/:id_partition/:style/:filename',
9292
'default_url' => '/defaults/:style/missing.png'
9393
]);
94-
94+
9595
// Define an attachment named 'quux' that stores images remotely in an S3 bucket.
9696
$this->hasAttachedFile('quux', [
9797
'styles' => [
@@ -105,7 +105,7 @@ Class Photo extends Eloquent implements StaplerableInterface
105105
'region' => 'yourBucketRegion'
106106
],
107107
's3_object_config' => [
108-
'bucket' => 'your.s3.bucket'
108+
'Bucket' => 'your.s3.bucket'
109109
],
110110
'default_url' => '/defaults/:style/missing.png',
111111
'keep_old_files' => true
@@ -135,7 +135,7 @@ $photo->foo = $_FILES['foo'];
135135
$photo->save();
136136

137137
// Regardless of what framework we're using, we can always assign a remote url as an attachment value.
138-
// This is very useful when working with third party API's such as facebook, twitter, etc.
138+
// This is very useful when working with third party API's such as facebook, twitter, etc.
139139
// Note that this feature requires that the CURL extension is included as part of your PHP installation.
140140
$photo->foo = "http://foo.com/bar.jpg";
141141
$photo->save();
@@ -184,7 +184,7 @@ $photo->foo = STAPLER_NULL;
184184
$photo->save();
185185
```
186186

187-
The destroy method is similar, however it doesn't clear out the attachment attributes on the model and doesn't require us to save the record in order to remove uploaded files. It's also filterable; we can pass in array of the syles we want to clear:
187+
The destroy method is similar, however it doesn't clear out the attachment attributes on the model and doesn't require us to save the record in order to remove uploaded files. It's also filterable; we can pass in array of the syles we want to clear:
188188
```php
189189
// Remove all of the attachments's uploaded files (across all styles) from storage.
190190
$photo->foo->destroy();

0 commit comments

Comments
 (0)