Skip to content

Instantly share code, notes, and snippets.

@spham
Last active November 4, 2021 07:26
Show Gist options
  • Select an option

  • Save spham/d7a9bdbc956969dabcbe23217f7b4f49 to your computer and use it in GitHub Desktop.

Select an option

Save spham/d7a9bdbc956969dabcbe23217f7b4f49 to your computer and use it in GitHub Desktop.

Revisions

  1. spham revised this gist Nov 4, 2021. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion missing_storage_dir.md
    Original file line number Diff line number Diff line change
    @@ -21,4 +21,8 @@ Storage::makeDirectory('public/photos_thumb');
    $manager = new ImageManager();
    $image = $manager->make('storage/photos/' . $imageHashName)->resize(300, 200);
    $image->save('storage/photos_thumb/' . $imageHashName);
    ```
    ```

    a retenir :

    Storage::makeDirectory('public/photos_thumb');
  2. spham revised this gist Nov 4, 2021. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion missing_storage_dir.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    ```php
    if (!empty($this->featuredImage)) {
    $imageHashName = $this->featuredImage->hashName();

    @@ -19,4 +20,5 @@ Storage::makeDirectory('public/photos_thumb');
    // Create a thumbnail of the image using Intervention Image Library
    $manager = new ImageManager();
    $image = $manager->make('storage/photos/' . $imageHashName)->resize(300, 200);
    $image->save('storage/photos_thumb/' . $imageHashName);
    $image->save('storage/photos_thumb/' . $imageHashName);
    ```
  3. spham revised this gist Nov 4, 2021. 1 changed file with 17 additions and 17 deletions.
    34 changes: 17 additions & 17 deletions missing_storage_dir.md
    Original file line number Diff line number Diff line change
    @@ -1,22 +1,22 @@
    if (!empty($this->featuredImage)) {
    $imageHashName = $this->featuredImage->hashName();
    if (!empty($this->featuredImage)) {
    $imageHashName = $this->featuredImage->hashName();

    // Append to the validation if image is not empty
    $validateData = array_merge($validateData, [
    'featuredImage' => 'image'
    ]);
    // Append to the validation if image is not empty
    $validateData = array_merge($validateData, [
    'featuredImage' => 'image'
    ]);

    // This is to save the filename of the image in the database
    $data = array_merge($data, [
    'featured_image' => $imageHashName
    ]);
    // This is to save the filename of the image in the database
    $data = array_merge($data, [
    'featured_image' => $imageHashName
    ]);

    // Upload the main image
    $this->featuredImage->store('public/photos');
    Storage::makeDirectory('public/photos_thumb');
    // Upload the main image
    $this->featuredImage->store('public/photos');
    Storage::makeDirectory('public/photos_thumb');


    // Create a thumbnail of the image using Intervention Image Library
    $manager = new ImageManager();
    $image = $manager->make('storage/photos/' . $imageHashName)->resize(300, 200);
    $image->save('storage/photos_thumb/' . $imageHashName);
    // Create a thumbnail of the image using Intervention Image Library
    $manager = new ImageManager();
    $image = $manager->make('storage/photos/' . $imageHashName)->resize(300, 200);
    $image->save('storage/photos_thumb/' . $imageHashName);
  4. spham revised this gist Nov 4, 2021. 1 changed file with 22 additions and 0 deletions.
    22 changes: 22 additions & 0 deletions missing_storage_dir.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    if (!empty($this->featuredImage)) {
    $imageHashName = $this->featuredImage->hashName();

    // Append to the validation if image is not empty
    $validateData = array_merge($validateData, [
    'featuredImage' => 'image'
    ]);

    // This is to save the filename of the image in the database
    $data = array_merge($data, [
    'featured_image' => $imageHashName
    ]);

    // Upload the main image
    $this->featuredImage->store('public/photos');
    Storage::makeDirectory('public/photos_thumb');


    // Create a thumbnail of the image using Intervention Image Library
    $manager = new ImageManager();
    $image = $manager->make('storage/photos/' . $imageHashName)->resize(300, 200);
    $image->save('storage/photos_thumb/' . $imageHashName);
  5. spham created this gist Nov 3, 2021.
    1 change: 1 addition & 0 deletions un.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ‎‎​