Last active
November 4, 2021 07:26
-
-
Save spham/d7a9bdbc956969dabcbe23217f7b4f49 to your computer and use it in GitHub Desktop.
Revisions
-
spham revised this gist
Nov 4, 2021 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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'); -
spham revised this gist
Nov 4, 2021 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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); ``` -
spham revised this gist
Nov 4, 2021 . 1 changed file with 17 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,22 +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); -
spham revised this gist
Nov 4, 2021 . 1 changed file with 22 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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); -
spham created this gist
Nov 3, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@