Software Engineer at ReminderMedia

Member Since 3 Years Ago

West Norriton, PA

Experience Points

3,520 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
Best Reply Awards
Best Reply
  • 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.


    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.


    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

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

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 5
21,480 XP
06 Nov
1 year ago

trcraig started a new conversation CQRS/ES Examples?

I've been working with Laravel for over a year now and have been reading up on Event Sourcing and CQRS. I have had a rough go at finding full examples showing read models and projections.

I'm wondering if anyone here has implemented either concept, and if you're willing to share examples or at least experience about it?

For me, the company I work for has some serious business logic around a lot of what we do. It feels like we would benefit from implementing these techs, but I don't know how to do it well enough to be comfortable with suggesting it.

I have looked at tutorials written in C#? from, other repos that are extremely barebones with barely any real example of read models.. I have looked at prooph and broadway.. but it is just not clicking yet.

24 Mar
2 years ago

trcraig left a reply on Understanding The Move And The StoreAs Methods For Saving/uploading Files To The Filesystem

I haven't done this, but I believe you can do something such as:

Route::post('routeName', function($request) {
    $file = $request->file('fieldName');

See: \Illuminate\Http\UploadedFile::storePublicly()

trcraig left a reply on Understanding The Move And The StoreAs Methods For Saving/uploading Files To The Filesystem

@fsdolphin A lot of stuff has changed since 2013 and even 2015 (when the videos were made).

If you're using 5.3, you may want to check out this video:

trcraig left a reply on Laravel Paginator Object Does Not Have Render Method

Not sure if this matters but you're using the same variable name in your example for the source data as well as what you're calling the paginator object.

trcraig left a reply on Does GET Data Have Higher Priority Than POST Data In Laravel 5.4?

IT appears you're saying that your form will POST data to a url such as /myform?get_var_1=value.

I don't recommend doing this. It doesn't really make sense to do this.

If you need the form to direct to different locations based on variables, write your route like this: /myform/value, and have your web.php/api.php route account for that, such as :

Route::post('/myform/{get_var_1}', '[email protected]');

trcraig left a reply on Understanding The Move And The StoreAs Methods For Saving/uploading Files To The Filesystem

store() stores a file with a hash of the file name vs storeAs() allows you to control the file name. Both are on the UploadedFile object (which lives in your /tmp folder or wherever PHP tells temporary files to live). Using these methods takes a file from its temporary location and stores it in your App's "storage" system of choice (by default, the storage/app folder)

move() is for existing files within your Storage system to move from wherever it is now to wherever you want it, preserving the file name.

So, use storeAs() or store() when you are working with a file that has been uploaded (i.e. within a controller), and move() only when you've already got a file in the system to move it from one location to another.

I hope this helps. (Sorry for the man updates, trying to make it clear as possible)

23 Mar
2 years ago

trcraig left a reply on Queue Worker Daemon - Memory Leak

I am experiencing this problem to. I am running php 7.1.2 on ubuntu 16.04 and centos (CentOS Linux release 7.3.1611 (Core)) systems and I see a drastic difference between what top/htop/ps -aux all report vs what php's own memory_get_usage() reports (way less).

Thus, my system runs out of memory while the processes themselves think they're well under the 128MB limit. I am not sure if this is a php internals issue or what.

I will say my current work around is a scheduled hourly soft restart with this in Console/Kernel.php:

        // Used to combat memory creep issues that I can't solve otherwise at this moment.

trcraig left a reply on Queue Worker Daemon - Memory Leak

I am experiencing the same thing. One thing I noticed is htop/top/ps -aux all report much higher memory usage than php's memory_get_usage(true).

I've asked my own question in general since this appears to be more of a general question than a laravel specific question.

trcraig started a new conversation Memory Usage Vs Htop

I am seeing my worker processes grow incrementally, according to htop, to using more than 6% of hardware memory (16GB in this case). I have not altered the memory argument for the workers, so I believe that if a process goes over 128 MB (the default), it should die and restart. That does not appear to be the case.

Furthermore, my own tests to compare what htop reports in MEM% vs what PHP reports with memory_get_usage(true), PHP appears to severely under-report compared to what HTOP does.

Does anyone have experience on this to help me understand the discrepencies?

17 Feb
2 years ago

trcraig left a reply on Queued Events On Separate Queue

@tristanbailey In my experience, you're not queuing the EVENT, but the LISTENER(s). I was working to have a dedicated queue for messages in case something broke.

To make this work (5.3), I set up the LISTENER to queue, and added the below method. This forces the "job" or Handler to queue itself onto the desired queue.

class RestartAccountQueue implements ShouldQueue
    use InteractsWithQueue, Queueable;

     * In order to get this listener to queue on a specific queue, apparently, you have to override the default
     * queuing mechanism.  This is a rip from \Illuminate\Events\Dispatcher::createQueuedHandlerCallable():416-418
     * @param QueueManager $class
     * @param string $method
     * @param array $arguments
    public function queue(QueueManager $class, $method, $arguments)
        $queue = env('RABBITMQ_EMERGENCY_QUEUE', 'emergency');

        $class->push('Illuminate\Events\[email protected]', $arguments, $queue);

Then I have a worker which is listening on that emergency queue.

$ php artisan queue:work rabbitmq --queue=emergency

But just keep in mind the important distinction above... In Laravel, you're not queuing the Event, you're queuing the LISTENER!