twg_

Freelance Web Developer at ThatWebGuy

Member Since 4 Years Ago

Experience Points
25,720
Total
Experience

4,280 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
185
Lessons
Completed
Best Reply Awards
0
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.

Level 6
25,720 XP
Feb
13
1 week ago
Activity icon

Started a new Conversation Nova Polymorphic Many-To-Many Issue

I evidently cannot figure out how to setup a polymorphic many-to-many relationship in Nova. I have 3 tables: items, item_category and item_categories.

Items Table

id
title
price

Item Categories Table

id
name

Item Category Table

item_id
item_category_id

Here is my Nova Files: Item

public function fields(Request $request)
{
    return [
        ID::make(),
        MorphToMany::make('Categories', itemCategories'),
    ];
}

ItemCategory

public function fields(Request $request)
{
    return [
        ID::make(),
        MorphToMany::make('Items', items'),
    ];
}

Here are my models: Item

public function categories()
{
    return $this->morphToMany(\App\Models\ItemCategory::class, 'item_category');
}

ItemCategory

public function items()
{
    return $this->morphToMany(\App\Models\Item::class, 'item');
}
Dec
18
2 months ago
Activity icon

Started a new Conversation Error When Mixing JS

I have 3 JS files in my project. When I try to mix them into a single js file, I get undefined.

  1. site.js - compiles fine by itself
  2. slider.js - compiles fine by itself as well.
  3. lightbox.js - will not compile.

site.js contents

import Lightbox from './components/lightbox'
import { slider_plugin } from './components/slider'

..... other simple inline js

slider.js contents (condensed)

function slider_plugin() { ... }

export default { slider_plugin }

lightbox.js contents (condensed)

import '../../../node_modules/swipe/swipejs/swipe'
export default Lightbox { ... }

Whenever I run npm run production I get a file with just undefined inside it.

Also, I'm using laravel mix outside of laravel.

Dec
16
2 months ago
Activity icon

Awarded Best Reply on Scheduled Tasks

I thought that if I ran the schedule:run it would trigger my tasks to run. I quickly figured out that was not the case. I was able to sort everything out. Thanks.

Activity icon

Replied to Scheduled Tasks

I thought that if I ran the schedule:run it would trigger my tasks to run. I quickly figured out that was not the case. I was able to sort everything out. Thanks.

Activity icon

Started a new Conversation Scheduled Tasks

I've gone through and created two new commands that I need ran on a daily and monthly basis. I then went into the app\console\kernel.php file and set them up in the schedule function. When I try to run php artisan schedule:run locally or by adding it to Forge's Schedule section, I get this error. What am I doing wrong?

No scheduled commands are ready to run.

Nov
20
3 months ago
Activity icon

Started a new Conversation Data Encryption

I'm create a small sass application and I want to encrypt the end users data and then decrypt it when they login to view it. I found an article that had a plugin for Laravel that would do it. It was based on the user's hashed password.

I'm trying to create a way because my app will have different tiers which include how many logins are allowed on each one. I need any logins associated with main account to be able to decrypt the data.

Any suggestions on what I should be looking into?

Nov
07
3 months ago
Activity icon

Started a new Conversation Symphony Process

I'm trying to run a terminal command using Symfony Processes but can't seem to get phantomjs to run. I've checked the user the command is running as and it's the same as when I actually run it from my terminal window. I can run the same version from my terminal and it runs just fine.

Oct
26
3 months ago
Activity icon

Started a new Conversation Regression Testing With Laravel

I've seen articles where I can test for regression inside my Laravel app but I'm trying to build a small app for internal use that will allow me to test for changes on many sites that I own. I have 130+ editors that I need to watch to see changes to their site to see if it correlates with any drop in their views.

I found a plugin called Laravel Visual Diff by BeyondCode but it hasn't been updated in a year and does not work with Laravel 6.4.

Has anyone else come across a plugin or created something similar?

Oct
04
4 months ago
Activity icon

Started a new Conversation Add Task To Mix To Call API

I'm currently using Laravel Mix to build my site css & js. After I build it I have to either upload it to my dev or prod site depending on what I'm doing.

Is there a way that I could call an API to upload the new JS & CSS to the correct instance so I can cut out a manual step?

Sep
26
4 months ago
Activity icon

Replied to Convert Gulp Task To Webpack

Yeah I'm wanting to recreate this gulp task in webpack.

gulp.task('prefix', function(done) {
    var prefix = gutil.env.p || gutil.env.prefix || false;

    if(!prefix) {
        return done();
    }

    gutil.log("Replacing prefix 'uk' with '"+prefix+"'");

    gulp.src(['./dist/**/*.css', './dist/**/*.less', './dist/**/*.scss', './dist/**/*.js'])
        .pipe(replace(/(uk-([a-z\d\-]+))/g, prefix+'-'))
        .pipe(replace(/data-uk-/g, 'data-'+prefix+'-'))
        .pipe(replace(/UIkit2/g, 'UIkit2'+prefix))
        .pipe(gulp.dest('./dist'))
        .on('end', done);
});
Sep
25
4 months ago
Activity icon

Started a new Conversation Convert Gulp Task To Webpack

Hi,

I'm not sure if this is possible or not but I was wondering if there is a way to go through a file(s) replace a prefix in SCSS & JS. I've seen it done in UIKit v2 but it's in gulp.

Sep
09
5 months ago
Activity icon

Started a new Conversation Updating Database On JQuery.ajax Call

Hi,

I have implemented drag-n-drop order of some items but I'm trying to figure out how to implement the model update.

Here is an example of the data I'm posting:

[
    'pages' => [
        { id: "10", children: [] },
        { id: "15", children: [] },
        { id: "2", children: [
            { id: "4" },
            { id: "5" }
        ]},
        { id: "8", children: [] }
    ]
]

In my controller I'm checking to make sure that $request->has('pages') but after that I'm not 100% sure how to loop through the id's and update their appropriate data entry with the order they are in and then how to update the children items the same with but with also the parent id that it's inside.

Sep
07
5 months ago
Activity icon

Started a new Conversation Drag-n-drop Sorting With Child Elements

Hi,

I have a basic drap-n-drop working without any children and when it's moved, the database is updated. I'm having an issue figuring out how to update the database when a element is dragged as a child.

Has anyone done this before with Laravel & jQuery Sortable.

Aug
27
5 months ago
Activity icon

Started a new Conversation Mix Specific Files Based On Flag

I was wondering if I could use a single webpack.mix.js file to mix all of my files for each sub section of my website. I have all fo the files living inside a global project but I would like to only mix certain ones when I need to without having to wait for them all to mix each time.