ChrisF79

ChrisF79

Member Since 4 Years Ago

Naples, FL

Experience Points 7,440
Experience Level 2

2,560 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 101
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

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

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

03 May
2 weeks 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
1 month 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
1 month 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
1 month 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
3 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
3 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
4 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
4 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
4 months ago

ChrisF79 left a reply on Layout File In A Subdirectory?

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

08 Jan
4 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
4 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]');

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

This whole thing is messed up.

Route::get('/test/chris', '[email protected]');

That in the route followed by this in the controller STILL tries to load the view!!!

    public function chris()
    {
        echo "hello";
        die();
    }

I am clearing the cache by running:

 Route cache cleared!
 Configuration cache cleared!
 Application cache cleared!
 Compiled views cleared!
 Compiled views cleared!
Application cache cleared!
Route cache cleared!
Configuration cache cleared!
Compiled services and packages files removed!
Caches cleared successfully!

Screenshot of what this is doing

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

@RADUCRUCEANA - I shoudl have cleared that up. That was cut/pasting the wrong stuff and it's all fixed. I'm concerned about the DD now working. I don't think Post::all() is getting anything.

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

Exactly. This is http://listingnaples.test/test/ on my machine.

Is there something about the Laravel framework that tells it that the @index portion of the controller always loads the index view no matter what?

Screenshot of stack trace

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

@SHEZ1983 - You aren't going to believe this. I've cleared (what I think is all cache) and yet the below code tries to load the view in the controller. Something is really odd here.

    public function index()
    {
        $query = Post::all();
        dd($query->toSql(), $query->getBindings());
        $posts = Post::all();
        //  return view('posts.index', compact('posts'));
    }

Could it have anything to do with me using resourceful routing?

28 Dec
4 months ago

ChrisF79 started a new conversation Two Database Connections Defined But Not Working

I have two databases defined so I can have a Wordpress GUI to use as a CMS yet build the output using Laravel over my app.

Anyway, my .env looks like this:

        'mysql' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'strict' => true,
            'engine' => null,
        ],
      
        'wordpress' => [ // for WordPress database (used by Corcel)
            'driver'    => 'mysql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('WP_DB_DATABASE', 'forge'),
            'username' => env('WP_DB_USERNAME', 'forge'),
            'password' => env('WP_DB_PASSWORD', ''),
            'prefix'    => 'wp_',
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'strict'    => true,
            'engine'    => null,
      ],

My Route shows:

Route::get('/test', '[email protected]');

My Controller PostController looks like this:

class PostController extends Controller
{
    public function index()
    {
        $posts = Post::all();

        return view('posts.index', compact('posts'));
    }

My Model Post.php looks like this:

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

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

My view looks like this:

    @foreach ($posts as $post);
            <h1>{{ $posts->post_title }}</h1>
    @endforeach;

Yet, I open the view and this is what I see:

ErrorException (E_ERROR)
Undefined variable: posts (View: /home/vagrant/code/listingnaples.test/resources/views/posts/index.blade.php)

I hate asking yet I've stared at this so long without solving it on my own. What am I doing wrong? It seems like it has to be something simple.

27 Dec
4 months ago

ChrisF79 left a reply on Best Way To Use Wordpress With A Laravel App?

That's just it. I'm really hoping that I can do this without having to reinvent the wheel since there are so many amazing plugins out there.

ChrisF79 left a reply on Best Way To Use Wordpress With A Laravel App?

I've read that Laravel News article (and its sister article there) a number of times and there's a couple issues. First, it's a bit older. Second, I don't think even he does what he outlines any longer. I'm fairly certain Eric Barnes changed his setup but left that article up. Finally, notice he doesn't have comments. For what I'm doing, the comments are absolutely crucial.

I am SHOCKED something doesn't exist with two powerful platforms that are so common now on the web. Perhaps this is simply my opportunity to create my own Wordpress integration for Laravel with support for popular plugins. Open source it and hope that others will also add to the support.

26 Dec
4 months ago

ChrisF79 started a new conversation Best Way To Use Wordpress With A Laravel App?

Hi everyone,

I have a Laravel app but like most app websites, I need to have a /blog/ so I can write about it regularly. The biggest problem is that I want to use Wordpress and get the benefits of things like Yoast SEO, the comments, plugins, etc. yet there doesn't seem to be a good way to integrate Wordpress and Laravel.

Corcel seemed like the best option until I went to implement it and found out it didn't have comments not did it pull Yoast SEO features out of that table.

For those of you that do have a Wordpress blog running on top of your app, how are you pulling it off? I am dying for help here!

Thanks!

16 Dec
5 months ago

ChrisF79 left a reply on Telescope Not Showing Jobs That Are Queued

For what it's worth, I think it's because there are 120k in SQS. It won't show on Local now either suprisingly.

ChrisF79 left a reply on Telescope Not Showing Jobs That Are Queued

I've done both of these suggestions now yet I'm still seeing this when I try to visit my telescope jobs on production:

https://www.dropbox.com/s/b4fnn3md1rjmfx4/Screenshot%202018-12-16%2011.49.11.png?dl=0

ChrisF79 started a new conversation Telescope Not Showing Jobs That Are Queued

I installed Telescope on my dev environment AND production. It's just and running in both. However, I cannot see the jobs (it just is empty) on the production server. Both are using Amazon SQS and there are 66,000 jobs queued. However, I'd still think it would show the first page of them to watch. No?

29 Nov
5 months ago

ChrisF79 left a reply on How Do I Create A Subdomain In Homestead That Points To A Different Directory?

Wow, it's too late. I needed some sleep I could see. Thanks!

28 Nov
5 months ago

ChrisF79 started a new conversation How Do I Create A Subdomain In Homestead That Points To A Different Directory?

Hi friends,

In my code folder I have a site called mysite.test and a site called mysiteblog.test. Both load fine in the browser using Homestead (for local testing).

What I want though is for the blog to actually be blog.mysite.test. The part that has me so confused is that these two start off in a different root.

Is there a way to do this in Homestead?

ChrisF79 left a reply on How Can I Have A Site Point To Another Directory In Homestead?

@PETRIT - Thanks @petrit but I need mysite.test and mysite.test/blog/ so it will mirror what is on the server.

ChrisF79 started a new conversation How Can I Have A Site Point To Another Directory In Homestead?

I want to have

mysite.com/

mysite.com/blog/

On the server I want to have:

/home/vagrant/code/mysite.com/

/home/vagrant/code/blog/

Since it is Wordpress, I want to install it completely separately but I have to be able to develop locally using Homestead. I had a devops guy from UpWork familiar with nginx work on this for over 4 hours last night and couldn't get it! PLEASE! You're my only hope :)

27 Nov
5 months ago

ChrisF79 left a reply on Anybody Run Laravel And Wordpress In Two Different Root Locations With Nginix?

Thank you! The last part is the key and exactly what I think is happening. To get around that, I guess something would have to be in the block for the blog site, correct?

26 Nov
5 months ago

ChrisF79 started a new conversation Anybody Run Laravel And Wordpress In Two Different Root Locations With Nginix?

I do not want to mix Laravel and Wordpress so on my laptop I have something like:

Sites/listingnaples.dev
Sites/blog.listingnaples.dev

(I know it looks like a subdomain but it is just a bad name I picked)

This should be so simple yet I bet I've spent 8 hours so far on it. All I want to do is have it so if you go to http://listingnaples.dev/blog (wordpress in directory) it works in Homestead so I can test and work on the site locally.

I can get it to load the Laravel app. I can get it to load the blog at the root directory. I can't get it to load the blog at listingnaples.dev/blog/.

I don't want to install Wordpress in /public/ within the Laravel app so that isn't an option. How can I configure nginx within Homestead to do this?

25 Nov
5 months ago

ChrisF79 started a new conversation Error With Homestead Nginx Custom Config File

Hi there,

I am trying to run a Wordpress site and Laravel together but I've installed wordpress properly on my development machine in a directory called blog.listingnaples.com. I created a custom nginx config for the main listingnaples.test and it looks like this:

#!/usr/bin/env bash
declare -A params=     # Create an associative array
paramsTXT=""
if [ -n "" ]; then
   for element in "${!params[@]}"
   do
      paramsTXT="${paramsTXT}
      fastcgi_param ${element} ${params[$element]};"
   done
fi

block="server {
        listen   80;
        server_name listingnaples.test;
        access_log off;
        error_log  /var/log/nginx/listingnaples.test-error.log error;

        location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php/php7.1-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 ~* ^((?!\/blog)(.+)\.php)$  {
                include /etc/nginx/fastcgi_params;
               fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }

    location /blog/ {
        access_log off;
        proxy_pass http://blog.listingnaples.test;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}
"

echo "$block" > "/etc/nginx/sites-available/"
ln -fs "/etc/nginx/sites-available/" "/etc/nginx/sites-enabled/"

However, that will not load my site on my dev machine at listingnaples.test. It won't load anything in fact as if the site doesn't exist.

The location /blog/ section is the redirect to the local blog portion.

Do you spot anything out of the ordinary that I have messed up here?

THANK YOU