packy

packy

Member Since 2 Years Ago

Experience Points 19,600
Experience
Level
Lessons Completed 162
Lessons
Completed
Best Reply Awards 1
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.

06 Dec
1 week 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
1 week 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
1 week 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
1 month 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
7 months 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
8 months 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.

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

@rin4ik thanks. I was just getting stuck up on if it made more sense to make the Data::all(); query in my controller for the view or an API controller. I guess they do the same thing so 1 request for the page is better than 2 for page and an API

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

@rin4ik is there any specific reason why? I assume less requests after page load?

packy started a new conversation Provide Data To Component Through Prop Or Request

I always find myself going back and forth on either passing my data through a prop and doing a request to an api. Is one specifically better, or faster? I know the reasoning behind an API in some cases is if I have to refresh the data but if the data is pretty much a static view should I pass it through a prop like:

<my-component :data="{{ $data }}"></my-component>

of just do a API GET request in the component?

packy left a reply on Add Wildcard Subdomains To Existing Sites

Okay for it to work you need to do 2 things:

First, set up your A record on your DNS so its host is * and it points to your server IP

Then, in your NGINX config file for the site you just need to change:

server_name mydomain.com;

to

server_name .mydomain.com;

Notice the . before the domain name. It should then work (might take a little time for the DNS to recognize it, but worked).

15 Mar
9 months ago

packy started a new conversation Forge Redirects On Children Pages

In a site on Forge on the left hand menu there is "Redirect" option. I have successfully add full url redirect but how do I target children pages?

I have done:

From: /old-page
To: /new-page
Type: Permanent

How do I do

From: /old-cat/*(all old posts slugs)
To: /new-cat
Type: Permanent 

packy started a new conversation Add Wildcard Subdomains To Existing Sites

How do I add Wildcard Subdomains to a site I already created? Do I have to edit the NGINX Config file?

I saw placing this in the server{} section: server_name ~^(.*)\.example\.com$ ; but wasnt sure. I have always used .htaccess so I am not too familiar with NGINX

07 Mar
9 months ago

packy left a reply on Forge Command Not Using Right URL

I just ran a test on production AFTER changing the APP_URL to https://mysite.com from http:mysite.com and it worked. Not sure if that was the issue or not. I also cleared config cache. Note this just send it to myself so when the scheduler does a mass one to all the users I hope it works. Dont see why it wouldnt unless it fails at some point and defaults to Localhost for some reason

packy left a reply on Forge Command Not Using Right URL

@m-rk I just made a command that sent that same notification to just me. Then uploaded it to production, SSH in and ran the command from the command line. It send me the email and correct URL.

I think this means its good and the bad URL in the env could have caused it, but I guess I will see then the scheduler runs at 11

packy left a reply on Forge Command Not Using Right URL

@m-rk it is run from Scheduler on forge. I can just create a new command that dumps the url and run it manually to test.

packy left a reply on Forge Command Not Using Right URL

@m-rk maybe that bad url in the env file caused? So since it was a command getting a notification that used url it fell back to localhost but from a controller it just used the bad url since there is no fallback?

packy left a reply on Forge Command Not Using Right URL

@m-rk hmmmm if I ssh in and go to boostrap/cache all is see when i ls is services.php

packy left a reply on Forge Command Not Using Right URL

Should I run php artisan config:cache?

packy left a reply on Forge Command Not Using Right URL

@m-rk Nope, my host returns the correct host mysite.com

packy left a reply on Forge Command Not Using Right URL

@m-rk I thought I had it in there but yes, from dev.mysite.com the command is ran and returns the correct URL from that apps env file

packy left a reply on Forge Command Not Using Right URL

@m-rk the only place in the code at all where there is localhost is in the .env.example file and in 'host' => 'localhost', in beanstalk. I dont think either should apply? I am just more baffled why it works in the dev site and from a controller but not a command since they all use the same notification

packy left a reply on Forge Command Not Using Right URL

@m-rk the url https:mysite.com/

packy left a reply on Forge Command Not Using Right URL

@mk also note I run php artisan cache:clear on my deploy script so that is not the issue.

packy left a reply on Forge Command Not Using Right URL

@m-rk I just noticed that url is incorrect but like I said that notification and url works when I run the notification manually from a controller. It only returns localhost when the notification is ran from a command.

packy started a new conversation Forge Command Not Using Right URL

This is quite frustrating. I have a command that runs a notification that uses the URL function to have a link in an email. When I use a function in controller and hit a route to send the notification the URL returns the correct link, when the command is run in dev.mystite.com the correct URL is ran, when the command is ran on the production site it returns http://localhost

The part of the notication with the URL ->action('View WOD', url( 'leagues/' . $this->league->id) );

My ENV file on production server APP_URL=https:mysite.com/

My app config file 'url' => env('APP_URL'),

What I have already checked:

-I deleted the defualt site -I deleted the scheduler that ran on the default site -I checked both env files for the 2 sites (production is https:mysite.com/ and dev is https://dev.mysite.com.com/) -I cant find any reference to localhost -Notification DO use right URL from Dev site -Notification DO use right URL on production when ran from controller -Notifications DO NOT use right URL when ran from command in production

What is going on? Where is it finding localhost and why would a notification use the right url from a controller but not a command???

04 Mar
9 months ago

packy left a reply on Delete Default Site

Perfect. I just did it and my site seems to be fine. Just wasnt sure if anything would be lost by deleting it.

packy started a new conversation Delete Default Site

I have set up my server on forge and now have my 2 domains attached (so there is default, mysite.com and dev.mysite.com). Do I now delete the "default" site? All the my repos are hooked up and databases. The reason I ask is some commands I made to schedule emails have been using the url() function and it returns the default env settings and not mysite.com ones so I think I should delete the default site. Just want to make sure that doesnt mess anything up.

01 Mar
9 months ago

packy left a reply on URL Generated In A Queue - Localhost Returned Instead Of Production Server

Thanks @natcave I just deleted the default scheduler and updated that env file too. Hopefully it works. Seems like an issue that Forge should resolve since its confusing to find that old env url

21 Feb
9 months ago

packy started a new conversation Job Opportunity

Is there any where to place a job opportunity for Laravel Developers thats free? I know about https://larajobs.com/ which seems good for when my product launches to find talent, but right now I just have a project that is done that needs a new Dev to take it over for updates, features, misc. The clients are great and pay well/on time I just dont have any more free time to keep working on it.

20 Feb
9 months ago

packy left a reply on Function To Dynamically Make Routes

@wilk_randall Thats just what I was looking for. Should have read the docs more clear

packy started a new conversation Function To Dynamically Make Routes

Has anyone ever made a function to create routes? For instance I am making a custom CRUD (cant use a stock one like Backpack since its pretty complex) but all the routes for all my models follow the same structure:

in my Admin.php (for admin routes)

Route::get('coach', '[email protected]')->name('coach');
    Route::get('coach/create', '[email protected]')->name('coach.create');
    Route::post('coach/create', '[email protected]')->name('coach.store');
    Route::get('coach/{coach}/preview', '[email protected]')->name('coach.show');
    Route::get('coach/{coach}', '[email protected]')->name('coach.edit');
    Route::post('coach/{coach}/update', '[email protected]')->name('coach.update');
    Route::get('coach/{coach}/destroy', '[email protected]')->name('coach.destroy');

    Route::get('program', '[email protected]')->name('program');
    Route::get('program/create', '[email protected]')->name('program.create');
    Route::post('program/create', '[email protected]')->name('program.store');
    Route::get('program/{program}/preview', '[email protected]')->name('program.show');
    Route::get('program/{program}', '[email protected]edit')->name('program.edit');
    Route::post('program/{program}/update', '[email protected]')->name('program.update');
    Route::get('program/{program}/destroy', '[email protected]')->name('program.destroy');

As you can see the routes are the exact same minus coach and program. I have like 10 more models so dont want a billion routes. Seems like a good time for a function like:

makeRoute('program', 'AdminProgramController');

and it would generate all the routes. Has anyone done this? I know it could be done, just not sure where to put it or any best practice.

15 Feb
10 months ago

packy started a new conversation Laravel HTML Table Generator

Is there any good HTML table generators for Laravel? I found https://github.com/lloricode/laravel-html-table that generates a table great by passing in my model from the controller and spitting it out in the blade template but there is no way to and a link in the table. I would image for building a CRUD admin there would be some solution where I can pass in a model like Users in a controller:

$model  = 'App\User';
        $title  = ['Name'];
        $fields = ['name'];

        
        return view('admin.dashboard',
        [
            'title' => $title,
            'model' => $model,
            'fields' => $fields
        ]);

then in the view spit out a table with a link to the id:

{!! Table::generateTableFromModel(
                $title, 
                $model,
                $fields, 
                20) 
            !!}   

            {{ Table::links() }}
12 Feb
10 months ago

packy left a reply on Scheduler Isnt Running Commands

I got it working. I had another scheduler that was bogus on the same server so it looked like it prevented this one to run. When I deleted the bogus one I started getting the expected output.

packy started a new conversation Scheduler Isnt Running Commands

I have 4 commands that work locally by running php artisan schedule:run but when I set up my Forge scheduller they never run??

My site lets say is called dev.coolsite.com. So I have my scheduler going every minute 245270 Every Minute * * * * * forge php /home/forge/dev.coolsite.com/artisan schedule:run. But nothing ever runs. I know the commands are correct because they run locally. What is going wrong?

09 Feb
10 months ago

packy started a new conversation User Avatar: Store URL Or Generate

I was in a discussion with @arthurvillar about adding avatar field to the user database. He mentioned he doesn't store the url path but generates it:

"Well, if you can make a unique filename based on the user's name (or a username) why would you add another column for that? On the model you can add a getAvatarAttribute (or even just a simple function) and create a simple logic to have that name included in your object without having to worry about it in creating, updating, validating, etc."

I always stored the full url path to my Spaces bucket in avatar field on the user table. Is there any benefit to using one way or the other? Or a best practice?

08 Feb
10 months ago

packy left a reply on Name Vs First And Last

I never thought of doing it that way. I just always stored the avatar image path in a column.

packy left a reply on Name Vs First And Last

That all makes sense. I will probably end up adopting just name from here on out. As for the avatar column I just imagined pretty much all apps have the user having some sort of image. I dont think you need to hash the file name, I was just reffering to the Users table having an avatar or image column in general

packy started a new conversation Name Vs First And Last

I have been wondering about this for a while. Every fresh install I do for an App I always end up changing the name field to first_name and last_name. Is there any reason Laravel doesnt do this already? Should I just use name. I notice most the time I never have too many situations where I can list the users by first name or last name, I have just always done that.

I also end up adding avatar to users ... I feel like this should be included these days.

26 Jan
10 months ago

packy left a reply on Best Practice Controller Methods

Thanks everyone. Now that I am going through all my routes I can see some new controllers popping up in my mind. I was always kind of under the assumption of a Controller had to have a Model associated with it.

packy left a reply on Using V-if To Render One Template Or Another Based On A Props

@wilk_randall Yep, that was on oversight on mine in the code section but what I was explaining below it.

I just tested this out and it worked in my system:

<test :user="{{ Auth::user() ? Auth::user() : 'false' }}"></test>

<template>

  <div>

     <p v-if="user">user</p>
     <p v-else>test</p>

  </div>

</template>

<script>

    export default {

        props:[
          'user'
        ],

    }
</script>
25 Jan
10 months ago

packy left a reply on Using V-if To Render One Template Or Another Based On A Props

Maybe try this:

<div class="panel-footer">

    <chat-form
        v-on:messagesent="addMessage"
        :user="{{ Auth::user() ? Auth::user() : false }}">
    </chat-form>

</div>

then:

<template>
    
    <div v-if="user">
        ... chat html WITH a send button ...
    </div>

    <div v-else>
        ... chat html WITHOUT a send button ...
    </div>
    
</template>


<script>

    export default {
        props: ['user'],

    ... other stuff ...
    }
</script>

I am wondering if there was to things:

1.) false being sent as a string not a boolean

2.)a vue component should only have one main wrapper (it looked like in yours you had two templates with no parent around them both)

packy left a reply on Using V-if To Render One Template Or Another Based On A Props

Maybe try this:

    <div class="panel-footer">

               <chat-form
                        v-on:messagesent="addMessage"
                        :user="{{ Auth::user() ? Auth::user() : false }}">
        </chat-form>

        </div>

then:

<template v-if="user !== false">
    
    <div v-if="user">
        ... chat html WITH a send button ...
    </div>

    <div v-else>
        ... chat html WITHOUT a send button ...
    </div>
    
</template>


<script>

    export default {
        props: ['user'],

    ... other stuff ...
    }
</script>

I am wondering if there was to things:

1.) false being sent as a string not a boolean

2.)a vue component should only have one main wrapper (it looked like in yours you had two templates with no parent around them both)