fraserk

Member Since 5 Years Ago

Brooklyn

Experience Points 72,710
Experience Level 15

2,290 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 520
Lessons
Completed
Best Reply Awards 43
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.

15 Aug
3 days ago

fraserk left a reply on Load Localstorage To State On Load (Vuex)

I have used the Vue-presist plugin to accomplish this in the past. It basically saves the state to localstorage and autoloads it when the page is created.

https://github.com/championswimmer/vuex-persist/blob/master/README.md

26 Jul
3 weeks ago

fraserk left a reply on [Vue Warn]: Unknown Custom Element: <router-view>

Yes, try doing a hard refresh in the browser your js file might be cache.

fraserk started a new conversation Custom Domain Routing - CNAME

Hello everyone, I'm having some a hard time getting this to work. I've look everywhere a found a similar issue but no solution.

Im working on a SAAS website, I want users to be able to access their profile via a subdmain(user.mydomain.com I already have this working). I also want users to be able to use a custom domain(customdomain.com) to access their profile.

I have a CNAME setup like: www -> user.mydomain.com

This is my route group

 Route::domain('{user}.'.config('app.url'))->group(function () {
        Route::get( '/','[email protected]')->name('users.show');
    });

The problem is when I use a customdomain.com to access the site I'm getting a 404 error. Because it is trying to access the route outside of the domain route group.

Hope this make sense. Have anyone successfully get this setup working with laravel.

Thanks

24 Jul
3 weeks ago

fraserk left a reply on Dynamically Create Subdomain

Yes, it's possible. Have you tried anything or read this https://laravel.com/docs/5.8/routing#route-group-sub-domain-routing

06 Jun
2 months ago

fraserk left a reply on Nested Resource Controllers

Post the model let's have a look.

fraserk left a reply on Nested Resource Controllers

This may not be the cause of your issue, but the pivot table naming convention is wrong.

 #table: "course_categories"

That should be category_course

04 Jun
2 months ago

fraserk left a reply on Class 'Form' Not Found

Did you install the laravel collective HTML /Form Package?

https://github.com/LaravelCollective/docs/blob/5.6/html.md

29 May
2 months ago

fraserk left a reply on Vue Router, Nice Looking Routes And Passing Data

You need to use params. Something like this.

Is your router.js file.

{
            path: '/search/quotes/:quotes',
            component: QuoteSearchPage
        }

router link

 <router-link :to="{path: '/search/quotes/',params:{quotes:'{{tag.name}}'}}">{{tag.name}}
</router-link>
13 May
3 months ago

fraserk left a reply on ROLES AND PERMISSION PACKAGE IN LARAVEL

What issue are you having?

18 Mar
5 months ago
08 Mar
5 months ago

fraserk left a reply on Syntax Error, Unexpected '{'

your missing a {

public function addProduct(Request $request)
    {
        if($request->isMethod('post')){
            $data = $request->all();
            //echo "<pre>"; print_r($data); die;
            if(empty($data(['cateogry_id'])){
                return redirect()->back()->with('flash_message_error','Under Category is mssing');
            }
      }
    }
21 Feb
5 months ago

fraserk left a reply on Display An Image

Be sure to create a Symbolic link

php artisan storage:link

Now you can access you image @ http://somedomain.com/storage/image.jpg

You can use the asset helper

asset('storage/myimage.jpg');

<img src="{{asset('storage/myimage.jpg')}}">

08 Feb
6 months ago

fraserk left a reply on Vuejs Bootstrap DateTimePicker

I think it's just a typo.

Should the class name be far or fas?

 date: 'far fa-calendar',

 up: 'fas fa-arrow-up',
31 Jan
6 months ago

fraserk left a reply on Can't Load Eloquent Relationship Using Axios And Vuex

Try this.

        getThemeSettings: function({commit}){

            axios.get('/admin/designer/api/theme')
                
                .then(response => {

                    commit('SET_THEME', response.data)

                })

            .catch( error => {

                  Event.$emit('requestAlertDanger');

            })
        
        },

fraserk left a reply on Can't Load Eloquent Relationship Using Axios And Vuex

But you said that themeData doesn't have the colors. That's strange becase your setting it here let themeData = response.data; before you save the state.

fraserk left a reply on Can't Load Eloquent Relationship Using Axios And Vuex

console log response.data. Does that have the colors?

fraserk left a reply on Can't Load Eloquent Relationship Using Axios And Vuex

Can you console log 'themeData' just to verify you are indeed getting the color back? if possibe post it here. Also in the vue Devtool check the vuex tab to verify that you are getting the colors

fraserk left a reply on Can't Load Eloquent Relationship Using Axios And Vuex

@nhayder The state should be something like.

 theme: {
     colors: {},
}

fraserk left a reply on GMAIL

Silly question. Did you check your spam folder?

29 Jan
6 months ago

fraserk left a reply on VUEX Not Loading Eloquent Query's Relationship

@nhayder How is your state define? Post that section of the file.

Here is an example of how I do it. In my example. Meta, schedules and albums are a relationship to user.

   state:{
        user: {
            meta:{ 

            },
            schedules:{

            },
            albums:{

            }
        },

    },
 
    actions:{
        getUser(context){
            axios.get('/backend/user/settings').then((respsonse)=>{
                context.commit('updateUser', respsonse.data)
            })
        },
}

fraserk left a reply on VUEX Not Loading Eloquent Query's Relationship

In vuex try setting the state like

state:{
        theme: {
            colors:{ 

            },
}
07 Jan
7 months ago

fraserk left a reply on Fingerprint

There's a SDK on their website. https://www.zkteco.com/en/download_catgory.html Dont know if that will work for you

fraserk left a reply on Do You Use Named Routes Or Action([PostController::class, 'show']) ?

Name route. It just feels more natural for me.

31 Dec
7 months ago
21 Dec
7 months ago

fraserk left a reply on Getting Call To Undefined Function On Controller

@gabotronix should be

$this->getPercentageChange($request->input('originalPrice'), $request->input('finalPrice'));
20 Dec
7 months ago

fraserk left a reply on Parent::child Pages

@ludo1960 you do know that laravel is not a CMS right?

16 Dec
8 months ago

fraserk left a reply on Need Assistance With VueJS And Lists

Add the v-for to loop over the dmas data

<option v-for="dma in dmas" v-bind:value="dma.state"> @{{dma.state}}</option>

fraserk left a reply on Need Assistance With VueJS And Lists

@WSTRWYATT - OK good. try change

 data:{
        dmas: [],


      },

to

 data:{
        dmas: {},


      },

fraserk left a reply on Need Assistance With VueJS And Lists

@wstrwyatt Yes, that goes in the axios callback. Are you sure the api is returning data.

If you do a console.log(response.data) in the axios callback, do you get the desire data back?

fraserk left a reply on Need Assistance With VueJS And Lists

@WSTRWYATT - Try setting dmas data as this.

this.$set(this.$data,'dmas',response.data);

fraserk left a reply on Need Assistance With VueJS And Lists

looking over your origanal code the only error i spot is

v-for="dmas in dmas" 

This should be like.  (I don't know if dmas plural of dma)

v-for="dma in dmas" 

So the  opttion part should be.

<option v-for="dma in dmas" track-by="$index" :value="dma.state" :key="dma.state">@{{dma.state}}</option>

fraserk left a reply on Need Assistance With VueJS And Lists

Try this

<select v-model="dmas">
  
  <option v-bind:value="{ dmas.state }">{{dmas.state}}</option>
</select>

04 Dec
8 months ago

fraserk left a reply on Time Conflict Checker For A Teacher Or A Room

Hi, I'm also working on a scheduling project. Here is how i'm determining if a slot or room is available. You might want to look at http://php.net/manual/en/class.dateperiod.php.

It's a little icky right now but it works.

Also this thread help alot. https://laracasts.com/discuss/channels/general-discussion/determining-available-time-slotsfor-scheduling?page=1

    public function providerSchedule(Service $service, User $user)
    {
        
        $day_of_the_week = carbon::parse(request('date'))->format('D');        
        $date = $user->schedules()->pluck('opening_hours_'.strtolower($day_of_the_week));
        $bookings = $user->getBookingsByDay(request('date'));
            
            $start = Carbon::instance(new \DateTime(request('date') . $date['0']['0']));
            $end = Carbon::instance(new \Datetime(request('date') . $date['0']['1']));
            
            $interval = CarbonInterval::minutes($service->duration);
            $period = new \DatePeriod($start->addMinute(5), $interval, $end);
            $slots = collect($period);
            $myslots = $slots->map(function($items,$keys) use($bookings){
            
 // checking to see if a timeslot is available.  
                 foreach ($bookings as $book) {
                    
                    if (($items >=  $book->book_from) && ($items <= $book->book_to)) {
                        return [
                           'slot' => $items->subMinute(5)->format('m-d-y h:i a'),
                           'Booked' =>true
                       ];
                       
                    }

                 };
            return [
                'slot' => $items->subMinute(5)->format('m-d-y h:i a'),
                'Booked' => false
            ]; 
            });
            
            return collect($myslots);
        
    }
21 Nov
8 months ago

fraserk left a reply on What Does $guard In Admin Or User Do?

Ahh @wilk_randall you'r correct. $guard was used in laravel 5.2 i think, as a way to authenticate against multiplies tables..

From the docs.

In your auth.php configuration file, you may configure multiple "guards", which may be used to define authentication behavior for multiple user tables.

https://laravel.com/docs/5.2/authentication#resetting-passwords

fraserk left a reply on What Does $guard In Admin Or User Do?

Its use to protect your database from mass assignment.

https://laravel.com/docs/5.7/eloquent#mass-assignment

fraserk left a reply on Side Projects???

@martinbean Yes i'll be in laraconUS next year. I actually works next to the venue.

20 Nov
8 months ago

fraserk left a reply on Side Projects???

@martinbean Both your projects sounds great. Good luck.

07 Oct
10 months ago

fraserk left a reply on Inserting Data To User

It's means your not inserting the user role_id when you're creating the user. Which is set to not null on the database

21 Sep
10 months ago

fraserk left a reply on Submit Post Route Returning "page Can’t Be Found"

Check and verify url the form posting to.

10 Apr
1 year ago

fraserk left a reply on What Does Mean "Too Few Arguments To Function"?

My guess is one of these variables are empty $filename,$v,$name. You need to pass all 3 put only 2 were passed in.

08 Apr
1 year ago

fraserk left a reply on Whoops, Looks Like Something Went Wrong :(

In the .env file set app_debug to true.

04 Apr
1 year ago

fraserk left a reply on Can't Get Basic Policy To Work

Right, if the User is already logged-in, they will be redirected to /home. Try redirecting to another page, letting them know they're not authorize to edit that course.

15 Jan
1 year ago
15 Oct
1 year ago

fraserk left a reply on Display Images From Database

or $album->cover_image

10 Oct
1 year ago

fraserk left a reply on Build A Forum - Public Function Path() ERROR

if you dd($thread->path()) What does that return?

25 Sep
1 year ago

fraserk left a reply on Is Laracast Subscription A One Time Payment?

There's a forever plan for $350, if you can afford that.

13 Aug
2 years ago

fraserk left a reply on Ads Make Site Slow

Yea there's no ads in this site.

01 Aug
2 years ago

fraserk left a reply on Generate Thumbnails Without Storing Them

You can use intervention chache package, which allows you to resize images on the fly.. http://image.intervention.io/use/cache aslo Glide http://glide.thephpleague.com/1.0/api/size/ which uses intervention.