broefs

broefs

Member Since 3 Years Ago

Pretoria

Systems architect and senior developer at Pretoria

Experience Points 27,120
Experience Level 6

2,880 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 308
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.

18 Mar
4 months ago

broefs left a reply on Spark Stripe : Howto Per Quantity

Tried. Getting 404 on best answer ;) Will try again tomorrow.

broefs left a reply on Spark Stripe : Howto Per Quantity

Seems spot on! Thank you.

12 Mar
4 months ago

broefs started a new conversation Spark Stripe : Howto Per Quantity

I need some advice, please:

I sell searches in a database. Each search instruction is limited to a category, to a subcategory, and to a time frame. The search is executed every five minutes. When a new result is encountered the client receives a notification of the new result.

A user can subscribe to a plan either monthly or yearly (see Stripe supports quarterly as well but Spark does not). The standard plan gives the user one search. You guessed it, I would like to offer to run multiple searches per user. Should I create a separate plan for up to 5 searches, en then another one for unlimited?

I see in Stripe 'Does this pricing plan have multiple price tiers based on quantity?' (I presume this is how team per seat subscriptions work.) This would mean I could perhaps only have one plan in Stripe with variable per search pricing. Does Spark support this? How would I do my checks on my Search model to determine how many concurrent searches the user has access to?

09 Nov
8 months ago

broefs left a reply on Local Disk On S3

Even setting FILESYSTEM_DRIVER=s3does not seem to make any difference. My laravel log file on local disk still get used. I tried config:clear and config:cache, no sigar.???

broefs started a new conversation Local Disk On S3

In a load balanced setup I'm trying to share my storage path on S3. I thought I simply could configure as follows:

        'local' => [
            'driver' => 's3',
            'region' => env('AWS_DEFAULT_REGION'),
            'key'    => env('AWS_APPSTORAGE_ACCESS_KEY_ID'),
            'secret' => env('AWS_APPSTORAGE_SECRET_ACCESS_KEY'),
            'bucket' => env('AWS_APPSTORAGE_BUCKET'),
        ],

This seems not to work. Any thoughts?

17 Sep
10 months ago

broefs left a reply on Forge Deployment Fails Related To Vendor/autoload.php

Hi @swilsdon, I did recently solve this. In my case I was referring to a table that did not yet exist in the boot method of my Auth Service Provider. No idea what could be the problem in your case.

What you could do redeploy on your local machine with an empty database and see if you can trigger the error locally that way.

10 Sep
10 months ago

broefs left a reply on Forge IP Addresses For Use With AWS EC2 Security Groups/inbound Rules

Thanks @cronix, those addresses were confirmed to me too. @digitalformula, it would be good if this answer would now be marked as Best Answer.

06 Aug
11 months ago

broefs left a reply on Multiple Sites On Forge Using Redis Queues

Did you ever got an answer? I'm having the exact same issue.

06 Mar
1 year ago

broefs left a reply on Forge Deployment Fails Related To Vendor/autoload.php

On my local machine composer install, composer dump-autoload, composer update on my local are all fine. All I get is a warning:

Package phpoffice/phpexcel is abandoned, you should avoid using it. Use phpoffice/phpspreadsheet instead.

Does not seem relevant. On Forge server still getting : Failed opening required '/home/forge/mysite/vendor/autoload.php'

broefs left a reply on Forge Deployment Fails Related To Vendor/autoload.php

Thanks for suggestion @ejdelmonico. Checked all and did one update to config/app.php, but does not solve the problem. Can you explain why you advise me to check these, perhaps it can give me an idea where else to look?

broefs started a new conversation Forge Deployment Fails Related To Vendor/autoload.php

I have a bitbucket repository started as Laravel 5.1 and over time updated to 5.4. Whenever I try to deploy using Forge I get something like:

Cloning into 'mysite'...

php artisan clear-compiled PHP Warning: require(/home/forge/mysite/vendor/autoload.php): failed to open stream: No such file or directory in /home/forge/mysite/artisan on line 18

Warning: require(/home/forge/mysite/vendor/autoload.php): failed to open stream: No such file or directory in /home/forge/mysite/artisan on line 18 PHP Fatal error: require(): Failed opening required '/home/forge/mysite/vendor/autoload.php' (include_path='.:/usr/share/php') in /home/forge/mysite/artisan on line 18

Fatal error: require(): Failed opening required '/home/forge/mysite/vendor/autoload.php' (include_path='.:/usr/share/php') in /home/forge/mysite/artisan on line 18 Script php artisan clear-compiled handling the pre-update-cmd event returned with error code 255

I then install from Forge with 'Install Composer Dependencies' switched off and I SSH into the machine and run composer install --no-scripts and subsequently the standard deployment script. This solves the problem but is a pain to have to do this for each new deployment.

Any suggestions?

01 Mar
1 year ago

broefs left a reply on Scorm

For anyone else like me ending up in this thread it seems we now have https://github.com/asifm42/scorm-cloud-laravel.

08 Feb
1 year ago

broefs left a reply on Running Npm From Controller

Eventually I solved this by running the exec inside a job (php artisan make:job CompileAssets) through beanstalkd. This way the job (and hence the exec) gets executed by the user that runs crontab in stead of by the user used to run web server threads (www-data in my case). Problem was that www-data can only write in storage, and I did not want to change that.

29 Jan
1 year ago

broefs left a reply on Running Npm From Controller

The reason for this unusual approach is that I give the site administrator the ability to make changes to a _variables.sass file. When changes have been made I would like to recompile.

broefs left a reply on Running Npm From Controller

I did try the absolute directory. Unfortunately ...

broefs left a reply on Running Npm From Controller

Sorry, shell_exec makes no difference.

broefs left a reply on Running Npm From Controller

Yes, I am getting expected output up until the point up until the actual compilation starts. But no files are generated or copied. I did change directory permissions to 777. No sigar.

I'll try the shell_exec right away.

broefs started a new conversation Running Npm From Controller

I've created an Artisan commend to compile my assets. In the handler it does exec('npm run dev', $result);. Works like a dream. However, when I call this command from a Controller Artisan::call(); it does not compile any assets.

Any thoughts?

09 Jan
1 year ago

broefs left a reply on Forum Post Not In Search Results

Solved, Thanks Jeffrey

06 Jan
1 year ago

broefs left a reply on Moderatable, Revisionable, And SoftDeletes At The Same Time

Seems for my usecase https://github.com/VentureCraft/revisionable is unpractical because it stores every field that gets updated in a separate record. Looks like I'll be using https://github.com/jarektkaczyk/revisionable instead. It is well written and seems doable to add (moderation) status field to use and retrieve 'latest with status published' instead of 'latest' by default.

05 Jan
1 year ago

broefs started a new conversation Forum Post Not In Search Results

Created a post https://laracasts.com/discuss/channels/eloquent/moderatable-revisionable-and-softdeletes-at-the-same-time. When searching on 'Moderatable' (a day later), which is first word of post title, I don't get my post as a result. Is there something wrong with the search?

03 Jan
1 year ago

broefs started a new conversation Moderatable, Revisionable, And SoftDeletes At The Same Time

I have a model Target of which I need to keep history of any changes made to instances. For this I intent to use https://github.com/VentureCraft/revisionable.

In addition I have two groups of users: 'Target manager' and 'Target moderator'. 'Target manager' may suggest new and changes to existing Targets. 'Target moderator' may subsequently approve these. I was thinking of using https://github.com/hootlex/laravel-moderation for this.

Finally I'm using SoftDeletes trait on the Target model.

When a 'Target manager' suggest a change to a Target I would like the suggested change to be stored as a revision with moderation status 'pending' and I would like the previous version to be retrieved retrieved on all queries to the Target (Target::all();) model by default.

Can anyone tell me if this scenario will work? Or does anyone have a better approach?

broefs left a reply on Secure Storage Of Medical Forms

I did go this this route @Snapey. works like a dream. Thanks again!

08 Nov
1 year ago

broefs left a reply on Secure Storage Of Medical Forms

Thanks very much @Snapey. I'll read those blogs as a start.

broefs started a new conversation Secure Storage Of Medical Forms

As part of a Laravel web application for a client I need to securely upload and store medical records. Ideally I would like to use some kind of service that gives me a certified guarantee that it securely stores and encrypts those documents for me. I'm wondering if:

  • anyone knows of such a service
  • if there would be a way to encrypt on the user side before uploading
  • how I could channel the upload directly to the service

Alternatively (if I can't find such a service), I'm considering moving from the web application from Linode to AWS. I did some reading on this, but there is too much documentation ;). Is there anyone that has any experience with regards to encryption, security, guarantees of AWS?

All suggestions welcome!

01 Apr
2 years ago

broefs started a new conversation One Stripe Or Braintree Subscription Linked To Multiple Users

I have a client that offers memberships. These memberships allow publication of user profiles in a directory as well as access to non public website content. These membership used to be student or professional. Now the want to introduce 'institutional membership'. There is one member that manages the subscription and payments and receives invoices, and there are multiple users that can publish their profiles based on the one subscription. When the subscription expires, all profiles linked should be taken off-line

How should I approach this linking of multiple registered users against one subscription?

06 Sep
2 years ago

broefs left a reply on Building With Workflow At The Core

@martinbean Can you perhaps elaborate on the approach you took? I have a similar use case and had a quick look at https://github.com/lexik/LexikWorkflowBundle and https://github.com/yohang/Finite. Did you consider either of those?

Anyone else have experience and tips around this issue?

21 Aug
2 years ago

broefs left a reply on Listing Concrete Class Instances From Abstract Base Class

With reference to https://laracasts.com/discuss/channels/eloquent/multiple-models-to-same-table I solved this as follows: I made the base class a concrete class, I added a class field to the extended classes, and I added default values for the class attribute and global query scopes to the extended classes. This seems to achieve what I wanted. Base class: ''' class Assessment extends Model { /** * The table associated with the model. * * @var string */ protected $table = 'assessments';

/**
 * Fillable fields
 *
 * @var array
 */
protected $fillable = [
    'class',
    'title',
    'slug',
    'sortorder',
    'status',
    'description',
];

/**
 * Yes we want timestamps
 *
 * @var bool
 */
public $timestamps = true;

/**
 * Validation rules
 *
 * @var array
 */
public static $rules = [
    'class' => 'required',
    'title' => 'required',
    'slug'  => 'unique:assessments|required',
    'status' => 'required',
];

} ''' One of the extended classes: ''' class AssessmentChecklist extends Assessment { protected $attributes = [ 'class' => 'AssessmentChecklist' ];

protected static function boot()
{
    parent::boot();

    static::addGlobalScope('class', function(Builder $builder) {
        $builder->where('class', '=', 'AssessmentChecklist');
    });
}

} '''

20 Aug
2 years ago

broefs left a reply on Listing Concrete Class Instances From Abstract Base Class

The reason I used an abstract class is because there will be a bunch of methods that will be equal for all classes extended from Assessment, there will be a bunch unique to each concrete class, and there will be relations to other classes that are different for each concrete class. I come from a traditional C++ background, and there one would typically use an abstract class in such a case.

I prefer not to have everything in one class because that would lead to many if-elses, lengthy methods, and unreadable sources. In that case I would perhaps rather skip the abstract class and do as much as possible of the generic common stuff in an AssessmentController.

I intended to have the 'table' and 'fillable' only in the abstract class, they sneaked into the concrete class while trying various options. Perhaps there are other approaches that are better or more convenient in Laravel? Or perhaps there are other ways to collect instances of concrete classes from an abstract classes' controller?

broefs left a reply on Listing Concrete Class Instances From Abstract Base Class

Thanks Toni, That is a quick answer ;). The thing is: I do not only want the AssessmentChecklists, I also want other AssessmentSurveys and AssessmentScorecard, etcetera, which all have Assessment as base class. Is there a way to retrieve all at once?

broefs started a new conversation Listing Concrete Class Instances From Abstract Base Class

Hope someone can point in the right direction:

I have the following abstract class:

abstract class Assessment extends Model { /** * The table associated with the model. * * @var string */ protected $table = 'assessments';

/**
 * Fillable fields for route
 *
 * @var array
 */
protected $fillable = [
    'title',
    'slug',
    'sortorder',
    'status',
    'description',
];

... }

I have created the table assessments (the concrete classes will all use the same table), and I have a concrete class as follows:

class AssessmentChecklists extends Assessment { /** * The table associated with the model. * * @var string */ protected $table = 'assessments';

/**
 * Fillable fields for route
 *
 * @var array
 */
protected $fillable = [
    'title',
    'slug',
    'sortorder',
    'status',
    'description',
];

}

Finally in my 'AssessmentsController' I have:

class AssessmentsController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $assessments = Assessment::all();

    return view('assessment.assessment.index')->with('assessment', $assessments);
}

}

I want to retrieve a list of instances of the concrete classes extending the abstract Assessment class. When I do so I get:

FatalThrowableError in Model.php line 619: Cannot instantiate abstract class App\Assessment

Why do I get this error and what approach should I use in stead?