mhankins

mhankins

Member Since 5 Years Ago

Jackson, MS

Senior Systems Specialist at Mississippi Department of Archives & History

Experience Points 27,645
Experience Level 6

2,355 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 336
Lessons
Completed
Best Reply Awards 2
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.

03 May
1 year ago

mhankins left a reply on 5.5 To 5.6 Broke A Left Join (Postgres)

I had an extra space where I was forming the parent_series.slug array. It was reading as parent_series . slug, so I guess that is two extra spaces.

mhankins started a new conversation 5.5 To 5.6 Broke A Left Join

I upgraded from 5.5 to 5.6 yesterday and now this query isn't working.

This is the output from toSql()

"select "ea_series"."id", "ea_series"."title", "ea_series"."slug", "parent_series "." slug", "ea_series"."internal_only", "ea_series"."staff_only", "ea_series"."path" from "ea_series" left join "ea_series" as "parent_series" on "parent_series"."id" = "ea_series"."parent_id" where "ea_series"."deleted_at" is null```


```php
        $series = $this->series->leftJoin('ea_series AS parent_series', 'parent_series.id', '=', 'ea_series.parent_id')->select($rows);```



24 Jan
1 year ago

mhankins left a reply on Anyway To Run Sudo Command And Getting Output?

I agree with @burlresearch about the log file when it is possible. However, when not you can allow sudo to be used on a single process.

https://askubuntu.com/questions/90726/is-it-possible-to-give-sudo-access-to-only-a-particular-command

13 Oct
1 year ago

mhankins left a reply on Modal Subcomponent In List

I realize what is happening now is each instance of the subcomponent(modal) is opening. Hmm..

mhankins left a reply on Modal Subcomponent In List

The details part does really need to be a modal (or some form of extra popup) extended from the notification itself. I'll keep working on it.

Imgur

mhankins started a new conversation Modal Subcomponent In List

Today I'm working on my notification component in Vue. Everything is working just fine, but I want a popup Modal (subcomponent) with some other details that I store for each notification.

The details are always from the first notification in the list.

<template>
    <div class="navbar-item notifications dropdown is-right is-hoverable">
        <a href="javascript:;" class="dropdown-trigger has-text-centered" aria-haspopup="true"
           aria-controls="notification-menu">
            <span class="icon has-text-centered">
            <i class="fa fa-bell-o">
                <span v-if="count > 0" class="badge is-badge-danger is-badge-medium" :data-badge="count"
                      id="notificationcount"></span>
            </i>
            </span>
        </a>
        <div class="dropdown-menu notify-drop" v-if="messages.length > 0" id="notification-menu" role="menu">
            <div class="notify-drop-title">Notifications</div>
            <ul class="drop-content">
                <li v-for="message in messages">
                    <a>
                    <span v-bind:class="isType(message)">
                        <i class="fa fa-check-circle"></i>
                    </span>
                        {{ message.notification.title }}
                    </a>
                    <a @click="showModal = true">
                    <span class="icon menu">
                        <i class="fa fa-ellipsis-h">
                        </i>
                    </span>
                    </a>
                    <modal v-show="showModal" @close="showModal = false" :details="message.notification.details"></modal>
                </li>
            </ul>
            <div class="notify-drop-footer">
                <a @click="clearAll">Clear All</a>
                <a @click="markAllRead">Mark All as Read</a>
            </div>
        </div>
    </div>
</template>

<script>
    import modal from './modal.vue'

    export default {
        components: {
            'modal': modal,
        },

        props: {
            'notificationCount': {
                type: Number,
                required: true,
                default: 0,
            },

            'notifications': {
                type: Array,
                required: true,
                default: [],
            }
        },

        data() {
            return {
                count: this.notificationCount,
                messages: this.notifications,
                showModal: false,
            }
        },

        methods: {
            isType: function (message) {
                if (message.notification.type == 'success') {
                    return 'icon has-text-success';
                }

                return 'icon has-text-danger';

            },

            markAllRead: function () {
                axios.get('/user/notifications/markallread').then(
                    this.count = 0,
                )
            },

            clearAll: function () {
                axios.get('/user/notifications/destroyall').then(
                    response => this.messages = response.data,
                    this.count = 0,
                )
            }
        },

        mounted() {
            Echo.private("Eradmin.User.User." + userId)
                .listen(".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated", (data) => {
                    this.count = data.notification.count;
                    this.messages.unshift({notification: data.notification});
                });
        }
    }
</script>
<template>
    <div class="modal is-active">
        <div class="modal-background"></div>
        <div class="modal-card">
            <header class="modal-card-head">
                <span class="modal-card-title">Details</span>
            </header>
            <section class="modal-card-body">
                <pre>
                    <code>
                        {{ details }}
                    </code>
                </pre>
            </section>
            <footer class="modal-card-foot">
            </footer>
        </div>
        <button class="modal-close is-large" aria-label="close" @click="$emit('close')"></button>
    </div>
</template>

<script>
    export default {
        props: ['details'],
    }
</script>
01 Sep
1 year ago

mhankins left a reply on Redis Queue & Horizon

@troovers glad you figured it out. Should mark it as solved.

mhankins left a reply on Laravel Horizon - Dashboard Always Loading

Does it load without the snapshot daemon?

mhankins left a reply on Redis Queue & Horizon

Strange, I don't have any horizon apps currently deployed on Forge, but I do have a large app in production on Ubuntu. It works as expected with this config.

    'environments' => [
        'production' => [
            'supervisor-1' => [
                'connection' => 'redis',
                'queue' => ['default', 'import', 'order'],
                'balance' => 'auto',
                'processes' => 10,
                'tries' => 3,
            ],
        ],

        'local' => [
            'supervisor-1' => [
                'connection' => 'redis',
                'queue' => ['default', 'import', 'order'],
                'balance' => 'auto',
                'processes' => 10,
                'tries' => 3,
            ],
        ],
    ],

mhankins left a reply on Redis Queue & Horizon

I'm not sure why you have two supervisor configs in production.. I would try just one.

28 Aug
1 year ago

mhankins left a reply on Saving The Opened/closed Status Of A Sidebar

@Sturm Js-Cookie is surely the way to go here. I've encountered the delay you speak of and my solution was to alway start at a presumed closed state instead of open.

25 Aug
1 year ago

mhankins left a reply on Just Launched My Spark App: ZoneWatcher

Looks good. Thanks for sharing.

24 Aug
1 year ago

mhankins left a reply on Horizon Extend Backend

The best I can tell is it makes the Horizon dashboard available at /horizon and you can put that behind auth.

So I think the answer is no.

18 Aug
1 year ago

mhankins left a reply on Links To CSS Not Working

I don't see any code here to examine.

16 Nov
2 years ago

mhankins left a reply on Active Directory Single Sign On

First use the Facade to make sure it's setup correctly and communicating with AD.

dd(Adldap::getDefaultProvider()->search()->users()->find('mhankins'));

Then you can simply authorize against it just like you normally would.

        if (Auth::attempt($credentials, $request->has('remember'))) {
15 Nov
2 years ago

mhankins left a reply on Laracasts Refresh

Wow, great job. It's way easier to navigate now.

13 Jul
3 years ago

mhankins left a reply on Valet - Not Serving In Browser

@rossuhms I just fixed mine by running valet uninstall and then valet install. It's been working for weeks and just quit today.

mhankins left a reply on Valet - Not Serving In Browser

@rossuhms did you ever find a fix for this? I'm having the same problem.

28 Jun
3 years ago

mhankins started a new conversation Laracast Snippet

I don't know if it's possible, but I'd like the snippet integrated right into the site. I'm a subscriber, but I'd like to see them on the front page for kicks and stuff.

mhankins left a reply on Laravel 5.3 Wish List

Consider using Clipboard.js on the docs.

https://clipboardjs.com/

23 Jun
3 years ago

mhankins left a reply on Valet Not Starting Services

I had this problem after switching the domain. I ended up uninstalling and just using the default .dev to make it work.

mhankins left a reply on Phpstorm Plugin Suggestions

@willvincent thanks, I had not heard of those last two before.

mhankins started a new conversation Phpstorm Plugin Suggestions

What plugins do you use for phpstorm? I didn't see any suggestions in the videos.

21 Jun
3 years ago

mhankins left a reply on Sidebar Feed

This is going to be a css fix. Something like overflow-y: scroll.

16 Jun
3 years ago

mhankins started a new conversation Job Failed Method

What details can I pass along to the failed method on a job? I want to include some details for the user if possible. Any ideas?

    /**
     * Handle a job failure.
     *
     * @return void
     */
    public function failed()
    {
        $type = 'danger';

        $notification = [
            'type' => $type,
            'title' => 'Something went wrong.',
            'message' => 'Your pulled files for order #'.$this->order->order_num.' did not finish copying',
            'details' => '',
            'user_id' => $this->user_id,
        ];


        event(new OrdersCopied($notification));
    }

mhankins left a reply on Jquery Sortable Table

@jbowman99 Glad that worked. Could you mark it as solved?

mhankins left a reply on Jquery Sortable Table

That javascript looks wrong if you're using jquery sortable for a table.

https://johnny.github.io/jquery-sortable/#table

mhankins left a reply on Queue::failing Laravel 5

@tuitionio I'm in the same boat. I can't get either of these to fire.

mhankins left a reply on How Does Laravel Spark Work?

I think the video series can answer a lot of your questions.

https://laracasts.com/series/laravel-spark

Also, I think you have to purchase it first, but you afterwards you can spin up as many dev sites as you wish.

09 Jun
3 years ago

mhankins left a reply on Auth Facade In Layouts/app.blade.php

You can also use

Auth::user()->check()

Auth::user()->username;

mhankins left a reply on Homestead Not Loading The Page

Did you edit the hosts file in /etc/hosts?

192.168.10.10 eradmin.app
01 Jun
3 years ago

mhankins left a reply on Divide Collection Into Parts On Laravel

@jay_gorio that's an easier question to answer once you've figured out the query part. My path is always get the data I want and then figure out how to display it.

18 Apr
3 years ago

mhankins left a reply on Data Of Database Reachable From All Views

I assume you're extending a master layout in your sub-views (maybe not the best word for it), but if not start there. https://laravel.com/docs/5.1/blade#extending-a-layout

Next, check out view composers for sharing data across all of them. https://laravel.com/docs/5.1/views#sharing-data-with-all-views

14 Apr
3 years ago

mhankins left a reply on How To Use Blade @stack Syntax ?

I guess I'm confused about what you're trying to accomplish. I'm working on a L5.1 app right now and this is how I'm using @stack.

in my master layout, I have

        @yield('scripts')
        @stack('pageScripts')

in an extended view I have

@push('pageScripts')
<script type="text/javascript">
    var el = document.getElementById('subOrder');
    Sortable.create(el, {
        handle: '.fa-arrows',
        animation: 150,
        scroll: true, // or HTMLElement
        scrollSensitivity: 40, // px, how near the mouse must be to an edge to start scrolling.
        scrollSpeed: 15, // px
        store: {

            /**
             * Save the order of elements. Called onEnd (when the item is dropped).
             * @param {Sortable}  sortable
             */
            set: function (sortable) {
                var order = sortable.toArray();
                $('input[name=subOrder]').val(order);
            }
        }
    });
</script>
@endpush

mhankins left a reply on What's The Best Way To Reorder A Row And Change The Id Via Ajax?

I'd use something like http://farhadi.ir/projects/html5sortable/ and tie it in with ajax / laravel route.

mhankins left a reply on How Can I Not Validate A Password Field If It's Empty??

Most people don't require the password field if editing the user. I just make sure the new password is confirmed if I'm changing it.

https://laravel.com/docs/5.2/validation#rule-confirmed

mhankins left a reply on Spark Will Not Be Free

If you have ever had to write this stuff yourself, even using Laravel... I'd pay for it with out blinking an eye.

29 Mar
3 years ago

mhankins left a reply on New Design...

@JeffreyWay Very pleasing to the eye.

03 Mar
3 years ago

mhankins left a reply on Copy Large Directories (long Running Process)

Surely not the final version, but I just moved over 12GB's without a timeout.

    public function handle()
    {
        $process = new Process('rsync -azPH '.$this->src.' '.$this->dest);
        $process->setTimeout(3600);
        $process->start();

        while ($process->isRunning()) {
            $process->checkTimeout();
        }

        if (!$process->isSuccessful()) {
            echo $process->getOutput();
        }
    }
02 Mar
3 years ago

mhankins left a reply on Copy Large Directories (long Running Process)

Thanks @ohffs, We're definitely looking at an rsync task as a possibility. I would never put that big of a "band-aid" on. This is for a digital order system in the sense of Archives. Patrons submit an order for records and they're compiled on a share drive that the app then pulls them into web accessible folder.

@siteon I'm looking into that now, thank you.

mhankins started a new conversation Copy Large Directories (long Running Process)

I need to copy large amounts of data from one place to another. The largest directory I've tested in console took about 900s. The only way to accomplish this with my current implementation is to crank up the server timeout, but that seems ridiculous. I'm thinking I need to send those jobs to queues, but I can't map it out in my head passed that point. I guess what I'm trying to accomplish is getting around server timeouts. Any ideas?

22 Feb
3 years ago

mhankins left a reply on What Are You Working On?

I just finished a table preferences feature. We have around 30 different users who need to see different data depending on their task. Some of the tables have over 500k records and 30+ columns. So obviously, you don't want to execute that large query unless it's absolutely necessary.

(demo)[https://imgur.com/EjC88qK]

02 Jul
4 years ago

mhankins left a reply on Are Repositories Really The Way?

I use repositories completely wrong. I used them as wrappers for either complex query sets or interfacing with services I might one day swap out for another. I've always done it that way long before I was using Laravel. I prefer that slim controller and model look to my code.

21 May
4 years ago

mhankins left a reply on Socialite Best Practices With Multiple Providers

@isaackearl That's the inspiration I was looking for. Thanks for the example.

mhankins left a reply on Socialite Best Practices With Multiple Providers

I'm just kicking around edge case like:

User logs in with Google and two weeks later logs in with Twitter, but those two social providers don't share the same email account. Which would end up with two different users.

I've been doing something like this after querying the user logging in on email first and then provider / provider id.

    public function updateSocial($user, $data, $provider)
    {
        $user->email = $data->email;
        $user->avatar = $data->avatar;
        $user->provider = $provider;
        $user->provider_id = $data->id;
        $user->save();
    }

I think there will always be these edge cases, which might simply be solved by clearing alerting the user they're registering a new user or something like that.

20 May
4 years ago

mhankins started a new conversation Socialite Best Practices With Multiple Providers

What are the best practices for linking different social logins to one local user?

19 May
4 years ago

mhankins left a reply on How Can I Get Email From Github Using Socialite If Email In Profile Set To Private?

@El_Matella @sat_dev I think it only returns an email if it's public even if you have the user scope. That was the only way I could get it to work.

18 May
4 years ago

mhankins left a reply on Community Videos

I think you're better off doing something like guest tutorials. Even if it was something like package authors giving an in depth dive into their own work. It's great promotion for them and brand control for Laracasts. However, since my experience with video is almost zero, I can't take into perspective what the educational cost per guest tut would be.