jay_singulara_tech

jay_singulara_tech

Member Since 4 Months Ago

Experience Points 3,890
Experience Level 1

1,110 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 34
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.

16 May
1 month ago

jay_singulara_tech left a reply on Error In Unit Test When Using SetUp() Function

I found it. Hope this helps someone else. This works. public function setUp() :void {

The code in the lesson was wrong or outdated, I guess. This fails. public function setUp() {

15 May
1 month ago

jay_singulara_tech left a reply on Error In Unit Test When Using SetUp() Function

Here is the code


<?php

namespace Tests\Unit;

use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use App\User;

class UserTest extends TestCase
{
    use DatabaseTransactions;

    protected $user;
    
    public function setUp() {
        parent::setUp();
        $this->user = factory(User::class)->state('enabled')->create();
    }
    
    /**
     * @test
     * @return void
     */
    public function it_can_be_enabled()
    {
        $value = $this->user->enabled()->pluck('is_enabled')->first();
        $this->assertEquals(1, $value);
    }
}

The test itself was passing before adding the setup function. Any help will be appreciated as, I am stuck on the lesson, for now. Thanks in advance.

jay_singulara_tech started a new conversation Error In Unit Test When Using SetUp() Function

Getting an error after I add the setUp() function. Also, PHPStorm puts a red underline below the setUp() function name. The code looks to me, exactly like in the lesson but... I get this error from PHPUnit

Fatal error: Declaration of Tests\Unit\UserTest::setUp() must be compatible with Illuminate\Foundation\Testing\TestCase::setUp(): void in C:\Projects\MyProject\tests\Unit\UserTest.php on line 15

14 May
1 month ago

jay_singulara_tech left a reply on Where Are You All From?

Yup. Vegas Baby! Me too.

07 May
1 month ago

jay_singulara_tech left a reply on Trouble With 2 Connections In Migration

Actually, the intention is multiple user DBs with one config DB. Right now, this is just a minor inconvenience, 2 steps instead of one to reset the DEV environment. I just thought that someone else may have encountered the issue before. Looking at this as a possible option. https://github.com/codengine/laravel-custom-migrations When I figure it out, I will post, in case it helps someone else. Thanks

jay_singulara_tech left a reply on Trouble With 2 Connections In Migration

Hi, thanks for helping. php artisan migrate:fresh fails on the first table which happens to have been moved to the new DB with "already exists" error. unless I run php artisan migrate:reset first. The down function no longer seems to be running in the migrations since the table was moved to the new connection.

jay_singulara_tech started a new conversation Trouble With 2 Connections In Migration

Trying to use 2 mysql connections, 1 for config data, the other for client data. My migrations create all tables fine, and in the correct DB but only if they don't already exist so, I have to manually drop them using mysql right now before I can re-run "php artisan migrate:fresh: or I get a "table already exists" error. Seeds and everything else works OK, it just wont drop the tables that were moved to the new DB.

I'm using this in my migrations up/down functions Schema::connection('mysql_config')->create('system_settings', function (Blueprint $table) Schema::connection('mysql_config')->dropIfExists('system_settings'); I've added this to my models, for the new config DB protected $connection = 'mysql_config';

My database.php file has a separate section for mysql_config as does my .env file.

Does anyone know what I did wrong? Happy to share more code if needed. Thanks in advance.

24 Apr
2 months ago

jay_singulara_tech left a reply on Moving The User Model File

Thanks, had the plugin but not the ide helper. I started out with barryvdh/laravel-ide-helper was giving me an annoying problem where it found duplicates of DB:: class and when I researched that, it appeard that nothing was being done about that issue for some time so I removed ide-helper but maybe I will put it back in the mix and put up with the one issue.

jay_singulara_tech left a reply on Moving The User Model File

PHPStorm missed a few references in refactor but a find & replace fixed that.

Thanks again

jay_singulara_tech left a reply on Moving The User Model File

I am using PHPStorm and was doing exactly that. Thanks

jay_singulara_tech left a reply on Moving The User Model File

Ah, I didn't think about config/auth.php! Giving that a go, Thanks

jay_singulara_tech started a new conversation Moving The User Model File

What is required to move the default User model to another directory without breaking the features provided by make:auth? I'm using nwidart/laravel-modules and wanted to have the User model under a module named Admin.

06 Apr
2 months ago

jay_singulara_tech left a reply on Event Fires But Doesn't Execute Methods Like $user->save()

Glad to. Now on to learning a bit about Observers. Thanks again.

jay_singulara_tech left a reply on Event Fires But Doesn't Execute Methods Like $user->save()

That was it! I forgot to set the user_id column from $event->user-id. Problem solved. thanks

jay_singulara_tech left a reply on Event Fires But Doesn't Execute Methods Like $user->save()

Sorry if that is not visible. I pasted code in a reply but I don't see it here?

jay_singulara_tech started a new conversation Event Fires But Doesn't Execute Methods Like $user->save()

I'm new to Laravel and don't have a lot of PHP so, probably I just missed something... I have a Model Event setup on App\User to automatically create a related DB record (App\Account) when a new user is created by a specific controller method. It will run $account = new Account() and set the attributes like $account->name, etc. & dd($account) dumps what I want in the database but the handler method in my Listener ignores the line with $account->save() so no account record is saved. Wondering why ->save() does nothing when called in the handler of a listener? Thanks