ChrisF79

ChrisF79

Member Since 5 Years Ago

Naples, FL

Experience Points
12,620
Total
Experience

2,380 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
147
Lessons
Completed
Best Reply Awards
0
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.

Level 3
12,620 XP
Aug
05
3 months ago
Activity icon

Replied to How To Use A Database On A Remote Server?

The user is chris. That's all.

Activity icon

Replied to How To Use A Database On A Remote Server?

No, I just didn't fill out the thread properly...

Activity icon

Started a new Conversation How To Use A Database On A Remote Server?

Hi everyone,

I created a new server to use as a database server. I created a new user using:

CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';

I then gave myself all permissions using:

GRANT ALL PRIVILEGES ON database.table TO 'user'@'localhost';

I can log in from my computer using Sequel Pro. Now, I went into my .env file and made:

DB_CONNECTION=mysql
DB_HOST=50.50.50.50
DB_PORT=3306
DB_DATABASE=RETS
DB_USERNAME=chris
DB_PASSWORD=password

However, I'm getting an access denied error. What could I be doing wrong?

SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `rets_property_res_mstr` where `Status` = Active and `Inactive` = 0 and `featuredlisting` = 1 order by `CurrentPrice` asc limit 20)
Activity icon

Replied to Splitting My App Between Two Servers

Thanks Bobby! As for the database, it would live on the new server so the old server would have to access it remotely. That shouldn't be a problem, right?

Activity icon

Started a new Conversation Splitting My App Between Two Servers

I have a real estate website and behind the scenes, the app is going out and downloading every picture for each listing, resizing to multiple sizes and uploading to S3 for storage. There are other CPU intensive tasks as well but that's the big one. It is really slowing my site down so I want to move the database and tasks to a different VPS. My question then is... Can I just git clone my site on the new server and then:

  1. Stop the cron on the first server and start it on the second
  2. Edit my .env to put the IP of the new server as the database host

Anything else? I'm sure there's something I'm missing that will mess something up. Any insight on what to expect or if I'm thinking correctly is highly appreciated!

Jul
23
3 months ago
Activity icon

Replied to Cannot Create A Simple Array

Thank you. I just copy/pasted your code. It runs for about 45 seconds and then prints:

Array
(
)
Activity icon

Started a new Conversation Cannot Create A Simple Array

I'm trying to create an array as I loop through some records of my database. The records are there but after the loop when I print_r the $sitemap, it is empty. It should have about 27k records in it.

Here is my code:

        Listing::where('Inactive', '=', 0)
            ->where('Status', '=', 'Active')
            ->chunk(200, function($listings) {
            foreach($listings as $listing) {
                $sitemap[] = array (
                    $cleanURL = "https://listingnaples.com/listing/" . $listing->MLSNumber . "/" . $listing->CleanAddressURL,
                    "loc" => $cleanURL,
                    "changefreq" => "daily",
                    "priority" => "0.90"
                );
            }
        });
Jul
16
3 months ago
Activity icon

Replied to How Do I Diagnose A 500 Server Error?

You did it! I literally just yelled "YES!" out loud without thinking. I was afraid I'd have to hire someone to fix it but your link got it. It ended up being permissions. Even though I was changing them myself per other solutions, your link got it done. I must have been missing something. THANK YOU!

Activity icon

Replied to How Do I Diagnose A 500 Server Error?

I checked storage permissions.

drwxr-xr-x  6 chrisfarrugia www-data   4096 Jun 23 12:04 storage

I checked the laravel.log file itself...

-rwxrwxrwx 1 chrisfarrugia www-data 14021733 Jul 16 09:48 laravel.log

I looked at my controllers and route file and cannot find anythign that looks out of place. Plus, I can't figure out why it works locally with Laravel Valet.

Should I delete everything and just clone the folder again from github?

Is this something I can hire for do you think? I could always post a job on UpWork for someone to help.

Activity icon

Replied to How Do I Diagnose A 500 Server Error?

Found my error log (I'm pretty bad at this!). Here is the log:

019/07/16 09:21:16 [error] 31590#31590: *61261 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught ReflectionException: Class view does not exist in /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Container/Container.php:790
Stack trace:
#0 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Container/Container.php(790): ReflectionClass->__construct('view')
#1 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Container/Container.php(667): Illuminate\Container\Container->build('view')
#2 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Container/Container.php(615): Illuminate\Container\Container->resolve('view', Array)
#3 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(767): Illuminate\Container\Container->make('view', Array)
#4 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Container/Container.php(1225): Illuminate\Foundation\Application->make('view')
#5 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Su...PHP message: PHP Fatal error:  Uncaught ReflectionException: Class view does not exist in /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Container/Container.php:790
Jul
15
3 months ago
Activity icon

Replied to How Do I Diagnose A 500 Server Error?

It wasn't on so I just turned it on. However, refreshing the page that gives the error 500 didn't make any new entry to storage/logs/laravel.log

Activity icon

Started a new Conversation How Do I Diagnose A 500 Server Error?

Hi friends,

I wrote a sitemap generator and it is working on my local Laravel Valet server. When I put it into production I get an Error 500 server error (running nginx). I look at my storage/logs/laravel.log and nothing is in there regarding the error. How do I diagnose and solve the problem?

Thank you

Jun
27
4 months ago
Activity icon

Replied to Error Log Saying No Query Results Found But There Are Records

That's very helpful and thanks everyone for taking the time out to help me!

Activity icon

Replied to Error Log Saying No Query Results Found But There Are Records

I just emptied the entire Amazon SQS queue and it seems to be working now! Could this error message just be saying, "Hey man... this job you want me to do... the record isn't in that model."

Activity icon

Replied to Error Log Saying No Query Results Found But There Are Records

Rebooting now to see if it fixes it... Just rebooted and it is doing the exact same thing... it's just that error over and over.

Activity icon

Started a new Conversation Error Log Saying No Query Results Found But There Are Records

I just don't understand this error. I'm working on an app where I download records from a server and store them in a temporary table called rets_property_res_naples and then in a console command, they get selected, transformed a bit, then put into a "master" table.

I'm now getting the below error and I just don't understand it. If I go into php artisan tinker and do a \App\Models\TempListingNaples::all(), I get all of the records!

Like I said, I just don't understand so why would it pull fine from the model but the console command couldn't?

Error Message

Illuminate\Database\Eloquent\ModelNotFoundException: No query results for model [App\Models\TempListingNaples]. in /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:454
Stack trace:
#0 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php(85): Illuminate\Database\Eloquent\Builder->firstOrFail()
#1 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Queue/SerializesAndRestoresModelIdentifiers.php(55): App\Jobs\ProcessListing->restoreModel(Object(Illuminate\Contracts\Database\ModelIdentifier))
#2 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Queue/SerializesModels.php(45): App\Jobs\ProcessListing->getRestoredPropertyValue(Object(Illuminate\Contracts\Database\ModelIdentifier))
#3 [internal function]: App\Jobs\ProcessListing->__wakeup()
#4 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(42): unserialize('O:23:"App\Jobs\...')
#5 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(88): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\SqsJob), Array)
#6 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(327): Illuminate\Queue\Jobs\Job->fire()
#7 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(277): Illuminate\Queue\Worker->process('sqs', Object(Illuminate\Queue\Jobs\SqsJob), Object(Illuminate\Queue\WorkerOptions))
#8 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(118): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\SqsJob), 'sqs', Object(Illuminate\Queue\WorkerOptions))
#9 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(102): Illuminate\Queue\Worker->daemon('sqs', 'ImportQueue', Object(Illuminate\Queue\WorkerOptions))
#10 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(86): Illuminate\Queue\Console\WorkCommand->runWorker('sqs', 'ImportQueue')
#11 [internal function]: Illuminate\Queue\Console\WorkCommand->handle()
#12 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array(Array, Array)
#13 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#14 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#15 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Container/Container.php(576): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#16 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\Container\Container->call(Array)
#17 /srv/www/listingnaples.com/vendor/symfony/console/Command/Command.php(255): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#18 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Console/Command.php(170): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#19 /srv/www/listingnaples.com/vendor/symfony/console/Application.php(921): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /srv/www/listingnaples.com/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /srv/www/listingnaples.com/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Console/Application.php(90): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(133): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /srv/www/listingnaples.com/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 {main}

Here is the model:

TempListingNaples

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class TempListingNaples extends Model
{
    protected $table = "rets_property_res_naples";
    protected $hidden = ['created_at', 'updated_at'];
    protected $dates = ['PhotoModificationTimestamp'];
    public $board = "Naples";

    public function __construct(array $attributes = [])
    {
        $this->fillable = \Config::get('master_schema');
        parent::__construct($attributes);
    }
    
    function toArray()
    {
        $temp = parent::toArray();
            if(starts_with($temp['PhotoModificationTimestamp'], '-'))
            {
                $temp['PhotoModificationTimestamp'] = '0000-00-00 00:00:00';
            }
        return $temp;
    }
}

Console Command

<?php
namespace App\Console\Commands;

use DB;
use App\Models\Listing;
use App\Models\ListingMigrator;
use App\Models\TempListingNaples;
use App\Models\RetsFeed;
use Illuminate\Console\Command;

class MigrateListings extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'chores:MigrateListings';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Migrate the listings from each boards temp table to rets_property_res_mstr';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        // Turn off query logging
        DB::connection()->disableQueryLog();

        // get each feed so we can assign models
        $feeds = RetsFeed::where('active', '=', 1)->get();

        foreach ($feeds as $feed)
        {

            // Define which model to use based on the feed's board using the fully qualified namespace
            $class = 'App\Models\TempListing' . $feed->board;

            // Get the listings sitting in the temp table for that board
            $listings = $class::orderBy('MatrixModifiedDT','asc')->get();

            $listings->each(function($listing) use ($feed) {
                \App\Jobs\ProcessListing::dispatch($listing, $feed);
            });

        }
    }
}
Jun
24
4 months ago
Activity icon

Replied to Can't Send Mail Through Gmail

SOLVED! It isn't smtp.google.com! It's smtp.gmail.com!

Jun
23
4 months ago
Activity icon

Replied to Can't Send Mail Through Gmail

We're on to something...

[email protected]:/srv/www/listingnaples.com$ ping smtp.google.com:587
ping: smtp.google.com:587: Name or service not known
Activity icon

Replied to Can't Send Mail Through Gmail

    public function store(Request $request)
    {

        // Validate of the form data
        $validateData = $request->validate([
            'firstname'     => 'required',
            'lastname'      => 'required',
            'email'         => 'required|email',
            'phone'         => 'required',
            'address'       => 'required'
        ]);

        $valuation = new Valuation();

        $valuation->firstname = request('firstname');
        $valuation->lastname = request('lastname');
        $valuation->email = request('email');
        $valuation->phone = request('phone');
        $valuation->address = request('address');

        $valuation->save();

        Mail::send('emails.contact', [
            'msg' => 'New Valuation Request',

        ], function($mail) use($request) {
            $mail->from($request->email, $request->firstname. ' ' .$request->lastname);
            $mail->to('[email protected]')->subject('ListingNaples Contact');
        });



        return redirect()->back()->with('flash_message', 'Thank you. We will be in touch shortly.');


    }
Activity icon

Started a new Conversation Can't Send Mail Through Gmail

I'm trying to send email through a form and I'm getting the following error:

Swift_TransportException
Connection could not be established with host smtp.google.com [php_network_getaddresses: getaddrinfo failed: Name or service not known #0]

In my environment file, I have:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.google.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=tls

I've tried everything others have said yet it just won't connect and send.

Jun
12
5 months ago
Activity icon

Replied to Homestead Not Mapping ~/code/ After Updating Box

I should add that I did run vagrant provision.

Activity icon

Started a new Conversation Homestead Not Mapping ~/code/ After Updating Box

Hi everyone,

Today I updated the homstead box to 8.0.0-alpha2. It was working all day and then after updating it has an empty ~/code/ folder when I ssh in. On my machine, all of my folders are in ~/code so that's fine. However, they just aren't there when I ssh into the box.

Did something change in version 8 and nobody is telling me?

Jun
04
5 months ago
Activity icon

Replied to Homestead, Serve, Separate Linux Box/VM? How Do You Work?

@CRONIX - Ah, I'm a Mac guy and I have 16GB of Ram. I did think about that but I just figured something like Parallels would be faster than VirtualBox.

Activity icon

Replied to Homestead, Serve, Separate Linux Box/VM? How Do You Work?

No, not at all. But hitting refresh on a page just takes longer than it should. When working on the front-end, it gets a bit tedious.

Activity icon

Started a new Conversation Homestead, Serve, Separate Linux Box/VM? How Do You Work?

I have always used Homestead but I'm getting a bit tired of how slow it is. I'm tempted to just create an Ubuntu VM with Parallels and use that as my dev environment.

What do you use to serve?