jfranc014

jfranc014

Quito

Member Since 4 Years Ago

Experience Points 16,265
Experience
Level
Lessons Completed 281
Lessons
Completed
Best Reply Awards 0
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

15 Jun
1 year ago

jfranc014 left a reply on Application Not Showing Images On New Laravel Installation

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

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

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.

24 Nov
2 years ago

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

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

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

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!

17 Nov
2 years ago

jfranc014 left a reply on Saving An Intervention Image Instance Into Amazon S3

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.

07 Nov
3 years ago

jfranc014 left a reply on Compiling Bourbon/Neat In Elixir

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.

11 Feb
3 years ago

jfranc014 left a reply on Move Uploaded File To S3

@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!

10 Feb
3 years ago

jfranc014 started a new conversation Move An Uploaded File To S3

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.

06 Feb
3 years ago

jfranc014 left a reply on L5 : TokenMismatchException With Ajax Post

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!