jfranc014

Experience

16,165

0 Best Reply Awards

  • Member Since 4 Years Ago
  • 280 Lessons Completed
  • 50 Favorites

15th June, 2017

jfranc014 left a reply on Application Not Showing Images On New Laravel Installation • 1 year ago

Well, the problem is solved now. I can not really explain what happened. Recreating the symlink worked for this installation.

jfranc014 left a reply on Application Not Showing Images On New Laravel Installation • 1 year ago

The images do exist (are published), and are uploaded by the user to /storage/app/public/photos The symlink looks like this (ls-la from the root of the app):

lrwxrwxrwx 1 emiliogal emiliogal 48 Jun 12 22:32 storage -> /home/emiliogal/apps/soco-new/storage/app/public

It means the symlink is stablished as mentioned here: https://laravel.com/docs/5.4/filesystem#configuration

To fetch the stored photos, the view has the following piece of code:

@if($product->has_photos)
    <div class="card-copy">
        <p>
            @foreach($product->photos as $photo)
                <img v-on:click="setMainSlideProduct('{{asset($photo->url)}}')"
                     src="{{asset($photo->url)}}" alt="producto-{{$photo->original_name}}">
            @endforeach
        </p>
    </div>
@endif 

The field url on the photo model, is an appended attribute, which access the file via the Storage Facade:

public $appends = ['name','url']
....
public function getUrlAttribute(){
    return Storage::url($this->path);
}

As i said, everything works in local and stage server, but breaks on the production one.

jfranc014 started a new conversation Application Not Showing Images On New Laravel Installation • 1 year ago

Hi, This page, of a new Laravel Site: http://soco.com.ec/productos/llantas The images are broken. However in our local and stages servers, everything is Ok. In fact the symlink to the storage path has been set successfully. The site is running on a Linux Centos.

Please your help to solve this problem.

24th November, 2015

jfranc014 started a new conversation NotReadableException When Trying To Upload Svg Files. Using Intervention Image For Image Modifications • 2 years ago

Hi,

I'm using the Intervention Image package to make some modifications to images (like resizing) after they've been uploaded. However for svg files this hasn't been possible, getting the following exception:

NotReadableException in Decoder.php line 21: Unable to read image from file (/tmp/phpapVWWg).

I can't really figure out what the problem is. The following is the code used for the transformation using Intervention:

class ImageResizer  implements FileTransformation {

    private $xSize;

    private $ySize;


    function __construct($xSize, $ySize)
    {

        $this->xSize = $xSize;
        $this->ySize = $ySize;
    }

    /**
     * @param TransformableFile $transformableFile
     * @return mixed image resized
     */
    function transform(TransformableFile $transformableFile)
    {  
        $resource = $transformableFile->file();
       
        $xSize = $this->xSize;
        $ySize = $this->ySize;
      
        $transformedImage = Image::make($resource->getRealPath())->resize($xSize,$ySize)->encode('png');

        $newTransformable =  new ImageTransformed($transformedImage);
        return $newTransformable;
     
    }
}

TransformableFile is actually the uploaded file. This class implements a FileTransformation interface which lets me choose at any time, which transformation to apply to an uploaded image. That's why it returns another UploadedFile. The problem i think is not in this implementation, but the way Intervention handles svg's. In fact the exception is thrown inside the 'make' call.

I really thank any advice or solution for this.

jfranc014 left a reply on Compiling Bourbon/Neat In Elixir • 2 years ago

Hi @aejnsn

Sure, I finally got it running using the neat components. It's really a great framework about which there should be more discussions at Laracasts.

Thanks!

jfranc014 started a new conversation Image Validation Mime And Length Rules Not Working Together • 2 years ago

I have a validation rules method in a Request class like this:

public function rules()
    {
        return [
            "photo"=>"mimes:jpeg,bmp,png | max:51200"
        ];
    }

When using both rules the mime and the max together. the validation does not work at all. However each one alone does its job. Please check this out. Is this some bug, or my own error at placing the rules? Thanks!

17th November, 2015

jfranc014 left a reply on Saving An Intervention Image Instance Into Amazon S3 • 2 years ago

Hi. Thanks for this answer @SergioGregorutti . I was having the same issue after upgrading to Laravel 5.1. I don't know if this was the exact reason for the problem, however thanks to this post it was solved.

7th November, 2015

jfranc014 left a reply on Compiling Bourbon/Neat In Elixir • 2 years ago

Hi, @aejnsn please, would you post your solution?. What i have done so far is the following:

  1. Install bourbon via npm npm install --save bourbon
  2. Import it in app.scss @import "node_modules/bourbon/app/assets/stylesheets"; This should work, however the compiled app.css file has nothing. I've tried using node-bourbon, but it does not work as well.

Thanks for your help.

11th February, 2015

jfranc014 left a reply on Move Uploaded File To S3 • 3 years ago

@deringer. Sure i was working with S3 in L5, though i didn't remember that i could work with a local (to get the contents of the uploaded file) an a cloud filesystem (S3, to put these contents) at the same time with the Illuminate\Contracts\Filesystem\Factory. However the approach by @lukaskorl solved directly the issue. Thanks for your answers!

10th February, 2015

jfranc014 started a new conversation Move An Uploaded File To S3 • 3 years ago

Hi, I'm trying to upload an image to a S3 bucket. In a controller, a method called uploadPhoto() gets the uploaded file and copies to a local directory: public function uploadPhoto(Filesystem $filesystem){ $uploadedFile = Input::file('photo'); Input::file('photo')->move("/tmp", "test-photo.jpg"); //...copy an image to S3 } How is the way to move the file in the temporary folder to the S3 bucket? Does Filesystem mange this stuff? Thanks for your answers.

6th February, 2015

jfranc014 left a reply on L5 : TokenMismatchException With Ajax Post • 3 years ago

Hi, I have two questions regarding this fact: The final release has already included the verification suggested by @vjacob, isn't it? If working with angular.js would the same approach apply to handle ajax requests? Thanks!

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.