carlcondos

carlcondos

Member Since 3 Years Ago

Experience Points 17,780
Experience Level 4

2,220 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 174
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.

11 Sep
4 days ago

carlcondos left a reply on Refresh A Model?

$model->setRelations([]); worked for me too :)

05 Jun
1 year ago

carlcondos left a reply on Best Way To Dynamically Load Partial Blade.

Hi @SangminKim, I wonder if you found a nice solution to this?

26 Jun
2 years ago

carlcondos started a new conversation JWT::getToken() Doesn't Get The Proper Token

I have created a middleware that checks if token is expired and then it refreshes the token and update the header. But in my controller getToken() does not get the new token but returns the expired one.

This is how I do it in my middleware: $new_token = JWTAuth::refresh($token); $request->headers->set('Authorization', 'Bearer '.$new_token); $response = $next($request);

and this is in my controller: $token = JWTAuth::getToken();

14 Feb
2 years ago

carlcondos started a new conversation Overwriting The Laravel Base Migration Stubs

We're currently using Laravel 5.2 for a project and I wanted to update the base migration stubs so that it uses transactions in every up and down, so that if there is a failure, it doesn't mean you have to do a refresh/drop or manually roll back the changes that it just tried to make. I would like it so that every time someone creates a new migration with make:migration, it does this automatically and is transparent to the developer, I don't want them to have to run another command to create the migrations, or edit the migration after, so it extends from a new class or adds a trait or something.

Since the stubs directory isn't a config entry, I was thinking that it might be possible to create another package that simply copies stubs from it's package into the stubs directory.

Or is it possible to overwrite the migration:make command with a new command that does exactly the same thing, but just has a different stub directory?

Is this bad practice or just a bad idea?

edit I just figured out that I can't put table structure changes into a transaction. However, I was still wondering if this is possible.

13 Dec
2 years ago

carlcondos started a new conversation Rollback Package Migrations

So I created a package that includes migrations. I created a command that installs the migrations, another that seeds, etc.

My code for running my package migrations looks like the following:

        $migrations = $this->app->make('migration.repository');
        if (!$migrations->repositoryExists()) {
            $migrations->createRepository();
        }
        $migrator = $this->app->make('migrator');
        $migrator->run($this->migrationPath);

This works fairly well, but when trying to roll back migrations, there doesn't seem to be a way to roll back from a specific path only.

        $migrator = $this->app->make('migrator');
        $migrationFiles = $migrator->getMigrationFiles($this->migrationPath);
        $migrator->requireFiles($this->migrationPath, $migrationFiles );
        $migrator->reset();

This will successfully rock back the migrations from the package, but it also rolls back every other migration too from the core laravel installation.

Is there a way to only roll back the package migrations?

19 Aug
3 years ago

carlcondos started a new conversation How To Include Schema Builder In A Controller?

Hi Guys I have the following code,

namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class SampleController extends Controller
{
    public function index()
    {       
        //Use Schema builder here
        $columns = Schema::getColumnListing('users');
    }
}

I get a Class 'App\Http\Controllers\Schema' not found error when running it. I understands that the the default namespace is App\Http\Controllers for controller so thats why it looks for the class in that folder. So then how do I properly include the laravel Schema Builder?

As you can see I've tried

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

Like a migration file does but its no use.

Any help would be greatly appreciated!

Thanks

15 Aug
3 years ago

carlcondos left a reply on Validation Failure Dumps Error To Blank Page

It turns out its caused by custom modifications in \App\Exceptions\Handler.php done by one of our team member. Rather than returning parent::render($request ,$e), the render function was modified to return the json errors directly.

Good to have this sorted out.

carlcondos left a reply on Validation Failure Dumps Error To Blank Page

@ SaeedPrez No, just normal navigations....

12 Aug
3 years ago

carlcondos started a new conversation Validation Failure Dumps Error To Blank Page

Hi Guys,

The "Out of the box" registration used to work fine for my project initially, when the validation fails the error object were correctly sent to the view, and shown in the form like here: http://imgur.com/8iG3KKO.

However today I've noticed that this is no longer the case, a validation failure now does this instead: http://imgur.com/uDgU8vu

  • It no longer redirects back to the register page with errors in but rather dumps an error on a blank page, however if i press "back" from that page I go back to the register page with the errors correctly shown like in the first image.

Also a related problem is that the custom error pages I've created, for example /resources/views/errors/403.blade.php no longer works. Now when I go to a page that responses a 403 error, rather than seeing my custom 403.blade.php page, it now also dumps the errors instead like here: http://imgur.com/8HA5zwa. It seems like all the errors no matter what the code is results in a dump.

Note that me and my teammates have been working on this project , i.e adding models, routes etc. so maybe something we did has caused this.

Any help on identifying & resolving this error dump problem would be greatly appreciated!

Thanks

13 Jul
3 years ago

carlcondos left a reply on Setting Cache_driver To Memcached Causing Apache Errors

@ohffs Can confirm, I've just tested adding a storing a simple text in memcached in PHP7 and its doing the same thing, so it is memcached with php 7 that is causing the problem. Switched to Redis and problem is no more!

Thanks guys!

carlcondos left a reply on Setting Cache_driver To Memcached Causing Apache Errors

UPDATE: Seems like this only happens in PHP7, tried in 5.6 and it works fine.

carlcondos left a reply on Setting Cache_driver To Memcached Causing Apache Errors

It is loaded of course, its also listed under phpinfo(). Server is apache in MAMP.

12 Jul
3 years ago

carlcondos left a reply on Setting Cache_driver To Memcached Causing Apache Errors

Yes, memcached is working fine for my other web app that is also running in MAMP.

carlcondos started a new conversation Setting Cache_driver To Memcached Causing Apache Errors

Hi,

I am experiencing an issue with memcached causing auth/apache errors in MAMP. Here are the steps I took to create the problem:

  • created a new laravel project, ran composer install, setup database info and everything else.
  • used php artisan make:auth to generate basic auth template
  • went to home page, registered a user, everything worked fine, user is logged in after registration
  • I could successfully logout, and login the user at this point

Then I changed cache_driver = memcached (from file) in .env file, I have ensured that memcached is installed properly as a php extension, so not getting any 'Could not load class Memcached' php errors.

I try to login the user again, after pressing the Login button I get the follow error from Chrome

The local.laravel page isn’t working local.laravel didn’t send any data. ERR_EMPTY_RESPONSE

And a "The connection was reset" error from Firefox

And the user does not get logged in. No errors were printed to laravel.log, no PHP errors from MAMP either.

However in the apache error log from MAMP prints the following: [Tue Jul 12 19:27:23 2016] [notice] child pid 22365 exit signal Illegal instruction (4) [Tue Jul 12 19:27:23 2016] [notice] child pid 22336 exit signal Illegal instruction (4)

If I change cache_driver back to file, the login would work again.

I am not sure if the problem occurs for a stand alone apache or its only with MAMP.

Any help for debugging this issue would be greatly appreciated!

UPDATE: Seems like this only happens in PHP7, tried in 5.6 and it works fine.