malesandro

malesandro

Member Since 5 Years Ago

Experience Points 2,755
Experience Level 1

2,245 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 13
Lessons
Completed
Best Reply Awards 2
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    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 Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

23 May
3 months ago

malesandro left a reply on Using WhereIn And Comma Separated Values

@snapey Thank you so much! This is exactly what I was looking for. I had tried using like, but in a wrong way, your solution is perfect. And yes, I'll use regex afterwords to fine tune the result. Thanks again :)

malesandro left a reply on Using WhereIn And Comma Separated Values

Thanks so much for all the answers, I really appreciate your points of view.

What happens is that I am using Laravel Voyager as an admin, and the meta_keywords column within the POST table handles it like this, which I agree it isn't the best approach.

However time is pressing, so I am trying to find a workaround to this constrain.

If anyone can come up with another idea, I'm all ears. I will try removing white spaces and see if it helps. Thanks!

22 May
3 months ago

malesandro started a new conversation Using WhereIn And Comma Separated Values

Hi everyone. I am building a related posts block. In the posts table, I have a column called meta_keywords, which holds a string with comma separated values:

meta_keywords = "earth, wind, fire"

I want to get related posts, based on the meta_keywords column.

My way of going at this is as follows:

//get the meta_keywords from a single post
$meta_keywords = explode(',',$post->meta_keywords);
//get posts that match the criteria plus have some of the meta_keywords
$relatedPosts = Post::where('category_id','=',$post->category_id)
                            ->where('status','=','PUBLISHED')
                            ->where('id','!=',$post->id)
                            ->whereIn('meta_keywords',$meta_keywords)
                            ->inRandomOrder()
                            ->take(3)->get();

Other posts in the same category, have the following meta_keywords:

"wood, stone, earth"
"water, fire, earth"
"water, wood, grass"

However I am not getting any results for this query. Can anyone please help me? Thanks!

15 Jun
3 years ago

malesandro started a new conversation Failed To Authenticate On SMTP

Hi everyone, I have an application that sends emails when someone registers. This was working perfect until yesterday, when it began throwing errors. I am using Laravel 4.2 .

Mail.app is configured with:

SMTP

Host from Office365 (smtp.office365.com).

Port 587

Using TLS

User and Password are correct (if I log into the Office365 webportal I can send and receive)

MX records are correct.

Microsoft says they haven't modified the service.

When trying to send the email, I get the following error: "Failed to authenticate on SMTP server with username "email_goes_here" using 1 possible authenticators"

Any idea what can be causing this?

21 Jan
3 years ago

malesandro left a reply on Homestead Port Number In Url

@AwokeN where you able to solve this? I am having the exact same problem. Cheers!

29 Jul
4 years ago

malesandro left a reply on Windows 10 + Vagrant + Virtualbox + Homestead

Hey people, Today I upgraded to W10, and had this problem. @Eldair 's solution worked, though it now takes FOREVER to boot homestead.

In the process, I also had a problem after upgrading to Vagrant 1.7.4. My box was/is called "default", so when I tried running vagrant up, I received an error saying that the box "base" couldn't be find. After trying for some time to fix that without luck, I came up with a handy solution for the time being. I first run a vagrant global-status, get the ID of the box I want to start, and then I do "vagrant up id_of_the_box".

Hope this helps someone. Cheers

23 Feb
4 years ago

malesandro left a reply on Route Stopped Working

@bashy, a "jury" directory was copied to the public level by mistake. Now that you mentioned it, I looked for it and there it was. After removing the directory, everything went back to normal.

I kept on checking the code, looking for an error somewhere, checking ports, etc, and it hadn't remotely crossed my mind to check your solution. Thanks again, and also thanks to those of you that tried to help :)

malesandro left a reply on Route Stopped Working

@bashy Good idea there :) I get a Failed to connect error. Connection refused. This is the only route that is failing (it began happening all of a sudden).

@JoeDawson the method just returns a view with static data.

malesandro started a new conversation Route Stopped Working

Hello everyone, I have a weird problem. One of my routes stopped working in my Homestead env, without any changes done. The route serves a page, and that's it.

The route is:

Route::get('jury', array(
    'as' => 'jury', 
    'uses' => 'PageController@jury'
));

Instead of going to website.app:8000/jury, I get sent to website.app/jury, and of course it doesn't get served.

Any ideas? Thanks a lot in advance.

21 Aug
5 years ago

malesandro left a reply on Problem With Vagrant And Images

I got this to work, with user help from stackoverflow. You can check the answer here: http://stackoverflow.com/questions/25408070/homestead-vagrant-refusing-image-manipulation/25415504#25415504

Basically instead of using URL::asset, I needed to use public_path().

19 Aug
5 years ago

malesandro left a reply on Problem With Vagrant And Images

I have checked in /app/storage/logs, and the error I'm getting is:

 'getimagesize(http://nominate.app:8000/temp/2078ec37e959dd733930ad758854ce4cb5f175de.jpg): failed to open stream: Connection refused'

I am trying to find an online solution, without luck, since it works in a centos environment, but not in my vagrant/homestead one. Any ideas?

malesandro left a reply on Problem With Vagrant And Images

@henrique yeap, that is the problem. The server is returning a 500 error, so it is breaking while trying to crop. Since this only happens while testing with homestead/vagrant, I believe it is something related to file permissions or similar, but I cannot really pinpoint the cause. I posted here hoping that someone had a similar error while dealing with image manipulation in this setup... Thanks, Mariano

18 Aug
5 years ago

malesandro started a new conversation Problem With Vagrant And Images

Hello everybody! I am running into a problem with Homestead. I have a piece of code that works well on an online dev server, but fails in the vagrant Homestead one.

The piece of code is an ajax executed one, where I upload an image, save it in a temp directory and send it back to the user, who then crops it. For this, I have two functions, tempUpload and tempCrop. It is failing in tempCrop, and most the line that triggers it is the following:

$img = getimagesize($imgUrl);

$imgUrl is an input with the url to an image in a temp folder. Checking in vagrant, I saw that these images have attributes -rwxrwxrwx 1 vagrant vagrant. The error appearing in the console is "SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data".

Again, this works perfect in an online version, so I guess it is either a permission problem or some environment setting. The permissions for the temp folder in vagrant are as following: drwxrwxrwx 1 vagrant vagrant

This is the expanded code:

$imgUrl = $input['imgUrl'];
$imgInitW = $input['imgInitW'];
$imgInitH = $input['imgInitH'];
$imgW = $input['imgW'];
$imgH = $input['imgH'];
$imgY1 = $input['imgY1'];
$imgX1 = $input['imgX1'];
$cropW = $input['cropW'];
$cropH = $input['cropH'];

$jpeg_quality = 100;


$directory = 'temp/';
$filename = sha1(time().time());


$output_filename = $directory.$filename."_cropped";

$img  = getimagesize($imgUrl);

switch(strtolower($img['mime']))
{
    case 'image/png':
        $img_r = imagecreatefrompng($imgUrl);
        $source_image = imagecreatefrompng($imgUrl);
        $type = '.png';
        break;
    case 'image/jpeg':
        $img_r = imagecreatefromjpeg($imgUrl);
        $source_image = imagecreatefromjpeg($imgUrl);
        $type = '.jpg';
        break;
    case 'image/gif':
        $img_r = imagecreatefromgif($imgUrl);
        $source_image = imagecreatefromgif($imgUrl);
        $type = '.gif';
        break;
    default: $options = array(
            "status" => "error",
            "message" => "Please upload only images, with JPG, GIF or PNG format."); 

              print json_encode($options);
        break;
        exit();
}

$resizedImage = imagecreatetruecolor($imgW, $imgH);
imagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW, 
            $imgH, $imgInitW, $imgInitH);   


$dest_image = imagecreatetruecolor($cropW, $cropH);
imagecopyresampled($dest_image, $resizedImage, 0, 0, $imgX1, $imgY1, $cropW, 
            $cropH, $cropW, $cropH);    


imagejpeg($dest_image, $output_filename.$type, $jpeg_quality);
//Creating thumbnail to user
$img_temp = Image::make(URL::asset($output_filename.$type));
//Image::make(URL::asset($output_filename.$type))->fit(250, 150)->save('temp/'.$output_filename.'_desthumb'.$type,100);
$img_temp->fit(304, 150)->save($output_filename.'_desthumb'.$type,100);
$thumb304x150 = $output_filename.'_desthumb'.$type;
$response = array(
        "status" => "success",
        "url" => URL::asset($thumb304x150) 
      );
// saving cropped image to session
//Session::put('image1.cropped',$output_filename.$type);
Session::put($input['order'].'_cropped', $output_filename.$type);
File::delete(public_path(Session::get($input['order'].'_original')));
print json_encode($response);

Any ideas?

16 Aug
5 years ago

malesandro left a reply on Homestead Is Changing My Table Names When Querying

It was local. Thanks a lot for your help :)

malesandro left a reply on Homestead Is Changing My Table Names When Querying

Thanks @ax3l The problem is that I cannot find where to change this setting.

I have the correct database assigned in /config/database.php, but this is something from Homestead. I had already watched the video, and it says that it will use the homestead database, but doesn't mention where to override this.

malesandro started a new conversation Homestead Is Changing My Table Names When Querying

Hi everyone. Today I decided to give Homestead + Vagrant a try. So far so good, until I run into a problem when testing an application login form. I am getting an SQL error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'homestead.users' doesn't exist (SQL: select * from `users` where `email` = email@mail.com limit 1)

I cannot figure out where "homestead" is being added. Since it has begun happening since moving to Homestead, I guess it is something related to an ENV variable somewhere. Can somebody please shed some light on the matter? Thanks a lot, Mariano