ChrisF79

ChrisF79

Member Since 5 Years Ago

Naples, FL

Experience Points 9,730
Experience Level 2

270 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 120
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.

16 Jul
6 days ago

ChrisF79 left a reply on 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!

ChrisF79 left a reply on 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.

ChrisF79 left a reply on How Do I Diagnose A 500 Server Error?

Foudn 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
15 Jul
1 week ago

ChrisF79 left a reply on 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

ChrisF79 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

27 Jun
3 weeks ago

ChrisF79 left a reply on 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!

ChrisF79 left a reply on 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."

ChrisF79 left a reply on Error Log Saying No Query Results Found But There Are Records

Rebooting now to see if it fixes it...

ChrisF79 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?

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;
    }
}

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}

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);
            });

        }
    }
}
24 Jun
4 weeks ago

ChrisF79 left a reply on Can't Send Mail Through Gmail

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

23 Jun
4 weeks ago

ChrisF79 left a reply on 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

ChrisF79 left a reply on 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.');


    }

ChrisF79 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.

12 Jun
1 month ago

ChrisF79 left a reply on Homestead Not Mapping ~/code/ After Updating Box

I should add that I did run vagrant provision.

ChrisF79 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?

04 Jun
1 month ago

ChrisF79 left a reply on 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.

ChrisF79 left a reply on 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.

ChrisF79 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?

03 May
2 months ago

ChrisF79 left a reply on Search Not Appending To URL Using GET

WOW, thank you! I told you it was a stupid question! Now if only there were a way to delete threads.

ChrisF79 started a new conversation Search Not Appending To URL Using GET

I have the code below (looks like a lot but it's not) and when I make choices in the form and hit submit, it appends /listings/?search%5B%5D= but it does not put any values at all in the URL. It seems so ridiculous but I have no idea why it is doing that.

How do I get my form to actually put the values in the URL?

Thanks!

<!-- Hero -->
<section id="hero">
<div class="container">
<div class="col-md-12 mx-auto">

    <form method="get" action="listings/" id="searchForm">
      <div class="form-row">
        <div class="col">
            <!-- Minimum Price -->
            <select class="form-control mb-2" id="MinPrice">
                <option value="">Minimum Price</option>
                <option value="50000">,000</option>
                <option value="75000">,000</option>
                <option value="100000">0,000</option>
                <option value="125000">5,000</option>
                <option value="150000">0,000</option>
                <option value="175000">5,000</option>
                <option value="200000">0,000</option>
                <option value="225000">5,000</option>
                <option value="250000">0,000</option>
                <option value="275000">5,000</option>
                <option value="300000">0,000</option>
                <option value="325000">5,000</option>
                <option value="350000">0,000</option>
                <option value="375000">5,000</option>
                <option value="400000">0,000</option>
                <option value="425000">5,000</option>
                <option value="450000">0,000</option>
                <option value="475000">5,000</option>
                <option value="500000">0,000</option>
                <option value="550000">0,000</option>
                <option value="600000">0,000</option>
                <option value="650000">0,000</option>
                <option value="700000">0,000</option>
                <option value="750000">0,000</option>
                <option value="800000">0,000</option>
                <option value="850000">0,000</option>
                <option value="900000">0,000</option>
                <option value="950000">0,000</option>
                <option value="1000000">,000,000</option>
                <option value="1100000">,100,000</option>
                <option value="1200000">,200,000</option>
                <option value="1300000">,300,000</option>
                <option value="1400000">,400,000</option>
                <option value="1500000">,500,000</option>
                <option value="1600000">,600,000</option>
                <option value="1700000">,700,000</option>
                <option value="1800000">,800,000</option>
                <option value="1900000">,900,000</option>
                <option value="2000000">,000,000</option>
                <option value="2100000">,100,000</option>
                <option value="2200000">,200,000</option>
                <option value="2300000">,300,000</option>
                <option value="2400000">,400,000</option>
                <option value="2500000">,500,000</option>
                <option value="2750000">,750,000</option>
                <option value="3000000">,000,000</option>
                <option value="3250000">,250,000</option>
                <option value="3500000">,500,000</option>
                <option value="3750000">,750,000</option>
                <option value="4000000">,000,000</option>
                <option value="4250000">,250,000</option>
                <option value="4500000">,500,000</option>
                <option value="4750000">,750,000</option>
                <option value="5000000">,000,000</option>
                <option value="5250000">,250,000</option>
                <option value="5500000">,500,000</option>
                <option value="5750000">,750,000</option>
                <option value="6000000">,000,000</option>
                <option value="6250000">,250,000</option>
                <option value="6500000">,500,000</option>
                <option value="6750000">,750,000</option>
                <option value="7000000">,000,000</option>
                <option value="7250000">,250,000</option>
                <option value="7500000">,500,000</option>
                <option value="7750000">,750,000</option>
                <option value="8000000">,000,000</option>
                <option value="8250000">,250,000</option>
                <option value="8500000">,500,000</option>
                <option value="8750000">,750,000</option>
                <option value="9000000">,000,000</option>
                <option value="9250000">,250,000</option>
                <option value="9500000">,500,000</option>
                <option value="9750000">,750,000</option>
                <option value="10000000">,000,000</option>
            </select>
        </div>



        <div class="col">
            <select class="form-control mb-2" id="MinPrice">
                <option value="">Maximum Price</option>
                <option value="50000">,000</option>
                <option value="75000">,000</option>
                <option value="100000">0,000</option>
                <option value="125000">5,000</option>
                <option value="150000">0,000</option>
                <option value="175000">5,000</option>
                <option value="200000">0,000</option>
                <option value="225000">5,000</option>
                <option value="250000">0,000</option>
                <option value="275000">5,000</option>
                <option value="300000">0,000</option>
                <option value="325000">5,000</option>
                <option value="350000">0,000</option>
                <option value="375000">5,000</option>
                <option value="400000">0,000</option>
                <option value="425000">5,000</option>
                <option value="450000">0,000</option>
                <option value="475000">5,000</option>
                <option value="500000">0,000</option>
                <option value="550000">0,000</option>
                <option value="600000">0,000</option>
                <option value="650000">0,000</option>
                <option value="700000">0,000</option>
                <option value="750000">0,000</option>
                <option value="800000">0,000</option>
                <option value="850000">0,000</option>
                <option value="900000">0,000</option>
                <option value="950000">0,000</option>
                <option value="1000000">,000,000</option>
                <option value="1100000">,100,000</option>
                <option value="1200000">,200,000</option>
                <option value="1300000">,300,000</option>
                <option value="1400000">,400,000</option>
                <option value="1500000">,500,000</option>
                <option value="1600000">,600,000</option>
                <option value="1700000">,700,000</option>
                <option value="1800000">,800,000</option>
                <option value="1900000">,900,000</option>
                <option value="2000000">,000,000</option>
                <option value="2100000">,100,000</option>
                <option value="2200000">,200,000</option>
                <option value="2300000">,300,000</option>
                <option value="2400000">,400,000</option>
                <option value="2500000">,500,000</option>
                <option value="2750000">,750,000</option>
                <option value="3000000">,000,000</option>
                <option value="3250000">,250,000</option>
                <option value="3500000">,500,000</option>
                <option value="3750000">,750,000</option>
                <option value="4000000">,000,000</option>
                <option value="4250000">,250,000</option>
                <option value="4500000">,500,000</option>
                <option value="4750000">,750,000</option>
                <option value="5000000">,000,000</option>
                <option value="5250000">,250,000</option>
                <option value="5500000">,500,000</option>
                <option value="5750000">,750,000</option>
                <option value="6000000">,000,000</option>
                <option value="6250000">,250,000</option>
                <option value="6500000">,500,000</option>
                <option value="6750000">,750,000</option>
                <option value="7000000">,000,000</option>
                <option value="7250000">,250,000</option>
                <option value="7500000">,500,000</option>
                <option value="7750000">,750,000</option>
                <option value="8000000">,000,000</option>
                <option value="8250000">,250,000</option>
                <option value="8500000">,500,000</option>
                <option value="8750000">,750,000</option>
                <option value="9000000">,000,000</option>
                <option value="9250000">,250,000</option>
                <option value="9500000">,500,000</option>
                <option value="9750000">,750,000</option>
                <option value="10000000">,000,000</option>
            </select>
          </div> <!-- end col -->
    </div><!-- End Row -->

    <div class="form-row">
          <div class="col">
            <select class="form-control mb-2" id="bedrooms">
                <option value="">Minimum Bedrooms</option>
                <option value="0">Studio</option>
                <option value="1">1 Bedroom</option>
                <option value="2">2 Bedrooms</option>
                <option value="3">3 Bedrooms</option>
                <option value="4">4 Bedrooms</option>
                <option value="5">5 Bedrooms</option>
                <option value="6">6 or More Bedrooms</option>
            </select>
          </div>

      <div class="col">
            <select class="form-control mb-2" id="bathrooms">
                <option value="">Minimum Bathrooms</option>
                <option value="1">1 Bathrooms</option>
                <option value="2">2 Bathrooms</option>
                <option value="3">3 Bathrooms</option>
                <option value="4">4 Bathrooms</option>
                <option value="5">5 Bathrooms</option>
                <option value="6">6 or More Bathrooms</option>
            </select>
          </div>

    </div> <!-- End row 2 -->


    <div class="form-row">
          <div class="col">
            <select class="form-control mb-2" id="bedrooms">
                <option value="">Minimum Square Feet</option>
                <option value="1000">1,000+</option>
                <option value="1250">1,250+</option>
                <option value="1500">1,500+</option>
                <option value="1750">1,750+</option>
                <option value="2000">2,000+</option>
                <option value="2500">2,500+</option>
                <option value="3000">3,000+</option>
                <option value="4000">4,000+</option>
                <option value="5000">5,000+</option>
                <option value="6000">6,000+</option>
            </select>
          </div>

      <div class="col">
        <button type="submit" id="search" name="search[]" class="listingbutton btn w-100"><i class="fas fa-home mr-2"></i>Find My Home</a></button>
      </div>

    </div> <!-- End row 3 -->

</form>
</section>
21 Apr
3 months ago

ChrisF79 started a new conversation DB Update Not Working - Non-static Method Illuminate\Database\Eloquent\Model::update() Should Not Be Called Statically

I'm running a simple script to count pageviews. It pulls the pageviews, increments the number, then tries to update the record. However, I'm getting the error in the subject line.

        $views = wp_popularpostsdata::where('postid', '=', $data[0]['id'])->first()->toArray();
        $newviews = $views['pageviews']+1;
        $postid = $views['postid'];

        $query = "update wp_popularpostsdata set pageviews = '$newviews' where postid = $postid";
        $newviews = wp_popularpostsdata::update($query);

        return view('layouts.blog')->withData($data);

I'm embarrassed at how easy this should be but I'm stuck!

18 Apr
3 months ago

ChrisF79 left a reply on How Do I Output A JSON Variable?

$post->_embedded->author['0']->name

ChrisF79 started a new conversation How Do I Output A JSON Variable?

I have the JSON below. All I am trying to do is output "Theme Reviewer" as the author name. I tried

$post->_embedded['author']['0']['name']

That doesn't output it. I've tried other variations like the 0 not having ' around it yet nothing is working. Please help!

The variable is at the end of this JSON:

array:10 [▼
  0 => {#710 ▼
    +"id": 1780
    +"date": "2018-11-03T12:20:00"
    +"date_gmt": "2018-11-03T12:20:00"
    +"guid": {#711 ▶}
    +"modified": "2019-04-19T01:02:23"
    +"modified_gmt": "2019-04-19T01:02:23"
    +"slug": "block-image"
    +"status": "publish"
    +"type": "post"
    +"link": "https://blog.listingnaples.com/block-image/"
    +"title": {#712 ▶}
    +"content": {#713 ▶}
    +"excerpt": {#714 ▶}
    +"author": 3
    +"featured_media": 1022
    +"comment_status": "open"
    +"ping_status": "open"
    +"sticky": false
    +"template": ""
    +"format": "standard"
    +"meta": {#715 ▶}
    +"categories": array:1 [▶]
    +"tags": array:1 [▶]
    +"fimg_url": "https://blog.listingnaples.com/wp-content/uploads/2013/03/featured-image-horizontal-1.jpg"
    +"_links": {#717 ▶}
    +"_embedded": {#734 ▼
      +"author": array:1 [▼
        0 => {#729 ▼
          +"id": 3
          +"name": "Theme Reviewer"
27 Mar
3 months ago

ChrisF79 left a reply on Php Artisan Now Throwing A PHP Fatal Error On Laravel 5.7.26

Good call. Evidently my php was updated from 7.2-fpm to 7.3-fpm so I had to go in and change that, composer update and we're back in business. Thanks!

ChrisF79 left a reply on Php Artisan Now Throwing A PHP Fatal Error On Laravel 5.7.26

I should add that I did make sure bcmath is installed...

php7.2-bcmath is already the newest version (7.2.16-1+ubuntu18.04.1+deb.sury.org+1).

ChrisF79 started a new conversation Php Artisan Now Throwing A PHP Fatal Error On Laravel 5.7.26

Hi everyone,

I woke up today to an odd issue. Running php artisan by itself even will throw this:

PHP Fatal error:  Uncaught Error: Call to undefined function Moontoast\Math\bcadd() in /srv/www/listingnaples.com/vendor/moontoast/math/src/Moontoast/Math/BigNumber.php:506
Stack trace:
#0 /srv/www/listingnaples.com/vendor/moontoast/math/src/Moontoast/Math/BigNumber.php(62): Moontoast\Math\BigNumber->setValue('155368742548353')
#1 /srv/www/listingnaples.com/vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php(49): Moontoast\Math\BigNumber->__construct('155368742548353')
#2 /srv/www/listingnaples.com/vendor/ramsey/uuid/src/Generator/CombGenerator.php(72): Ramsey\Uuid\Converter\Number\BigNumberConverter->toHex('155368742548353')
#3 /srv/www/listingnaples.com/vendor/ramsey/uuid/src/UuidFactory.php(235): Ramsey\Uuid\Generator\CombGenerator->generate(16)
#4 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Support/Str.php(552): Ramsey\Uuid\UuidFactory->uuid4()
#5 /srv/www/listingnaples.com/vendor/laravel/telescope/src/IncomingEntry.php(74): Illuminate\Support\Str::orderedUuid()
#6 /srv/www/listingnaples.c in /srv/www/listingnaples.com/vendor/moontoast/math/src/Moontoast/Math/BigNumber.php on line 506
PHP Fatal error:  Uncaught Error: Call to undefined function Moontoast\Math\bcadd() in /srv/www/listingnaples.com/vendor/moontoast/math/src/Moontoast/Math/BigNumber.php:506
Stack trace:
#0 /srv/www/listingnaples.com/vendor/moontoast/math/src/Moontoast/Math/BigNumber.php(62): Moontoast\Math\BigNumber->setValue('155368742548506')
#1 /srv/www/listingnaples.com/vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php(49): Moontoast\Math\BigNumber->__construct('155368742548506')
#2 /srv/www/listingnaples.com/vendor/ramsey/uuid/src/Generator/CombGenerator.php(72): Ramsey\Uuid\Converter\Number\BigNumberConverter->toHex('155368742548506')
#3 /srv/www/listingnaples.com/vendor/ramsey/uuid/src/UuidFactory.php(235): Ramsey\Uuid\Generator\CombGenerator->generate(16)
#4 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Support/Str.php(552): Ramsey\Uuid\UuidFactory->uuid4()
#5 /srv/www/listingnaples.com/vendor/laravel/telescope/src/IncomingEntry.php(74): Illuminate\Support\Str::orderedUuid()
#6 /srv/www/listingnaples.c in /srv/www/listingnaples.com/vendor/moontoast/math/src/Moontoast/Math/BigNumber.php on line 506
[email protected]:/srv/www/listingnaples.com$ php artisan --version
 Laravel Framework 5.7.26
PHP Fatal error:  Uncaught Error: Call to undefined function Moontoast\Math\bcadd() in /srv/www/listingnaples.com/vendor/moontoast/math/src/Moontoast/Math/BigNumber.php:506
Stack trace:
#0 /srv/www/listingnaples.com/vendor/moontoast/math/src/Moontoast/Math/BigNumber.php(62): Moontoast\Math\BigNumber->setValue('155368753468842')
#1 /srv/www/listingnaples.com/vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php(49): Moontoast\Math\BigNumber->__construct('155368753468842')
#2 /srv/www/listingnaples.com/vendor/ramsey/uuid/src/Generator/CombGenerator.php(72): Ramsey\Uuid\Converter\Number\BigNumberConverter->toHex('155368753468842')
#3 /srv/www/listingnaples.com/vendor/ramsey/uuid/src/UuidFactory.php(235): Ramsey\Uuid\Generator\CombGenerator->generate(16)
#4 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Support/Str.php(552): Ramsey\Uuid\UuidFactory->uuid4()
#5 /srv/www/listingnaples.com/vendor/laravel/telescope/src/IncomingEntry.php(74): Illuminate\Support\Str::orderedUuid()
#6 /srv/www/listingnaples.c in /srv/www/listingnaples.com/vendor/moontoast/math/src/Moontoast/Math/BigNumber.php on line 506
PHP Fatal error:  Uncaught Error: Call to undefined function Moontoast\Math\bcadd() in /srv/www/listingnaples.com/vendor/moontoast/math/src/Moontoast/Math/BigNumber.php:506
Stack trace:
#0 /srv/www/listingnaples.com/vendor/moontoast/math/src/Moontoast/Math/BigNumber.php(62): Moontoast\Math\BigNumber->setValue('155368753468927')
#1 /srv/www/listingnaples.com/vendor/ramsey/uuid/src/Converter/Number/BigNumberConverter.php(49): Moontoast\Math\BigNumber->__construct('155368753468927')
#2 /srv/www/listingnaples.com/vendor/ramsey/uuid/src/Generator/CombGenerator.php(72): Ramsey\Uuid\Converter\Number\BigNumberConverter->toHex('155368753468927')
#3 /srv/www/listingnaples.com/vendor/ramsey/uuid/src/UuidFactory.php(235): Ramsey\Uuid\Generator\CombGenerator->generate(16)
#4 /srv/www/listingnaples.com/vendor/laravel/framework/src/Illuminate/Support/Str.php(552): Ramsey\Uuid\UuidFactory->uuid4()
#5 /srv/www/listingnaples.com/vendor/laravel/telescope/src/IncomingEntry.php(74): Illuminate\Support\Str::orderedUuid()
#6 /srv/www/listingnaples.c in /srv/www/listingnaples.com/vendor/moontoast/math/src/Moontoast/Math/BigNumber.php on line 506

The problem is, I really have no idea how to solve it! It is a dependency issue, no?

06 Feb
5 months ago

ChrisF79 left a reply on Whoops Isn't Working... Whoops!

I took the easy way out and just removed filp/whoops and reinstalled it. That fixed it. I wish I could delete topics here because I created this one and my wife created one as well so now we have duplicate conversations going!

At any rate, problem solved!

ChrisF79 left a reply on Could Not Find Resource 'css/whoops.base.css' And Freezing

I took the easy way out and just removed filp/whoops and reinstalled it. That fixed it. I wish I could delete topics here because I created this one and my wife created one as well so now we have duplicate conversations going!

At any rate, problem solved!

ChrisF79 left a reply on Whoops Isn't Working... Whoops!

Doing php artisan serve on the same project gives me the same error so I think we can eliminate homestead as being a problem.

ChrisF79 left a reply on Could Not Find Resource 'css/whoops.base.css' And Freezing

By the way, it isn't a homestead issue. Doing php artisan serve gives me the exact same problem.

ChrisF79 left a reply on Whoops Isn't Working... Whoops!

I woke up today to a new version of Laravel Homestead and really thought that was going to fix it but it did not unfortunately.

ChrisF79 left a reply on Whoops Isn't Working... Whoops!

@MUNAZZIL - Tried that as well and it still returns the error.

05 Feb
5 months ago

ChrisF79 left a reply on Whoops Isn't Working... Whoops!

@JLRDW - Tried both but still the same issue.

ChrisF79 started a new conversation Whoops Isn't Working... Whoops!

I have a page that isn't quite right so when I run it and it tries to output the error I get:

(1/1) RuntimeException Could not find resource 'css/whoops.base.css' in any resource paths.(searched: /home/vagrant/code/listingnaples.test/vendor/filp/whoops/src/Whoops/Handler/../Resources)

in PrettyPageHandler.php line 620
at PrettyPageHandler->getResource('css/whoops.base.css')
in PrettyPageHandler.php line 170
at PrettyPageHandler->handle(object(ErrorException))
in Run.php line 272
at Run->handleException(object(ErrorException))
in Handler.php line 339
at Handler->renderExceptionWithWhoops(object(ErrorException))
in Handler.php line 318
at Handler->renderExceptionContent(object(ErrorException))
in Handler.php line 302
at Handler->convertExceptionToResponse(object(ErrorException))
in Handler.php line 281
at Handler->prepareResponse(object(Request), object(ErrorException))
in Handler.php line 188
at Handler->render(object(Request), object(ErrorException))
in Handler.php line 49
at Handler->render(object(Request), object(ErrorException))
in Pipeline.php line 83
at Pipeline->handleException(object(Request), object(ErrorException))
in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure))
in Pipeline.php line 151
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in VerifyCsrfToken.php line 75
at VerifyCsrfToken->handle(object(Request), object(Closure))
in Pipeline.php line 151
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
in Pipeline.php line 151
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in StartSession.php line 63
at StartSession->handle(object(Request), object(Closure))
in Pipeline.php line 151
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
in Pipeline.php line 151
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in EncryptCookies.php line 66
at EncryptCookies->handle(object(Request), object(Closure))
in Pipeline.php line 151
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in Pipeline.php line 104
at Pipeline->then(object(Closure))
in Router.php line 684
at Router->runRouteWithinStack(object(Route), object(Request))
in Router.php line 659
at Router->runRoute(object(Request), object(Route))
in Router.php line 625
at Router->dispatchToRoute(object(Request))
in Router.php line 614
at Router->dispatch(object(Request))
in Kernel.php line 176
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
in Pipeline.php line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in TrustProxies.php line 57
at TrustProxies->handle(object(Request), object(Closure))
in Pipeline.php line 151
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in TransformsRequest.php line 31
at TransformsRequest->handle(object(Request), object(Closure))
in Pipeline.php line 151
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in TransformsRequest.php line 31
at TransformsRequest->handle(object(Request), object(Closure))
in Pipeline.php line 151
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in ValidatePostSize.php line 27
at ValidatePostSize->handle(object(Request), object(Closure))
in Pipeline.php line 151
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in CheckForMaintenanceMode.php line 62
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
in Pipeline.php line 151
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in Pipeline.php line 104
at Pipeline->then(object(Closure))
in Kernel.php line 151
at Kernel->sendRequestThroughRouter(object(Request))
in Kernel.php line 116
at Kernel->handle(object(Request))
in index.php line 55

ChrisF79 left a reply on Could Not Find Resource 'css/whoops.base.css' And Freezing

@DALMA - Thanks. I did that earlier and it is there and populated. It's that var_dump that's definitely causing the error.

ChrisF79 left a reply on Could Not Find Resource 'css/whoops.base.css' And Freezing

I just cleared out my laravel.log and ran it. It has right at the top:

[2019-02-05 14:58:36] local.ERROR: Class 'ButterCMS' not found {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Class 'ButterCMS' not found at /home/vagrant/code/listingnaples.test/app/Http/Controllers/PostController.php:22)
[stacktrace]

In my file from above, I do have use ButterCMS\ButterCMS; and under my vendor folder I have a buttercms directory (screenshot of the directory structure). I have no idea why this wouldn't work.

ChrisF79 left a reply on Could Not Find Resource 'css/whoops.base.css' And Freezing

@DALMA - Yes, unfortunately. I just ran it again too.

ChrisF79 started a new conversation Could Not Find Resource 'css/whoops.base.css' And Freezing

Hi everyone,

I just installed ButterCMS and put in my controlelr the following code:

    public function index()
    {
        
        $apiToken = 'eaad2fa1cd822fdas234tgsaq7184f25ec6af5';

        $client = new \ButterCMS($apiToken);

        var_dump($client->fetchPosts([
            'page' => $page,
            'page_size' => 10
          ]));

    die();
    }

I've namespaced it at the top of the file with `use ButterCMS\ButterCMS;`

Now, that code is their [example code](https://buttercms.com/docs/api-client/laravel) so I can see that it is working. Yet, it just isn't. Instead, I get this:

```Whoops, looks like something went wrong.

(1/1) RuntimeException
Could not find resource 'css/whoops.base.css' in any resource paths.(searched: /home/vagrant/code/listingnaples.test/vendor/filp/whoops/src/Whoops/Handler/../Resources)

in PrettyPageHandler.php line 620
at PrettyPageHandler->getResource('css/whoops.base.css')
in PrettyPageHandler.php line 170
at PrettyPageHandler->handle(object(FatalThrowableError))
in Run.php line 272
at Run->handleException(object(FatalThrowableError))
in Handler.php line 339
at Handler->renderExceptionWithWhoops(object(FatalThrowableError))
in Handler.php line 318
at Handler->renderExceptionContent(object(FatalThrowableError))
in Handler.php line 302
at Handler->convertExceptionToResponse(object(FatalThrowableError))
in Handler.php line 281
at Handler->prepareResponse(object(Request), object(FatalThrowableError))
in Handler.php line 188
at Handler->render(object(Request), object(FatalThrowableError))
in Handler.php line 49
at Handler->render(object(Request), object(FatalThrowableError))
in Pipeline.php line 83
at Pipeline->handleException(object(Request), object(FatalThrowableError))
in Pipeline.php line 34
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure))
in Pipeline.php line 151
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in VerifyCsrfToken.php line 75
at VerifyCsrfToken->handle(object(Request), object(Closure))
in Pipeline.php line 151
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
in Pipeline.php line 151
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request))
in StartSession.php line 63

Where in the world did that come from? Any idea what could be going wrong here?

23 Jan
5 months ago

ChrisF79 left a reply on 502 Bad Gateway On Old And Fresh Install Of Homestead

@TRAVIS.ELKINS - 100% the right answer! We still don't know why after reading the bug report but your help was SO valuable. Thank you so much!

Two things: 1.) I did not realize I could put php: "7.2" in my Homestead.yaml file which is awesome to know.

2.) That fixed it.

22 Jan
6 months ago

ChrisF79 left a reply on 502 Bad Gateway On Old And Fresh Install Of Homestead

Just checked my wordpress.test-error.log and find this:

2019/01/23 02:41:01 [error] 20363#20363: *6 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.10.1, server: wordpress.test, request: "GET /wp-admin/setup-config.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "wordpress.test"

Still, not sure how to fix it.

ChrisF79 started a new conversation 502 Bad Gateway On Old And Fresh Install Of Homestead

I followed the 5.7 docs to a T on installing Homestead.

Homestead.yaml

ip: "192.168.10.10"
memory: 1048
cpus: 3
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/code
      to: /home/vagrant/code

sites:
    - map: wordpress.test
      to: /home/vagrant/code/wordpress.test

databases:
    - homestead

** /etc/hosts **

Host Database

localhost is used to configure the loopback interface

when the system is booting. Do not change this entry.

127.0.0.1 localhost 192.168.10.10 wordpress.test

255.255.255.255 broadcasthost ::1 localhost


I can ping wordpress.test just fine and I can SSH into the Vagrant box and go straight to the wordpress.test folder under /home/vagrant/code/wordpress.test

However, when I go into my browser and go to http://wordpress.test I get:

502 Bad Gateway nginx/1.15.6


Wordpress tries to redirect it to:

http://wordpress.test/wp-admin/setup-config.php

since it is a new installation. It just doesn't make sense.


**sites-enabled/wordpress.test/**

server { listen 80; listen 443 ssl http2; server_name .wordpress.test; root "/home/vagrant/code/wordpress.test";

index index.html index.htm index.php;

charset utf-8;



location / {
    try_files $uri $uri/ /index.php?$query_string;

}



location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt  { access_log off; log_not_found off; }

access_log off;
error_log  /var/log/nginx/wordpress.test-error.log error;

sendfile off;

client_max_body_size 100m;

location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;


    fastcgi_intercept_errors off;
    fastcgi_buffer_size 16k;
    fastcgi_buffers 4 16k;
    fastcgi_connect_timeout 300;
    fastcgi_send_timeout 300;
    fastcgi_read_timeout 300;
}

location ~ /\.ht {
    deny all;
}

ssl_certificate     /etc/nginx/ssl/wordpress.test.crt;
ssl_certificate_key /etc/nginx/ssl/wordpress.test.key;

}


The /var/run/php/php7.3-fpm.sock does exist. I have no idea what's wrong.
09 Jan
6 months ago

ChrisF79 left a reply on Layout File In A Subdirectory?

Sorry, why is that? Which is the preferred way?

08 Jan
6 months ago

ChrisF79 started a new conversation Layout File In A Subdirectory?

Hi everyone,

I have posts.layout as my main template for my CMS "in a posts" directory. However, the footer is the same for all site pages and is in the main directory, one directory lower than posts.

In other words I have posts/layout.blade.php and then /footer.blade.php.

How do I yield content from footer from within posts/layout.blade.php?

29 Dec
6 months ago

ChrisF79 left a reply on Need Help With Eloquent One To Many Relationship

THANK YOU! Works! So now printing out posts->postmeta gives me everything I need. Stupid question I suppose yet how would I access the value of say:

[meta_key] => _yoast_wpseo_opengraph-image [meta_value] => http://listingnaplesblog.test/wp-content/uploads/2018/11/1200x630.png



    Illuminate\Database\Eloquent\Collection Object
(
    [items:protected] => Array
        (
            [0] => App\Models\PostMeta Object
                (
                    [connection:protected] => wordpress
                    [table:protected] => wp_postmeta
                    [primaryKey:protected] => id
                    [keyType:protected] => int
                    [incrementing] => 1
                    [with:protected] => Array
                        (
                        )

                    [withCount:protected] => Array
                        (
                        )

                    [perPage:protected] => 15
                    [exists] => 1
                    [wasRecentlyCreated] => 
                    [attributes:protected] => Array
                        (
                            [meta_id] => 811
                            [post_id] => 1
                            [meta_key] => _edit_lock
                            [meta_value] => 1546135843:1
                        )

                    [original:protected] => Array
                        (
                            [meta_id] => 811
                            [post_id] => 1
                            [meta_key] => _edit_lock
                            [meta_value] => 1546135843:1
                        )

                    [changes:protected] => Array
                        (
                        )

                    [casts:protected] => Array
                        (
                        )

                    [dates:protected] => Array
                        (
                        )

                    [dateFormat:protected] => 
                    [appends:protected] => Array
                        (
                        )

                    [dispatchesEvents:protected] => Array
                        (
                        )

                    [observables:protected] => Array
                        (
                        )

                    [relations:protected] => Array
                        (
                        )

                    [touches:protected] => Array
                        (
                        )

                    [timestamps] => 1
                    [hidden:protected] => Array
                        (
                        )

                    [visible:protected] => Array
                        (
                        )

                    [fillable:protected] => Array
                        (
                        )

                    [guarded:protected] => Array
                        (
                            [0] => *
                        )

                )

            [1] => App\Models\PostMeta Object
                (
                    [connection:protected] => wordpress
                    [table:protected] => wp_postmeta
                    [primaryKey:protected] => id
                    [keyType:protected] => int
                    [incrementing] => 1
                    [with:protected] => Array
                        (
                        )

                    [withCount:protected] => Array
                        (
                        )

                    [perPage:protected] => 15
                    [exists] => 1
                    [wasRecentlyCreated] => 
                    [attributes:protected] => Array
                        (
                            [meta_id] => 814
                            [post_id] => 1
                            [meta_key] => _edit_last
                            [meta_value] => 1
                        )

                    [original:protected] => Array
                        (
                            [meta_id] => 814
                            [post_id] => 1
                            [meta_key] => _edit_last
                            [meta_value] => 1
                        )

                    [changes:protected] => Array
                        (
                        )

                    [casts:protected] => Array
                        (
                        )

                    [dates:protected] => Array
                        (
                        )

                    [dateFormat:protected] => 
                    [appends:protected] => Array
                        (
                        )

                    [dispatchesEvents:protected] => Array
                        (
                        )

                    [observables:protected] => Array
                        (
                        )

                    [relations:protected] => Array
                        (
                        )

                    [touches:protected] => Array
                        (
                        )

                    [timestamps] => 1
                    [hidden:protected] => Array
                        (
                        )

                    [visible:protected] => Array
                        (
                        )

                    [fillable:protected] => Array
                        (
                        )

                    [guarded:protected] => Array
                        (
                            [0] => *
                        )

                )

            [2] => App\Models\PostMeta Object
                (
                    [connection:protected] => wordpress
                    [table:protected] => wp_postmeta
                    [primaryKey:protected] => id
                    [keyType:protected] => int
                    [incrementing] => 1
                    [with:protected] => Array
                        (
                        )

                    [withCount:protected] => Array
                        (
                        )

                    [perPage:protected] => 15
                    [exists] => 1
                    [wasRecentlyCreated] => 
                    [attributes:protected] => Array
                        (
                            [meta_id] => 817
                            [post_id] => 1
                            [meta_key] => _yoast_wpseo_opengraph-title
                            [meta_value] => Facebook Title
                        )

                    [original:protected] => Array
                        (
                            [meta_id] => 817
                            [post_id] => 1
                            [meta_key] => _yoast_wpseo_opengraph-title
                            [meta_value] => Facebook Title
                        )

                    [changes:protected] => Array
                        (
                        )

                    [casts:protected] => Array
                        (
                        )

                    [dates:protected] => Array
                        (
                        )

                    [dateFormat:protected] => 
                    [appends:protected] => Array
                        (
                        )

                    [dispatchesEvents:protected] => Array
                        (
                        )

                    [observables:protected] => Array
                        (
                        )

                    [relations:protected] => Array
                        (
                        )

                    [touches:protected] => Array
                        (
                        )

                    [timestamps] => 1
                    [hidden:protected] => Array
                        (
                        )

                    [visible:protected] => Array
                        (
                        )

                    [fillable:protected] => Array
                        (
                        )

                    [guarded:protected] => Array
                        (
                            [0] => *
                        )

                )

            [3] => App\Models\PostMeta Object
                (
                    [connection:protected] => wordpress
                    [table:protected] => wp_postmeta
                    [primaryKey:protected] => id
                    [keyType:protected] => int
                    [incrementing] => 1
                    [with:protected] => Array
                        (
                        )

                    [withCount:protected] => Array
                        (
                        )

                    [perPage:protected] => 15
                    [exists] => 1
                    [wasRecentlyCreated] => 
                    [attributes:protected] => Array
                        (
                            [meta_id] => 818
                            [post_id] => 1
                            [meta_key] => _yoast_wpseo_opengraph-description
                            [meta_value] => Facebook Description
                        )

                    [original:protected] => Array
                        (
                            [meta_id] => 818
                            [post_id] => 1
                            [meta_key] => _yoast_wpseo_opengraph-description
                            [meta_value] => Facebook Description
                        )

                    [changes:protected] => Array
                        (
                        )

                    [casts:protected] => Array
                        (
                        )

                    [dates:protected] => Array
                        (
                        )

                    [dateFormat:protected] => 
                    [appends:protected] => Array
                        (
                        )

                    [dispatchesEvents:protected] => Array
                        (
                        )

                    [observables:protected] => Array
                        (
                        )

                    [relations:protected] => Array
                        (
                        )

                    [touches:protected] => Array
                        (
                        )

                    [timestamps] => 1
                    [hidden:protected] => Array
                        (
                        )

                    [visible:protected] => Array
                        (
                        )

                    [fillable:protected] => Array
                        (
                        )

                    [guarded:protected] => Array
                        (
                            [0] => *
                        )

                )

            [4] => App\Models\PostMeta Object
                (
                    [connection:protected] => wordpress
                    [table:protected] => wp_postmeta
                    [primaryKey:protected] => id
                    [keyType:protected] => int
                    [incrementing] => 1
                    [with:protected] => Array
                        (
                        )

                    [withCount:protected] => Array
                        (
                        )

                    [perPage:protected] => 15
                    [exists] => 1
                    [wasRecentlyCreated] => 
                    [attributes:protected] => Array
                        (
                            [meta_id] => 819
                            [post_id] => 1
                            [meta_key] => _yoast_wpseo_opengraph-image
                            [meta_value] => http://listingnaplesblog.test/wp-content/uploads/2018/11/1200x630.png
                        )

                    [original:protected] => Array
                        (
                            [meta_id] => 819
                            [post_id] => 1
                            [meta_key] => _yoast_wpseo_opengraph-image
                            [meta_value] => http://listingnaplesblog.test/wp-content/uploads/2018/11/1200x630.png
                        )

                    [changes:protected] => Array
                        (
                        )

                    [casts:protected] => Array
                        (
                        )

                    [dates:protected] => Array
                        (
                        )

                    [dateFormat:protected] => 
                    [appends:protected] => Array
                        (
                        )

                    [dispatchesEvents:protected] => Array
                        (
                        )

                    [observables:protected] => Array
                        (
                        )

                    [relations:protected] => Array
                        (
                        )

                    [touches:protected] => Array
                        (
                        )

                    [timestamps] => 1
                    [hidden:protected] => Array
                        (
                        )

                    [visible:protected] => Array
                        (
                        )

                    [fillable:protected] => Array
                        (
                        )

                    [guarded:protected] => Array
                        (
                            [0] => *
                        )

                )

            [5] => App\Models\PostMeta Object
                (
                    [connection:protected] => wordpress
                    [table:protected] => wp_postmeta
                    [primaryKey:protected] => id
                    [keyType:protected] => int
                    [incrementing] => 1
                    [with:protected] => Array
                        (
                        )

                    [withCount:protected] => Array
                        (
                        )

                    [perPage:protected] => 15
                    [exists] => 1
                    [wasRecentlyCreated] => 
                    [attributes:protected] => Array
                        (
                            [meta_id] => 820
                            [post_id] => 1
                            [meta_key] => _yoast_wpseo_opengraph-image-id
                            [meta_value] => 1705
                        )

                    [original:protected] => Array
                        (
                            [meta_id] => 820
                            [post_id] => 1
                            [meta_key] => _yoast_wpseo_opengraph-image-id
                            [meta_value] => 1705
                        )

                    [changes:protected] => Array
                        (
                        )

                    [casts:protected] => Array
                        (
                        )

                    [dates:protected] => Array
                        (
                        )

                    [dateFormat:protected] => 
                    [appends:protected] => Array
                        (
                        )

                    [dispatchesEvents:protected] => Array
                        (
                        )

                    [observables:protected] => Array
                        (
                        )

                    [relations:protected] => Array
                        (
                        )

                    [touches:protected] => Array
                        (
                        )

                    [timestamps] => 1
                    [hidden:protected] => Array
                        (
                        )

                    [visible:protected] => Array
                        (
                        )

                    [fillable:protected] => Array
                        (
                        )

                    [guarded:protected] => Array
                        (
                            [0] => *
                        )

                )

            [6] => App\Models\PostMeta Object
                (
                    [connection:protected] => wordpress
                    [table:protected] => wp_postmeta
                    [primaryKey:protected] => id
                    [keyType:protected] => int
                    [incrementing] => 1
                    [with:protected] => Array
                        (
                        )

                    [withCount:protected] => Array
                        (
                        )

                    [perPage:protected] => 15
                    [exists] => 1
                    [wasRecentlyCreated] => 
                    [attributes:protected] => Array
                        (
                            [meta_id] => 821
                            [post_id] => 1
                            [meta_key] => _yoast_wpseo_content_score
                            [meta_value] => 90
                        )

                    [original:protected] => Array
                        (
                            [meta_id] => 821
                            [post_id] => 1
                            [meta_key] => _yoast_wpseo_content_score
                            [meta_value] => 90
                        )

                    [changes:protected] => Array
                        (
                        )

                    [casts:protected] => Array
                        (
                        )

                    [dates:protected] => Array
                        (
                        )

                    [dateFormat:protected] => 
                    [appends:protected] => Array
                        (
                        )

                    [dispatchesEvents:protected] => Array
                        (
                        )

                    [observables:protected] => Array
                        (
                        )

                    [relations:protected] => Array
                        (
                        )

                    [touches:protected] => Array
                        (
                        )

                    [timestamps] => 1
                    [hidden:protected] => Array
                        (
                        )

                    [visible:protected] => Array
                        (
                        )

                    [fillable:protected] => Array
                        (
                        )

                    [guarded:protected] => Array
                        (
                            [0] => *
                        )

                )

            [7] => App\Models\PostMeta Object
                (
                    [connection:protected] => wordpress
                    [table:protected] => wp_postmeta
                    [primaryKey:protected] => id
                    [keyType:protected] => int
                    [incrementing] => 1
                    [with:protected] => Array
                        (
                        )

                    [withCount:protected] => Array
                        (
                        )

                    [perPage:protected] => 15
                    [exists] => 1
                    [wasRecentlyCreated] => 
                    [attributes:protected] => Array
                        (
                            [meta_id] => 822
                            [post_id] => 1
                            [meta_key] => _yoast_wpseo_primary_category
                            [meta_value] => 
                        )

                    [original:protected] => Array
                        (
                            [meta_id] => 822
                            [post_id] => 1
                            [meta_key] => _yoast_wpseo_primary_category
                            [meta_value] => 
                        )

                    [changes:protected] => Array
                        (
                        )

                    [casts:protected] => Array
                        (
                        )

                    [dates:protected] => Array
                        (
                        )

                    [dateFormat:protected] => 
                    [appends:protected] => Array
                        (
                        )

                    [dispatchesEvents:protected] => Array
                        (
                        )

                    [observables:protected] => Array
                        (
                        )

                    [relations:protected] => Array
                        (
                        )

                    [touches:protected] => Array
                        (
                        )

                    [timestamps] => 1
                    [hidden:protected] => Array
                        (
                        )

                    [visible:protected] => Array
                        (
                        )

                    [fillable:protected] => Array
                        (
                        )

                    [guarded:protected] => Array
                        (
                            [0] => *
                        )

                )

        )

)


ChrisF79 left a reply on Need Help With Eloquent One To Many Relationship

@TALINON - I gave that a shot and got:

Illuminate \ Database \ Eloquent \ RelationNotFoundException
Call to undefined relationship [postmeta] on model [App\Models\Post].

ChrisF79 started a new conversation Need Help With Eloquent One To Many Relationship

I'm trying to pull from a separate wordpress database (and it is working). However, I have a page that is just doing a var_dump of a post and that works because it is pulling from the wp_posts table wtih this model:

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Post extends Model
{
    protected $connection = 'wordpress';
    protected $table = 'wp_posts';

    public function meta()
    {
        return $this->hasMany('PostMeta', 'post_id', 'ID');
    }
    
}

I want to pull the wp_postmeta data that shoudl go with the post.

wp_post has key of ID. wp_postmeta has key of post_id.

I have for the PostMeta model:

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class PostMeta extends Model
{
    protected $connection = 'wordpress';
    protected $table = 'wp_postmeta';

    public function post()
    {
        return $this->belongsTo('Post', 'ID', 'post_id');
    }
}

Then the controller simply does:

    public function index()
    {
        $posts = Post::first();
        return view('posts.index', compact('posts'));
    }

View:

    <?php print_r ($posts); ?>

That's just so I can test.

*My question is: * Why isn't it pulling in the wp_postmeta fields automatically? Do I have something reversed?

ChrisF79 left a reply on Two Database Connections Defined But Not Working

And for what it's worth, THANK YOU. I rarely see enough gratitude here. You guys took so much time out to try and help (let's face it) an idiot like me.

Thank you, @shez1983 @realrandyallen @radu

ChrisF79 left a reply on Two Database Connections Defined But Not Working

SOLVED!

I had an old PostController.php so I renamed it... PostController.php.bak and created this one. WEll, it was STILL loading that one first! To me, that seems like a bug.

ChrisF79 left a reply on Two Database Connections Defined But Not Working

@REALRANDYALLEN - <?php

/* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */

Route::get('/', function () { return view('welcome'); }); Route::get('/inspiration', function () { return view('inspiration'); });

// Route::get('/posts', '[email protected]'); // Route::get('/posts/{id}/', '[email protected]'); Route::get('/test', '[email protected]'); Route::get('/test/chris', '[email protected]');