MThomas

MThomas

Eindhoven, The Netherlands

Member Since 4 Years Ago

Experience Points 87,850
Experience
Level
Lessons Completed 644
Lessons
Completed
Best Reply Awards 51
Best Answer
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.

12 Dec
3 days ago

MThomas left a reply on How To Login By Both Web And Jwt Token?

Did you check in the database if the user really exists? And if the password is saved correctly (encrypted and all).

11 Dec
4 days ago

MThomas left a reply on How Can I Create A Folder For Each Registration On Amazon S3

That is due to the use of $file->getClientOriginalName(). That specifies the path where you want the file to be uploaded.

So you could do this:

$directory = 'public/' . $business->id; Storage::disk()->makeDirectory($directory);

foreach($files as $file) { if ($file) { Storage::disk()->put($directory . '/' .$file->getClientOriginalName(), fopen($file, 'r+')); } }

MThomas left a reply on Get Query Strings From Previous URL

@JOHNWAWERU - you're welcome, or you can use: parse_str().

MThomas left a reply on Get Query Strings From Previous URL

To get the referer URL you can use: $_SERVER['HTTP_REFERER'].

MThomas left a reply on Need To Provide Exception On Invalid Encrypted Hash Code.

In that case, show us the code you are using.

MThomas left a reply on How Can I Create A Folder For Each Registration On Amazon S3

You could first create a directory using the (https://laravel.com/docs/5.7/filesystem#directories)[designated API].

$directory = 'public/' . $business->id;
Storage::disk('s3)->makeDirectory($directory);

Then put the files in the newly created directory

$directory = 'public/' . $business->id;
Storage::disk('s3')->put($file->getClientOriginalName(), fopen($file, 'r+'));

By the way you can set the default disk in config/filesystems.php, so you don't have to specify it over and over again.

MThomas left a reply on Need To Provide Exception On Invalid Encrypted Hash Code.

If you are keen on catching any exception why not use:

try {
$decrypted = decrypt($encrypted_value);
} catch (\Exception $e) {
    //handle the Exception here
}

This would catch any exception trown. If you want you can differentiate what to do based on the thrown exception.

MThomas left a reply on How To Login By Both Web And Jwt Token?

What is the response you get? With only "I tried to login, but cannot" we cannot help you.

Can you tell us if you do get an error, have created any users, what the code is you used etc?

21 Aug
3 months ago

MThomas left a reply on How To Define The Cronjob Function

Did you already schedule a cronjob? In this section of the Laravel Docs you can find how to do that: https://laravel.com/docs/5.6/scheduling

You need for example, you need to schedule a cronjob that will look for any planned jobs.

MThomas left a reply on No Debug Page ( Debug Is True )

@mac03733 Show us the two files, maybe we can discover where things go haywire.

10 Aug
4 months ago

MThomas left a reply on Access Custom Config File

Config variables are not there to be changed, you can specify a default value but you should not (and cannot) change your config variables on runtime.

If you need to change data you should look into models etc: https://laravel.com/docs/5.6/eloquent

MThomas left a reply on 403 Forbidden In Laravel Project In Cpanel

ehm...

Why not start by giving us some more information, without that you cannot help yourself and we can't help you...

MThomas left a reply on Access Custom Config File

Where did you save your config file? Is it in your-app/config/?

MThomas left a reply on Access Custom Config File

@sanjayacloud In my first post I showed you how it works, not sure what more you want?

If you are new to Laravel, you might want to start with some of the videos here on Laracasts. And the Laravel Documentation is also a great resource.

MThomas left a reply on Access Custom Config File

From where in your app did you do this?

What is the contents of your errorreporter.php file in the config directory?

And what does config('errorreporter.active') actually return?

MThomas left a reply on Access Custom Config File

How are you trying to access it?

Normally you create a file app/config/myconfigfile.php.

And its contents could be

<?php

return [
    'my-item' => 'value'
];

And access it like: config('myconfigfile.my-item').

Does this help?

09 Aug
4 months ago

MThomas left a reply on How To Pass Bearer Access_token In URL

Not sure if this is still valid, but in this tread on Github it is indicated that you have to pass it through the headers: https://github.com/laravel/passport/issues/56

MThomas left a reply on Multilevel Table Join With Eloquent Relationship

There is the possibility to eager load the nested relationships: Eager Loading Scroll down to Nested Eager Loading.

In your case you could do: `Applicant::with('job.owner')->active()->paginate(5);'.

MThomas left a reply on FatalErrorException (Notification)

It seems that your user relation on your task model does not return a user. Are you sure that there is a user associated with the task you are notifying the user about?

07 Aug
4 months ago

MThomas left a reply on How To Use Sweet Alert In Laravel?

It might not sound nice, but I think the best ting you could do now is go over the documentation of Sweet Alert and check if you did everything they point out. Often it is just a small thin you missed.

MThomas left a reply on Change Updated_at Timestamp Automatically

@push0012 In the example you show, Item is an Eloquent model :)

So what do you mean with your question?

MThomas left a reply on How To Use Sweet Alert In Laravel?

you should add @include('sweet::alert') to your layout file / blade template. Just below <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>.

If you use the above CDN you don't need to add <script src="js/sweetalert.min.js"></script>or install the library (you referenced the library through the CDN).

MThomas left a reply on Hello, I Have The Following SQL Error, Does Anyone Know How I Can Get Rid Of It?

Can you tell us something about your setup? Are you using Homestead, Valet or did you install mysql locally or is this on your production server etc...

MThomas left a reply on Change Updated_at Timestamp Automatically

If you update the record as an eloquent model it will be updated automatically.

See: https://laravel.com/docs/5.6/eloquent#updates

MThomas left a reply on How To Use Sweet Alert In Laravel?

Check this part of the docs: https://github.com/uxweb/sweet-alert#the-view

It provides a Blade helper @include('sweet::alert')that will render the required html to display the message.

And note that you need to add this after the sweet alert JS library.

MThomas left a reply on Laravel Routes: How To Correctly Pass Values To Middleware

Just wondering what you try to do here?

Why not use something like this: Laravel Permissions.

MThomas left a reply on Developing Without A Local VM.

Why not use Larvel Valet as an alternative?

MThomas left a reply on Page Not Found Error

I think the issue is that the URL in your controller is /questionset/updateques but this does not seem to be a defined route. None of your updateques routes are prefixed with /questionset/.

MThomas left a reply on Can I Add Protected $dates To A Model Using A Trait?

I don't think this is as simple as it seems. If it would have been doable through a trait, I think it would have been added as standard behavior to the SoftDeletes trait.

MThomas left a reply on How To Display Multiple Dependent Data With Ajax In Laravel

Not entirely sure, but can you share the controller method that is called? To me it seems that the json-data your controller returns is not in the format you would like it.

MThomas left a reply on How To Use Sweet Alert In Laravel?

Did you also install the Sweet Alert JavaScript library trough NPN or Yarn as is stated in the documentation?

Do you get any errors? Did you check the console tab in the Chrome Inspector?

MThomas left a reply on How Can I Use Sms Gateway For Laravel Application ?

This page in the Laravel Documentation might help you: Laravel notifications

It deals with notifications (among others SMS) by using Nexmo as the provider.

16 Jun
2 years ago

MThomas left a reply on Deleted

Why not share your question with us and add your solution? So others can learn form it :)

29 Mar
2 years ago

MThomas left a reply on It Shows An Error While I Am Using Make:seeder Command

First, what laravel version are you using?

For the rest, check the documentation, normally php artisan make:seeder should work.

https://laravel.com/docs/5.2/seeding

MThomas left a reply on Migrate A New Table It Show The Following Error

If you are in development and want to re-migrate the database run:`

php artisan migrate:refresh

MThomas left a reply on Apply Logic To All Controller Actions

This is what Middleware is meant for, upon every request this is triggerd and there you can check what the users role is and redirect him/her.

https://laravel.com/docs/5.2/middleware

MThomas left a reply on Laravel 5 Redirect To Controller Action

Yes, this is needed, otherwise there is no URI Laravel can redirect you to.

17 Dec
2 years ago

MThomas left a reply on HelpMe!!!! SOS

And what does your config/app.php file look like?

MThomas left a reply on HelpMe!!!! SOS

Did you?

It is explained fairly clearly here: https://laravelcollective.com/docs/5.1/html#installation

MThomas left a reply on HelpMe!!!! SOS

Bro... sigh

Follow the steps described in the link I posted earlier.

MThomas left a reply on HelpMe!!!! SOS

Did you registrate the package in config.php?

MThomas left a reply on HelpMe!!!! SOS

Did you pull in the form package?

https://laravelcollective.com/docs/5.1/html

11 Dec
3 years ago

MThomas left a reply on Seeding Issue. Unintentional Automatic Column Added.

@theamydance Now you set it up as a one to many relation, you need to use a Many To Many relation: http://laravel.com/docs/5.1/eloquent-relationships#many-to-many

10 Dec
3 years ago

MThomas left a reply on Problem Call Route Name (in Group) With Parameters

I think that your htaccess is not correctly working. Are you using Laravel homestead or did you install everything locally?

MThomas left a reply on Non-default Queues With SQS – Wrong URLs Are Built

@dusterio it seems there is no connection or provider method or property defined on a Job. I just did a check in the source, but did not had the time to dive in, but I do believe you need to figure out a way to override the Connector

MThomas left a reply on One To One Rerations

@inyansuta Yeah in those cases you need to set them manually, to my knowledge there is no way of doing this with relations.

MThomas left a reply on One To One Rerations

@inyansuta yes this is the better aproach (in the end, behind the scene the same thing happens).

It is good practice to mark the reply that answered your question as the 'answer', this helps others in finding their answers and users see that an answer has been formulated :)

MThomas left a reply on Non-default Queues With SQS – Wrong URLs Are Built

@dusterio out the top of my head you can specify multiple connections/drivers in your config file, and invoke the connection/driver by specifying this like driver('sqs2') just like you can do this for your database connections.