MortenS

MortenS

Member Since 3 Years Ago

Experience Points 22,690
Experience Level 5

2,310 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 201
Lessons
Completed
Best Reply Awards 4
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.

23 Jun
4 weeks ago

MortenS left a reply on Database Structure Of Templates

I can see two possible solutions.

  1. You add a user_id column to pricing_template_values.
  2. You create a pivot table to link users and pricing_template_values (many-to-many relationship).

I can't say which is best for your need. If the name in pricing_template_values is the different for each user, the first solution is fine. Otherwise the second one will be more flexible (but also a bit more complicated to manage).

MortenS left a reply on Nested Comments

Your table structure is fine. But you need a way to tell how many levels deep each comment is, in order to check if child comments are allowed. This could be done with a getLevelAttribute accessor, which counts the number of parents. As long as you've eager loaded all the parents, it shouldn't require any extra calls to the DB.

MortenS left a reply on Multiple Form Submission Issue

You could either loop through each form, and merge their FormData into a single object, or you could refactor the components to all be in the same <form>tag. Either way, you'll have to make sure that each input has a unique name, or they will all override each other, and you'd end up with only the last form's data. Depending on the structure, you will probably need to use array syntax for the name attributes, e.g. <input name="forms[0].name">, <input name="forms[1].name"> and so forth.

19 Jun
1 month ago

MortenS left a reply on Declaration Of X Should Be Compatible With Y In /path/to/file On Line Z

If you use PhpStorm, you can run an inspection called "Declaration of overridden method should be compatible with parent class."

02 Dec
7 months ago

MortenS left a reply on Continue Execution Even If Some Vendor Code Fails

I see. I don't have any experience with the spool feature, but from what I can tell, it delays the delivery until the app kernel shuts down. If that's the case, you might still be able to catch the error in your App\Exceptions\Handler when it occurs.

I'd like to help more if I can, but I'm still a bit confused. If spooling means what I think it means, then the email won't be sent immediately when you call Mail::send(), but in stead write the mail to a file (or to memory) and deal with the actual transmission at a later time (very similar to a queued job). If that's the case, then your controller has no way of knowing whether the delivery was successful or not. It just "queues" it, and then moves on.

MortenS left a reply on Existing Route Returns 404

Remove 'namespace' => 'App' unless you've actually put the controller in the root of the app folder.

MortenS left a reply on I Want To Get Value From Blade Template/router To Vue Js(app.js)

If they're both top-level components, and 'messages' is in the root Vue instance, you can access it like this this.$root.messages.push(newMessage).

MortenS left a reply on Continue Execution Even If Some Vendor Code Fails

try {
    // Call methods that might throw an exception
} catch (\Exception $e){
    // Do something else in stead
}

Or am I missing something?

MortenS left a reply on Push Is Not A Function Vuejs

That only happens if this.cart is not an array. Check the value in Vue devtools before trying to add a new product. Maybe your /list endpoint returns an object, or a string or something.

MortenS left a reply on I Want To Get Value From Blade Template/router To Vue Js(app.js)

Not a lot to go on, but here are a few suggestions:

App.js is a global file used on all your pages. You can't pass props to it because it's not a component. You should probably make a separate GuestBookingDetails component and add that to the blade file for guest_booking_details.

Have you checked out the Vue tutorial series on this site? You'll find all the answers you need there.

18 Nov
8 months ago

MortenS left a reply on Passport: Use Token-based Authentication Also For Web Requests.

Have you tried using api_token as a GET param in stead of access_token?

16 Nov
8 months ago

MortenS left a reply on Problem Try Catch With FatalErrorException

You probably just need to tell the SoapClient to throw exceptions. Try adding ['exceptions' => true] to the options array when you're creating the client.

StackOverflow

MortenS left a reply on Pusher Is Not Receiving Events From The Server

Looks fine as far as I can see. Just a few thoughts.

  • Try replacing toArray() with broadcastWith().

  • Have you checked your logs to see if any BroadcastExceptions are thrown?

  • You're not showing how the event gets fired. Maybe there's something wrong there?

09 Sep
10 months ago

MortenS left a reply on Encrypted Fields Fail

Not a clue. I would use Xdebug and put a breakpoint in the getter to inspect the object's attributes.

MortenS left a reply on Encrypted Fields Fail

Shouldn't the getter be more like this?

/**
     * @return string The decrypted query
     */
    public function getTermsAttribute(){
        return decrypt($this->attributes['terms']);
    }

MortenS left a reply on User Management

I don't think there are any standard ways, since it depends so much on what you need.

I usually end up using one of the two packages mentioned in this article myself. But in all honesty, sometimes doing what @Snapey suggests would have saved me a lot of time.

MortenS left a reply on Error At Running Time Of Command Artisan Preset Bootstrap

Make sure the /resources/sass directory exists.

MortenS left a reply on Laravel Passport : How To Query 'passport Keys'?

They're stored in the database in the oauth_clients table.

MortenS left a reply on Encrypted Fields Fail

Could you post the code for the mutator and accessor?

MortenS left a reply on How To Append The Result From Search Result

When you click the h2 with the name in it, the input field loses focus, which means that magic_flag gets set to false.

MortenS left a reply on Why .env And App/config.php Has Same Config? And Why Config.php Is Used?

@topvillas You're correct, but there's an unfortunate typo in your reply (remove 'not' in the first sentence).

MortenS left a reply on Why .env And App/config.php Has Same Config? And Why Config.php Is Used?

All the config files in the config/folder should be the same across all environments, and it's safe to include them in version control, since they don't contain any sensitive information.

The only difference between local and production should be the .envfile.

In theory you could just hard-code everything in the config.php files. Laravel wouldn't mind. But if you need to use different drivers, API keys and passwords in different environments, the env()helper is a tools that allows you to keep all those differences in a single file.

MortenS left a reply on Apache2.4 & Laravel 5.4 With Alias In A Subfolder Doesn't Work Without /index.php

Hmm... Are you sure mod_rewrite is even enabled? Try adding some gibberish to the top of the .htaccess file. This should cause a 500 error. If it doesn't it doesn't, it means apache isn't reading the file.

Just out of curiosity - wouldn't it be easier to set up a VirtualHost in stead of using the IP?

08 Sep
10 months ago

MortenS left a reply on How To Display Data Where Created_at Is Day Of Week

->whereRaw(WEEKDAY(created_at)=WEEKDAY(CURDATE()))

MortenS left a reply on Group Caching

Then you'll need to call Cache::forget() on each individual cache key.

MortenS left a reply on Apache2.4 & Laravel 5.4 With Alias In A Subfolder Doesn't Work Without /index.php

Check if this is missing in your apache.ini:

´´´DirectoryIndex index.php index.html```

MortenS left a reply on Validate Rules When You Want To Edit Post?

'poster' => 'nullable|image|max:51200'

MortenS left a reply on Twice Laravel_session Cookie

Could you run php artisan route:list and check what middleware is used for the /api/dashboard route?

MortenS left a reply on Is This Possible: One Nova License, But Admin For Multiple Containers?

I don't think you can separate Nova from the Models like that. Nova Ressources are coupled to the Model classes themselves.

Also, access control in Nova relies on the Policy classes related to the Models.

Could you write a custom admin panel that achieves it? Sure, if you have access to the DBs, you can do anything you want. But I don't see how you could avoid ending up with a huge mess of duplicated code and validation rules.

MortenS left a reply on Checkbox Click Event

Try replacing "input[name='subject_multi_id[]']"with "input[name^='subject_multi_id']"

Which means 'all inputs with name attributes that start with...'.

Probably unrelated, but all your inputs will end up with identical id attributes. AFAIK the square bracket syntax is only for name attributes.

MortenS left a reply on Validate Rules When You Want To Edit Post?

$this->validate($request->all(),
[
        'title' => [
            'required',
            'max:190',
            Rule::unique('blogs', 'title')->ignore($blog_id) // Allow the title to be unchanged, but if it changes, it has to be unique
        ],
        'description' => 'required',
        'poster' => 'required|image|max:51200',
        'your_date_column' => 'required|date' // Add additional rules if necessary
] );

MortenS left a reply on Form-request Class Does Not Exist!

Because the class is called CreditPaymentsFormRequest, and you're asking for a ReservationPickupsFormRequest?

MortenS left a reply on After Submission All Data Appeared On URL But Did Not Saved

If the form submits a GET request, you are probably just missing method="post" in the tag.

MortenS left a reply on Group Caching

You can use a cache tag for that, if you use a cache driver that supports them.