packy

packy

Member Since 3 Years Ago

Coeur d’ Alene

Experience Points 24,920
Experience Level 5

80 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 205
Lessons
Completed
Best Reply Awards 1
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.

21 Jul
1 day ago

packy left a reply on Tailwind @apply In My Vue Components Styles Block

I was incorrect, that class had a misspelling so when I changed that and removed lang=scss it worked fine

20 Jul
2 days ago

packy left a reply on Tailwind @apply In My Vue Components Styles Block

With that I get You may need an additional loader to handle the result of these loaders. My Mix looks like mix.js('resources/js/myersnw.js', 'public/js') .sass('resources/sass/myersnw.scss', 'public/css') .options({ processCssUrls: false, postCss: [tailwindcss('./tailwind.config.js')], });

packy left a reply on Tailwind @apply In My Vue Components Styles Block

Sorry, forgot to mention I added that in the config. It works in a blade template. It causes that error for any class you add @apply to within the style section of a cue component. Probably has to do with the mix / webpack config

packy started a new conversation Tailwind @apply In My Vue Components Styles Block

How can I use @apply in my Vue compoennt tag? I get this error everytime?

`@apply` cannot be used with `.border-primary` because `.border-primary` either cannot be found, or its actual definition includes a pseudo-selector like :hover, :active, etc. If you're sure that `.border-primary` exists, make sure that any `@import` statements are being properly processed *before* Tailwind CSS sees your CSS, as `@apply` can only be used for classes in the same CSS tree.

I know its something with the mix configuration but not sure what to change

10 Jul
1 week ago

packy started a new conversation E-commerce Package With No Front-end

Is there any good packages to add e-commerce or tutorials that dont have a front end? I am building a website where a store will be a small part of the site so I dont want a full out-of-the-box solution since I have my whole frontend and admin already. What would be nice is a proven package where I can just use migrations and functions where I need and do all the front-end and admin on my own.

16 May
2 months ago

packy left a reply on OrWhereHas Cancelling Out My Other Condition

@BOBBYBOUWMANN - Sorry, I may have not explained it get enough. What I want the end result to be is all promos between the date ranges where the user is either: a.) the owner_id or b.) a member. So the list would be all there promos they are a part of between a date range.

The promo table has the owner_id and the members_promo table is just a pivot with user_id and promo_id

packy started a new conversation OrWhereHas Cancelling Out My Other Condition

So I am trying to a query the is filtered by a date range. The issue is I need to do a orWhereHas query as well that cancels out mywhereBetween.

So I have 2 tables Promos and Member_Promo. To get the upcoming promos for a user I use a function like Auth::user()->upcomingPromos('ytd'). The function looks like:

public function upcomingPromos($type)
    {
        switch ($type) {
            case 'ytd':
                $range = [Carbon::today(), Carbon::now()->endOfYear()];
                break;

            case 'mtd':
                $range = [Carbon::today(), Carbon::now()->endOfMonth()];
                break;
        }


        return Promo::where('owner_id', $this->id)
            ->whereBetween('date', $range)
            ->orWhereHas('members', function ($query) {
                $query->where('user_id', $this->id);
            })
            ->oldest('date')
            ->get();
    }

So basically what it should do is get all the promos a user owns or is part of from today to the end of the year or end of the month. The issue stems from the orWhereHas is not limiting that query by the date range. So if a user is a member of a promo that is not in that range it still returns when it should not.

29 Apr
2 months ago

packy started a new conversation Allow Users To Accept Payments

I have done a few apps in the past where we just charge for a service. You give us $10 a month, and you get access to the site/content (like Laracasts). I have been looking at creating a new venture that allows the users to accept payments. Basically it would be a management software for a specific industry that a user can use an array of features to help their business and also collect money. I know how to do this if I was personally collecting the cash: add Laravel Cashier, my stripe info and boom its more or less done. But how do you do it for multiple people? Make them get their stripe account and store their keys in the database? That doesn't sound to secure. Or do you just use your stripe account and setup the clients as customers in stripe then pay them from your account? That seems like it could get very murky if something happened and you were not sure who you owe.

Anyone have any experience in this or know some articles to read on how this is setup? Lots of software allow that but havent found anything via Google on how to set it up.

23 Apr
2 months ago

packy left a reply on Scope Filter Relationship And Where Clause

@snapey so I just chained the filter on the relationship in the controller:

 $accounts = auth()->user()->accounts()->filter($filters);

So at that point the builder is using only the user accounts. Then I just had to change how the filters worked:


    protected function name($name)
    {

        return  $this->builder->where('name',  'like', '%' . $name . '%')->take(5)->get();
    }

22 Apr
3 months ago

packy left a reply on Scope Filter Relationship And Where Clause

@snapey I guess that is my question. The filters work if I was looking for all the accounts, not just the users. How do I filter based upon just the users accounts?

packy left a reply on Scope Filter Relationship And Where Clause

public function accounts()
    {
        return $this->belongsToMany(Account::class)->orderBy('name');
    }

Do Auth::user()->accounts()->get(); works in the controller but not when in the filter:

AccountController

/**
     * Fetch all relevant username.
     *
     * @return mixed
     */
    public function index(AccountFilters $filters)
    {
        $accounts = $this->getAccounts($filters);

        return $accounts;
    }

    /**
     * Fetch all relevant threads.
     *
     * @param AccountFilters $filters
     * @return mixed
     */
    protected function getAccounts(AccountFilters $filters)
    {
        $accounts = Account::filter($filters);

        return $accounts->paginate(100);
    }

packy left a reply on Scope Filter Relationship And Where Clause

@snapey when I use the relationship like you do in the filter it returns all the accounts, not just that users

packy left a reply on Scope Filter Relationship And Where Clause

@snapey I was just following how Jeffery did scope filters in the series "Lets make a forum" using the builder. And yes, Accounts have many users and users have many accouts.

packy started a new conversation Scope Filter Relationship And Where Clause

So I am doing a scope filter on a model Account. An account has many users. I am trying to get all the accounts that user has and then filter down by the name. Basically its a live search a user can do within their accounts page.

This works fine to get all the accounts a user has:

 protected function all($username)
    {
        $user = Auth::user();
        return $this->builder->whereHas('users', function ($query) use ($user) {
            $query->where('user_id', $user->id);
        })->get();
    }

This searches all accounts by name fine (but a users should only be able to search their accounts, not all accounts)

protected function name($name)
    {
        

        return $this->builder->where('name', 'LIKE', "% $name% ")
            ->take(5)
            ->get();
    }

What I tried that doesnt work:

protected function name($name)
    {
        $user = Auth::user();

        return $this->builder->whereHas('users', function ($query) use ($user) {
            $query->where('user_id', $user->id);
        })
            ->where('name', 'LIKE', "% $name% ")
            ->take(5)
            ->get();
    }
16 Apr
3 months ago

packy left a reply on H1 Tag In Component Is Never Found By SEO Checker

Thanks. I will just use Google Insights. I think the client, and myself, just like seeing some kind of hard numbers to show improvement on the site (page speed, better structure, more modern techniques, ect).

packy left a reply on H1 Tag In Component Is Never Found By SEO Checker

That makes sense. Is there any checkers that do? I like to check my pages to show clients improved pages from their old site. I know my sites visually and structurally are better but if some Vue components dont get counted its hard to. Or should you just keep h1 tags in slots?

packy started a new conversation H1 Tag In Component Is Never Found By SEO Checker

I have a lot of website where I have a hero image that is basically full viewport height with a title and sub text. I use a view component so I can use vue-lazyload to lazy load the BG hero image. The only issue is every SEO checker (https://sitechecker.pro, https://www.seobility.net) I use says there is no H1 tag even though there is. I imagine its because its in a Vue component? but why would that not show up for the checker? It for sure shows up on the page.

<template>
    <div class="home-hero lazy" v-lazy:background-image="image">
        <div class="overlay"></div>

        <div class="home-hero--content">
            <h1 v-text="title"></h1>

            <p v-text="text"></p>
        </div>
    </div>
</template>

<script>
export default {
    props: ["title", "text", "image"]
};
</script>
10 Apr
3 months ago

packy started a new conversation Best Practice On What To Store In DB

I am just wondering if there is a "best practice" or "rule of thumb" on what to store in the DB and what to just generate using a function.

Example:

I have a public facing page in my app for events a user can share. Since I dont want to expose the id, and dont see a need for a slug, I use a UUID for the URL. I like to use Bitly for sharing URLs since its easier to share, you can track clicks ect. So my long link of https://mysite.com/public/event/a23234n532 is now http://bit.ly/wPKks. Now I only use this link in my app when someone wants to share within the app.

The Question: Should I store the Bitly link in the DB so I just do model->bitly or just create a helper function that generates it when needed?

In my mind I would just store it when an event is created because why not? It doesnt change. But is there pros and cons?

20 Mar
4 months ago

packy left a reply on Use UUID Vs Auto Increment ID

@bobbybouwmann Thanks. I generally never use ID in the URL as is and always generate some slug. Just was not sure if there was some other reasons to not use an ID but for an app my size it seems like more of a hassle than beneficial

packy started a new conversation Use UUID Vs Auto Increment ID

Is using a UUID better than an Auto Increment ID? I have read using UUID is better to hide total number of entries (ie if you have and id of 150 exposed somewhere, anyone can tell there was 149 other entries) and you can migrate databases easier since UUID are more unique. My app is really small so I dont think I need it now, but dont want to shoot myself in the foot and curios peoples thoughts.

14 Mar
4 months ago

packy left a reply on Vue Login Vs Standard Form

@WILK_RANDALL - That was my thought too but some people make it seem like a really bad idea so was not sure if I was missing something?

https://laracasts.com/discuss/channels/vue/vuejs-and-laravel-authentication#reply-121093

packy started a new conversation Vue Login Vs Standard Form

What are the downsides to using a Vue component with an Axios call to login? I have seen a few forum comments just hating on using Vue to do this and not just the "out of the box" solution. In my opinion I always use Vue for any form since I think its a better user experience to not refresh the page and provide error / success / loading messages from what the API returns. Even this site seems to use a modal with Vue to log you in so wasn't sure if there was any real benefits to using the Laravel views other than its just already made considering you use the same controllers and pass a csrf token with your request using Vue

References:

https://laracasts.com/discuss/channels/vue/vuejs-and-laravel-authentication https://laracasts.com/discuss/channels/vue/laravel-vuejs-auth?page=1

01 Mar
4 months ago

packy left a reply on Laravel Helpers In Vue

Thanks @tykus . This seems to be what I need to do

packy left a reply on Laravel Helpers In Vue

How do you mean? When I usually get an index of a model i just return the whole model like:

public function index(){
    $projects = Project::all();
 
   return response()->json($projects, 200);
}

Should I just add a Accessor on the model to return the full url for lets say project->image

packy started a new conversation Laravel Helpers In Vue

So I prefer to make a lot of my front side with Vue as opposed to PHP. What I mean is if I have a list for instance, I will make a list component in Vue and not Blade @foreach so I can use components like "pull to refesh" or "infante scroll". I even prefer doing a whole front end in a Vue SPA these days. My question though is I still reach for some helpers from Laravel like storage to get the right URL to my files. What is the best practice for loading some of those nice helpers to Vue? Should I add a window variable to the head like window.storage = {{ Storage::url() }}

20 Feb
5 months ago

packy left a reply on Minimum Job Size

Good points @jlrdw . I do try and do 1-2 projects for non profits free of charge a year. Its navigating paying clients cost expectations that gets hard. I have clients that know dev costs so they get the price tag, and others who look at a Wix site and dont get why its over 2k to do a custom one. Just trying to figure out a good way to better explain before a full bid and breakdown but maybe there is no good way without looking like a jerk haha. Thanks for your feedback, it helped.

packy left a reply on Minimum Job Size

@JLRDW - Read my last comment. My concern I guess is not the job size per say but expectations. In your scenario what I see that happens a lot is a person wants a whole building plumbed but thought it would only cost $90 and when they see a bid for 100k they are shocked and confused. Thats why I was rethinking it and maybe doing what the budget was for a past app so people kind of have an idea of what things could cost

packy left a reply on Minimum Job Size

Maybe a better route would be just listing the average budget for past projects so a client knows kind of what to expect? Its not really that I want a minimum spend, I just dont want clients getting sticker shock and us both wasting time if their expectations are lower.

packy left a reply on Minimum Job Size

@JLRDW - No, I think you are missing the point. I have seen bigger agencies have minimum project sizes based on money. I would never over charge someone, I just wouldnt take a job to make a small WordPress site or blog. I think the point I have is some people ask to build this app that does a ton of stuff and are expecting it to cost 1-3k and based on my hourly and scope i say its more like 20k ... they are shocked. They are free to find anyone they can that would do it in their budget. Just seems it would save some time on both our ends if they were not even expecting something like an app could cost that.

packy started a new conversation Minimum Job Size

I have been a freelancer for a few years now (around 6). Lately I have been doing bigger jobs, which is great, but when I quote some smaller local projects people get sticker shock. On average I do jobs in the 20k-60k range. Since they are bigger I also like to have a few clients a year, with no real overlap. My question is it okay to tell a prospective client, before a formal bid, that we have a minimum job size of like 20k? I just dont want to get their hopes up, waste my time doing a proposal (which take a while since I do some research and designs to show) and have them feeling sticker shock.

23 Jan
5 months ago

packy left a reply on DB Schema: Multiple Choice And Fill In The Blank Q & A

@DRFRAKER - For the “Fill in the blank” the user will supply the answer and it will only relate to that user. For the “multiple choice” the answers are pre populated by the admin so will apply to many users.

packy left a reply on DB Schema: Multiple Choice And Fill In The Blank Q & A

@TRAY2 - I get what you are saying. There will likely be a lot soon with the app launching in larger markets that are already signed up

packy started a new conversation DB Schema: Multiple Choice And Fill In The Blank Q & A

I am creating an app where one part of the application has a piece of content, say similar to a blog post, and at the bottom there is a set of questions. The questions can be multiple choice or fill in the blank. They are all required. There are no right answers. My idea is to have a simple DB structure that grabs pre populated answers if the question type is multiple choice and lets the user add an entry to the answer table if its fill in the blank. Then what ever they select or write is associated to the user in a join table:

Questions

```id  :  content_id  :  body  :  type. :  created_at  :  updated_at```

Answers

id : question_id : body : created_at : updated_at

Answer_User

```answer_id  :  user_id```

Does this seem like a good solution? Is there other ways people have done this in the past?

packy started a new conversation App Flow Design Program

Does anyone know any good programs for visually designing application workflows? Basically right now I use Mindnode 5 which works to get my flow on paper but I would like something more visually appealing to better explain how an app works to clients/investors/developers. It is super beneficial for database design and UI design to map out the whole application (flow, gateways, forms, secure areas, uploads, ect). I have seen images on other developers sites like the one below that look perfect but not sure how they were created? Is there a good program or are they just using something like Illustrator/Sketch/XD?

https://tighten.co/assets/img/case-studies/telehealth/telehealth_ia_docs_1b.jpg

08 Jan
6 months ago

packy left a reply on Server Help

@snapey Thats what I was thinking, Using Pusher to check my DB for new content and having my site pull the data from the client server every 30seconds to update my DB similar to this how you do it with a 3rd party API (https://medium.com/@jeffochoa/consuming-third-pary-apis-with-laravel-resources-c13a0c7dc945)

packy started a new conversation Server Help

I am looking at helping a company do a demo at a tradeshow by making them a website that displays a set of stats thats constantly being updated. They are concerned with running the site on their servers since they have some much going on with their current user load through various products. The thought is:

My Laravel site does an API call to their server every 30 seconds. If their server returns json with a time stamp on when it was updated If its new data I can save it in my DB I display the data from my DB The site it self is very basic. 2 images and a table of the data.

I am using Laravel and Vue to handle everything.

Is it best to save the data in a DB or just as a JSON file in the app? We are looking at 2k concurrent users for a few days. My original thought was a 16 GB 6 vCPUs 320 GB 6 TB server from DigitalOcean.

Does this seem enough? Is storing in the DB or as a file lower risk of the server failing?

Not sure if this is the right Stack Exchange site to ask, if not please let me know. I usually just use this for coding questions.

06 Dec
7 months ago

packy left a reply on Settings Package

Thanks! I would like to even make my own package to submit for everyone, but like I said I have only build for myself, never a community

packy left a reply on Settings Package

Thanks @zak . I found this: https://github.com/akiyamaSM/laravel-nova-configuration that might work pretty good or I can use it to jump off my own package (although I have never made a public one)

packy left a reply on Settings Package

@zak how would you do an image though? Would you have to paste in a URL? The other way I have done settings in the db has an actual upload option so it: uploads the image to my storage option I have set, returns the URL and then saves it into the DB. I wouldnt want a client to have to go to Digital Ocean, login, find the right folder, upload, grab the URL and then paste that into a file.

packy left a reply on Settings Package

@zak I will give it read. i usually store them in the DB so clients can easily change, lets say their address or their logo if they update their brand. Backpacks settings package their would be a field column on the table that you could set to image for instance so when you went to edit the setting it was an upload field. Made it very convenient on project handoff to give global options.

packy started a new conversation Settings Package

Does anyone know a good package or DB structure for application settings? I am coming from Laravel Backpack and they had a good one (https://github.com/Laravel-Backpack/Settings) so you could add images, text, ect. for generic site use (like site tittle, logo, description, ect). I could just make a settings table based off the backpack one but wasnt sure if there was something already out there I havent found via Google or Nova Packages

05 Dec
7 months ago

packy left a reply on Split Users And Profiles Into 2 Different Tables

@snapey that makes sense. I have just heard people splitting account information and profile information since you may not need the profile information every call. And for the Avatar thing, I know admins could have them but I have yet to build an app where any admin uses an avatar. They just put in the smallest amount of info required.

04 Dec
7 months ago

packy started a new conversation Dynamic Page Contsturction

Has anyone had any dynamic page builders with nova? In my app I have videos, links, files, questions (multiple choice), ect that are all put together to make 1 post. So as an admin when you make a "post" you should be able to add some text, then a question (from the db), a video, more text, and so on. In my mind the "Post" body field will just store basically the template the user just made with blade syntax but I am having trouble figuring out where to start. Maybe a custom tool with a bunch of "add" buttons that help generate this? Has anyone done something like this??

packy started a new conversation Split Users And Profiles Into 2 Different Tables

Is it better to always split users and profiles into 2 different tables? I always wonder this since some user information doesn't ever pertain to "admins" in my applications. For instance in one app a user with a role of "general" should have an: avatar, birthdate, motto, address and mood. For users with a role of "admin", non of this matters or will ever apply to them. So do you make 2 tables or just one and the admin users will just have some fields with NULL?

04 Nov
8 months ago

packy started a new conversation New Content

Is there a roadmap of new content coming to the site somewhere? I have seen the 5.7 videos come out, but for more advanced users there hasn’t been much. Would love to see a Nova series or more Vue.js stuff. Also very excited to see the new site. The teaser video was a month ago so I eagerly hit refresh all the time in anticipation haha.

15 May
1 year ago

packy left a reply on Best SQL Client

@m-rk no problem. Its the closest to feel I have found as Sequel Pro

packy left a reply on Best SQL Client

@m-rk I use VS Code (after years of switching around its the only one I have liked enough to stay with). After messing around with a few clients, Querious 2 has looked promising but only been messing around for a day.

packy left a reply on Best SQL Client

@m-rk Ya I have been reading through threads and waiting for an official release. Didnt know I could download a test build. Is it stable?

packy started a new conversation Best SQL Client

Currently I use Sequel Pro and find it works for what I need. I primarily use it for inspecting my DB, make a quick edit in content when developing, and exporting my data from staging to production on launch. One thing I have noticed is sometimes my tables will have a JSON column. When you export a SQL file with just the content and then try and import the data when there was a JSON column you get an error:

Cannot create a JSON value from a string with CHARACTER SET 'binary'.

This is forcing me to look at other options until they fix it. Right now I saw:

-Querious 2 -TablePlus

Anyone have any preference or suggestions for OS X? Honestly Sequel Pro is perfect besides that so something simple and native would be great.

28 Mar
1 year ago

packy left a reply on Provide Data To Component Through Prop Or Request

Okay. So if I need $data in the page as well then pass it as a prop to my Vue component too. If all I am doing is using $data for the Vue component, then do an API request.