michaeldyrynda

michaeldyrynda

Member Since 4 Years Ago

Adelaide, Australia

Experience Points 146,280
Experience Level 30

3,720 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 761
Lessons
Completed
Best Reply Awards 126
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.

11 Feb
1 year ago

michaeldyrynda left a reply on Where To Store A Json Configuration File In The Codebase?

In the past, I've put the JSON string in my .env file and just referenced it in the config/services.php file, but you can also store client_secret.json inside of storage then reference the contents in your config file as well.

Either would work but be mindful that the storage directory is part of your version control, and you want to minimise your chances of inadvertently committing secrets to your version control.

michaeldyrynda left a reply on SOAP Client - Class Not Found

In addition to what @bobbybouwmann suggests, make sure you're loading your SoapServiceProvider in the providers array of your config/app.php.

I would also caution against calling the env() function in your service provider. If you were ever to run artisan config:cache, the call to env() would return null.

A more reliable option is to add a new array in your config/services.php file and reference the configuration from there.

// config/services.php

<?php

return [
    // ...

    'soap' => [
        'username' => env('SOAP_USERNAME'),
        'password' => env('SOAP_PASSWORD'),
        'domain' => env('BYD_DOMAIN'),
    ],
];

Then simply update the calls in your service provider:

// app/Providers/SoapServiceProvider.php

// ...
    $soapClient = new \SoapClient(
                storage_path($wsdlPath),
                array(
                    'trace' => 1,
                    'soap_version' => SOAP_1_2,
                    'exceptions' => 1,
                    'login' => config('services.soap.username'),
                    'password' => config('services.soap.password'),
                )
            );
        });
        $soapClient->__setLocation(config('services.soap.domain') . $serviceUrl);

michaeldyrynda left a reply on /app\models Directory Does Not Exist.

You can also just use app_path('models')and let Laravel take care of the separator for you. Note that this will only work for a top-level path i.e. if you had 'models/nested_models' you'd still have to be wary of the separator.

24 May
1 year ago

michaeldyrynda left a reply on Cannot Add Foreign Key Constraint

@Chrizzmeister if you had a user_id column in a table and later decided to add a foreign key constraint to it, any records that either had no value or the value of a non-existent foreign id i.e. a deleted user would cause adding of the foreign key constraint to fail.

13 Aug
2 years ago

michaeldyrynda left a reply on Using Vue To Validate Coupon(s)

Are you using vue dev tools in chrome? Does that she'd any light?

10 Jul
2 years ago

michaeldyrynda left a reply on Homestead Serve Not Restarting Nginx

It looks like the functionality was removed from the serve command. Note that serve as removed some time ago in favour of separate serve-laravel, serve-symfony2, serve-proxy, and serve-hhvm commands. None of which are documented currently, though I'm not sure if this is via intentional omission or just being missed out.

The serve command ought to be considered legacy now, I think, given it's no longer documented and the Homestead docs suggest editing the Homestead.yaml file and running vagrant provision after adding new files.

26 Jun
2 years ago

michaeldyrynda left a reply on Laravel 5.3 Wish List

Y'all know you can just add an app/Models directory and put your models in there, right?

The app folder is PSR-4 namespaced, meaning that as long as you follow the naming structure (StudlyCaps folders and class names), Composer will automatically load those classes for you.

10 Jun
2 years ago

michaeldyrynda left a reply on Where Condition To Get Pass 30 Days Worth Of Records

First off, use a date field, not a varchar it will be much more efficient if you're going to be querying on it than a text string.

Secondly, to grab the last 30 days worth of results, you can use the whereBetween or whereDate.

09 Jun
2 years ago

michaeldyrynda left a reply on PHP Version Compatibility Related Issues

You can try using whereLoose, which will do a non-strict comparison of your active field. 1 and '1' should both pass that check, then.

michaeldyrynda left a reply on Migrations: Timestamp VS DateTime VS Date VS Timestamps

timestamp and dateTime are similar - they store a date (YYYY-MM-DD) and time (HH:MM:SS) together in a single field i.e. YYYY-MM-DD HH:MM:SS. The difference between the two is that timestamp can use (MySQL's) CURRENT_TIMESTAMP as its value, whenever the database record is updated. This can be handled at the database level and is great for Laravel's created_at and updated_at fields.

Note also that timestamp has a limit of 1970-01-01 00:00:01 UTC to 2038-01-19 03:14:07 UTC (source), whilst dateTime has a range of 1000-01-01 00:00:00 to 9999-12-31 23:59:59, so consider what you plan on storing in that field before determining which type to use.

date stores just the date component i.e. YYYY-MM-DD (1000-00-01 to 9999-12-31).

timestamps doesn't take an argument, it's a shortcut to add the created_at and updated_at timestamp fields to your database.

michaeldyrynda left a reply on Homestead: How Do I Browse To A New Project?

It all depends on whether you install globally (composer global require) or in your project (composer require)

08 Jun
2 years ago

michaeldyrynda left a reply on How To Deploy Laravel Project On Cpanel Through Forge

You don't have to give up Laravel, no, but if you're going to use a modern framework, you should probably spend some time learning about hosting it in a modern environment.

michaeldyrynda left a reply on Does A Melted Server Mean Downtime Using Multi-server?

The load balancer should be aware of the fact that one server is unavailable and forward all requests to the one that's still up. The load balancing isn't necessarily every second visitor getting sent to the other server.

michaeldyrynda left a reply on Homestead: How Do I Browse To A New Project?

It will come down to how you've installed homestead - either globally or per-project. Per-project is likely why you'd have a homestead folder in that xampp folder, globally it should have been installed in your home directory (as is the case with Mac/Linux).

Glad you got it sorted out, though.

07 Jun
2 years ago

michaeldyrynda left a reply on How To Deploy Laravel Project On Cpanel Through Forge

You can use Laravel on cPanel, you likely won't be able to use Forge. Forge works via SSH, which most cPanel hosts have disabled for security. The assumed directory structure and configuration in cPanel is going to be vastly different to what Forge expects, as well.

If you really must use cPanel, you're going to have to do deployments largely manually, though I'd encourage you to move away from it.

06 Jun
2 years ago

michaeldyrynda left a reply on Installation

What is on line 163 of your config/app.php configuration file?

michaeldyrynda left a reply on Print One Error Not All Validation Errors

You need to replace key with the key corresponding to the input field you'd like to display the error for i.e. username, password, etc.

michaeldyrynda left a reply on Print One Error Not All Validation Errors

You can place that anywhere you want to display the first error in your blade template.

michaeldyrynda left a reply on Homestead: How Do I Browse To A New Project?

Did you also run vagrant provision as @SaeedPrez mentioned above? Each time you add a site to your Homestead.yaml file, you'll need to reprovision the box.

michaeldyrynda left a reply on Print One Error Not All Validation Errors

You can use $errors->first('key') to print the first error only. You'll have to use JavaScript to focus the field yourself. Something along the lines of:

window.load = function () {
    document.getElementById('key').focus();
}
05 Jun
2 years ago

michaeldyrynda left a reply on Homestead: How Do I Browse To A New Project?

Add another entry into your hosts file for examplecms.dev for the same IP address.

You'll need to add the mapping in homestead as well as the host file so your computer knows that when you type examplecms.dev into your browser, it should resolve to 192.168.10.10.

04 Jun
2 years ago

michaeldyrynda left a reply on Damn You Vue.js... Vue Warn: Unknown Custom Element

I'm not sure how the marketing could have been any clearer, given Vue is listed as one of the features of Spark.

The primary goal behind Spark was to provide the boilerplate for users, teams, signup, subscriptions, etc. allowing you to focus on building your business-specific stuff.

Mixing frontend frameworks is always going to be a mess. Perhaps instead of trying to force Angular into a Vue frontend, you spend a little time trying to convert your frontend concerns to Vue. I think you'll find it simpler a task than trying to mix and match the two. You may even end up liking Vue.

Overall, Spark is there to help you get up and running from scratch rather than trying to merge an existing project but if you choose to do that, Spark is opinionated about how it does things. If that's not what you're after, then perhaps Spark isn't the right tool for your particular use case.

Angular and React may be the bee's knees today, but they weren't always. They may not always be in the future. As long as the reasonably significant Laravel community is backing in Vue, I don't think there'll be too many issues with it. I wouldn't hold my breath for Spark 2.0 dropping JS entirely; if that's what you're hoping for, I think you've misunderstood the purpose of it.

28 May
2 years ago

michaeldyrynda left a reply on Forge + Custom Vps

Forge will give you a link to curl, which will download a shell script to run that does everything necessary - you can have a look at it before running it if you'd like.

michaeldyrynda left a reply on Forge + Custom Vps

Yep. You need a fresh Ubuntu 16.04 LTS server; select custom VPS and you'll be given instructions to continue.

27 May
2 years ago

michaeldyrynda left a reply on Laravel Homestead Confused About Versions 0.2.7 / 2.1.5 ??

There's issues with Vagrant and 16.04 - so some time after that's fixed.

26 May
2 years ago
19 May
2 years ago

michaeldyrynda left a reply on How To Display Fetch Values Upon Clicking A Button Using Vue And Laravel

Right, so the error message is indicating that the properties you're trying to display (section_code, subject_code, subject_description) don't exist, because you're pushing section directly onto reservations.

In this instance, you'll need to take my first option, which is to return the complete reservation object from the POST to the store endpoint and push that back on to the reservation object.

public function store(Request $request)
{
    $subject = SectionSubject::findOrFail($request->sectionSubjectId);

    $student = Student::findOrFail($request->studentId);

    // assignStudents will need to return the complete reservation object
    // in the same way that your index method does
    return $subject->assignStudents($student);
 }

When you return the (single) reservation object, you can then push it on to the reservations model in your vue instance.

.then(function(response) {
    // Check the response object to verify that your returned reservation object is available at data
    // It may be response.data.data
        this.reservations.push(response.data).
},

michaeldyrynda left a reply on How To Display Fetch Values Upon Clicking A Button Using Vue And Laravel

What error are you getting? Your store method doesn't return anything; I'm not sure if this is going to be a problem (you're not sending a response back to your POST request, so vue-resource may be assuming you have an error.

18 May
2 years ago

michaeldyrynda left a reply on How To Display Fetch Values Upon Clicking A Button Using Vue And Laravel

That not working will depend on how you're returning data from the POST request.

If you're returning it as part of a JSON object, it might be something like response.data.reservation.

My follow up post will probably be a simpler way of going about it, and saving you posting data back to the client you already have available.

michaeldyrynda left a reply on How To Display Fetch Values Upon Clicking A Button Using Vue And Laravel

Alternatively, just pass the existing section object in to your addSubject function:

<button v-on:click="addSubject( {{ $section }}, {{ $student_id}}, )" 
        class="btn btn-xs btn-primary"
>Add</button>
addSubject: function(section,student_id) {
    this.$http({
        url: 'http://localhost:8000/reservation',
        data: { sectionSubjectId: section.pivot.id, studentId: student_id },
        method: 'POST'
    })
        .then(function(response) {
            // You've already attached the section to the student, so you can safely assume this is ok
            this.reservations.push(section).
        }, function(response) {
            console.log('failed');
        });
}

michaeldyrynda left a reply on How To Display Fetch Values Upon Clicking A Button Using Vue And Laravel

When you add the subject to the student, you can return the student's reservation in the response. It's then just a matter of appending that response to the existing reservations object.

addSubject: function(id,student_id) {
    this.$http({ ... })
        .then(function(response) {
            // return the reservation object in your response
            this.reservations.push(reservation).
        }, function(response) {
            console.log('failed');
        });
}

Because you're using two-way model binding, Your v-for will automatically adjust to factory in your new reservation instance.

michaeldyrynda left a reply on Local Forge-like Production Server

You can just run the provision commands against a fresh Ubuntu server install. It'll get you to essentially the same thing.

michaeldyrynda left a reply on Gulp --production Breaks Urls

Are your images saved relative to the production path?

Your compiled assets will be in /public/css but your production compiled assets will be in /public/build/css, thus your relative paths will be pointing to one directly above where you think they'll be.

michaeldyrynda left a reply on Logging In With Email But Only The Part Before @

Just append before you validate/attempt auth.

Be wary of users that type their full email, though.

16 May
2 years ago

michaeldyrynda left a reply on Is There Any Way We Can Get The Code Of Laracast Videos?

Some of them have links to GitHub in the video description; some will be in the Laracasts repo on GitHub others are snippets in gists that Jeffrey posts.

15 May
2 years ago

michaeldyrynda left a reply on Error Eloquent Relationship When Used As Method

Calling a relationship as a method returns a query builder instance, not a collection. This is used so you can constrain the query on the relationship.

$userType::where('id', $id)
         ->siteLocations()
         ->where('state', $state)
         ->get();

michaeldyrynda left a reply on Filter Eloquent Model

Ah, right, my bad; in that case you'll need to provide category as an array:

$topics = $topics->with([ 'category' => function ($query) use ($category) {
    $query->where('slug', $category);
}]);

See the Constraining Eager Loads documentation.

michaeldyrynda left a reply on Filter Eloquent Model

You'll need to provide some more context around the error you're encountering. What specifically is generating that error?

14 May
2 years ago

michaeldyrynda left a reply on Blade To Vue: Alternative To Json_encode

If you just pass $private it will automatically be converted to a JSON string.

michaeldyrynda left a reply on Filter Eloquent Model

Are you passing an in in your route for category and do you have route model binding? If so, you'll need $category->id (or whatever the ID field is) in the closure.

michaeldyrynda left a reply on Filter Eloquent Model

Something along the following lines should get you close:

public function index($category = null)
{
    $categories = Category::all();

    $topics = Topic::latest()->with('user', 'replies');

    if (! is_null($category)) {
        $topics = $topics->with('category', function ($query) use ($category) {
            // Assuming category is the id, substitute as necessary
            $query->where('id', $category);
        }
    } else {
        $topics = $topics->with('category');
    }

    $topics = $topics->paginate(5);
}

Two things of note here:

  1. I don't recall, but I'm pretty sure you do need to reassign $topics when you perform additional operations on it and,
  2. You may be able to collapse the if/else and place the category in the initial with. I suspect that Eloquent will merge the two operations together.
13 May
2 years ago

michaeldyrynda left a reply on What's Wrong With My Composer.json?

Why are you using classmap for app/Models? Everything in app is already under PSR-4 autoloading.

Remove that and I think you'll have better luck, as I suspect the classmap inside app/Models is overriding the PSR-4 autoloading.

07 May
2 years ago

michaeldyrynda left a reply on Update Valet

A composer global update should suffice.

28 Apr
2 years ago

michaeldyrynda left a reply on [Spark-Lumen] Compatibility

Compatible in what way? I wouldn't have thought you could install Spark into a Lumen app, given that Spark has a fairly opinionated frontend and Lumen is designed for building APIs.

25 Apr
2 years ago

michaeldyrynda left a reply on Keep Default Values For Enviroment Variables Out Of App.php

env will default to null if the key is not define in the environment.

michaeldyrynda left a reply on Catch Statements Are Ignored, Exception Is Handled In Global Handler

It's likely trying to catch the exceptions relative to the current namespace. Either import the exception class or prefix the exception paths with a \.

try {
    $this->repository->approve($token, $user);
} catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
        return $this->error('The entry was not found.');
    } catch (\Fusion\GAM\ProxyBlock\Exceptions\BlockAlreadyApprovedException $e) {   
        return $this->error('Already approved.');
} 
24 Apr
2 years ago

michaeldyrynda left a reply on $this->validate Vs Validator::make?

The validate method will trap the failure and redirect back with errors and input automagically.

Validate::make builds a new Validator instance for you to work with.

With the latter, it's up to you to check fails or passes and handle each case as you see fit.

22 Apr
2 years ago

michaeldyrynda left a reply on WhereBetween Does Not Include End Date

Are you passing a date (YYYY-MM-DD) or date time (YYYY-MM-DD HH:MM:SS)?

whereBetween is sugar for the database's BETWEEN keyword. If you need to include start and end dates, be explicit about the times i.e. YYYY-MM-DD 00:00:00 and YYYY-MM-DD 23:59:59.

18 Apr
2 years ago

michaeldyrynda left a reply on Add New Payment Method In Spark

I'm certain, though don't have access to Spark, that it's using the new version of Cashier - so implementing your own gateway wouldn't be entirely different to either of those two implementations

michaeldyrynda left a reply on Add New Payment Method In Spark

I would imagine you can add whatever payment functionality you want, you'd just need to implement the appropriate payment interfaces. This was the case with earlier beta versions from memory.