MThomas

Owner at Globe-View Solutions & Jonril

Experience

85,660

48 Best Reply Awards

  • Member Since 4 Years Ago
  • 639 Lessons Completed
  • 23 Favorites

21st August, 2018

MThomas left a reply on How To Define The Cronjob Function • 1 month ago

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 ) • 1 month ago

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

10th August, 2018

MThomas left a reply on Access Custom Config File • 1 month ago

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 • 1 month ago

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 • 1 month ago

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

MThomas left a reply on Access Custom Config File • 1 month ago

@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 • 1 month ago

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 • 1 month ago

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?

9th August, 2018

MThomas left a reply on How To Pass Bearer Access_token In URL • 1 month ago

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 • 1 month ago

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) • 1 month ago

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?

7th August, 2018

MThomas left a reply on How To Use Sweet Alert In Laravel? • 1 month ago

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 • 1 month ago

@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? • 1 month ago

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? • 1 month ago

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 • 1 month ago

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? • 1 month ago

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 • 1 month ago

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. • 1 month ago

Why not use Larvel Valet as an alternative?

MThomas left a reply on Page Not Found Error • 1 month ago

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? • 1 month ago

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 • 1 month ago

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? • 1 month ago

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 ? • 1 month ago

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

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

16th June, 2016

MThomas left a reply on Deleted • 2 years ago

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

29th March, 2016

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

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 • 2 years ago

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 • 2 years ago

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 • 2 years ago

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

17th December, 2015

MThomas left a reply on HelpMe!!!! SOS • 2 years ago

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

MThomas left a reply on HelpMe!!!! SOS • 2 years ago

Did you?

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

MThomas left a reply on HelpMe!!!! SOS • 2 years ago

Bro... sigh

Follow the steps described in the link I posted earlier.

MThomas left a reply on HelpMe!!!! SOS • 2 years ago

Did you registrate the package in config.php?

MThomas left a reply on HelpMe!!!! SOS • 2 years ago

Did you pull in the form package?

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

11th December, 2015

MThomas left a reply on Seeding Issue. Unintentional Automatic Column Added. • 2 years ago

@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

10th December, 2015

MThomas left a reply on Problem Call Route Name (in Group) With Parameters • 2 years ago

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 • 2 years ago

@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 • 2 years ago

@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 • 2 years ago

@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 • 2 years ago

@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.

MThomas left a reply on Any Way To Pass Arguments To A Job (Command) ? • 2 years ago

Not sure if this is what you are looking for but if you pass the arguments to the job you need to initialize the arguments in the Job constructor and then you can access them in the handle method

$this->dispatch(new SomeJob($user));

class SendReminderEmail extends Job
{

    protected $user;

    public function __construct(User $user)
    {
        $this->user = $user;
    }

    public function handle()
    {
        $this->user; //the passed user
    }
}

MThomas left a reply on One To One Rerations • 2 years ago

@inyansuta OK

I imagine that you have a Currency model?

In that case you could do something like this:

class Currency extends Model {

    public method user() {
        return $this->hasMany(User::class);
    }

}
$currency = Currency::find(1); // I assume you hardcode it since you do that in your opening post

$currency->user()->create($data);

MThomas left a reply on One To One Rerations • 2 years ago

If you take a look at the Laravel documentation (relationship section) you will find a paragraph dedicated to one-to-one relations:

http://laravel.com/docs/5.1/eloquent-relationships#one-to-one

MThomas left a reply on Dynamic Eloquent Relationships From DB • 2 years ago

I guess this is what you are looking for: https://github.com/jimbolino/laravel-model-builder/

But I highly recommend creating them yourself, this will force you to think about the names of the relations etc.

MThomas left a reply on I Have Issue When Use Elasticsearch • 2 years ago

@PhanPhy I think you need to be a bit more elaborate in what you are doing en where things go wrong. For example what index page does not load, a Elastic page or a laravel blade page etc.

MThomas left a reply on Dynamic Eloquent Relationships From DB • 2 years ago

@EfeEngin that is the place where you need to define a relationship. If you don't want to use Models for this (its what they are suposed to be used for) you need to work with database joins on the tables in your code.

MThomas left a reply on Can Someone Guide Me? • 2 years ago

@Zaki, please show us the whole method (and related methods, this is only the content of the array) and tell us what you want to accomplish.

And please put your code snippets in code blocks this will enhance readability :)

MThomas left a reply on Seeding Issue. Unintentional Automatic Column Added. • 2 years ago

In your Disease model you state that the disease belongs to a Field, this means that the disease table must have a reference in it to the field table (generated based on the table defined in your Field model).

I think that you need an hasMany relation, a disease has many fields, but I'm not sure if that is what you want.

For more on relations check: http://laravel.com/docs/5.1/eloquent-relationships#one-to-many &

MThomas left a reply on Dynamic Eloquent Relationships From DB • 2 years ago

Sorry, you need to be a bit more specific, I'm not sure what you want to do? What have you tried?

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.