connor11528

connor11528

Software Engineer at Stitch Labs

Member Since 2 Years Ago

Alameda, CA

Experience Points
18,860
Total
Experience

1,140 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
177
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 4
18,860 XP
Jun
06
4 months ago
Activity icon

Replied to Vagrant - OpenSSL SSL_read: SSL_ERROR_SYSCALL, Errno 54

For me I got this error when trying to add the box with no Vagrantfile.

Make sure to run vagrant init

This issue has more details about Vagrant not being able to grab info from the vagrant cloud

May
14
5 months ago
Activity icon

Replied to Laravel (Valet) Problem With Mysql Connection

To get around the lack of my.cnf.d you need to create the directory:

$ mkdir /usr/local/etc/my.cnf.d

Added note to tutorial at bottom because I ran into this error too: https://medium.com/employbl/how-to-install-mysql-on-mac-osx-5b266cfab3b6

May
06
5 months ago
Activity icon

Replied to CURL Error 28: Operation Timed Out After 2000 Milliseconds With 0 Bytes Received During Registration In Laravel 5.4

I am getting the same error when trying to login with Google. Did you ever fix this or find a solution? @divostar

Feb
21
7 months ago
Activity icon

Replied to 419 Error When Submitting Form In Production - Sorry, Your Session Has Expired. Please Refresh And Try Again

Alright got rid of the 419. I needed to clear the cache with php artisan cache:clear

Flash messages are still not showing up but that could be a different error. Thank you SO MUCH for your help @roerjo

Activity icon

Replied to 419 Error When Submitting Form In Production - Sorry, Your Session Has Expired. Please Refresh And Try Again

@ROERJO - Okay I ran the deploy with the new app key generation (with force), deleted sessions from database and file system and cleared the cookies in the chrome browser.

Still getting the 419.

When I check the cookie data in chrome (chrome://settings/siteData) it shows I'm creating an XSRF-TOKEN and a cookie with name employbl (comes from SESSION_COOKIE env variable)

I'm thinking that I shouldn't be creating that XSRF-TOKEN in the browser or that somehow what I'm storing isn't matching up to the server somehow

Activity icon

Replied to 419 Error When Submitting Form In Production - Sorry, Your Session Has Expired. Please Refresh And Try Again

@ROERJO - That's the same. I generated the migration with the artisan command

Activity icon

Replied to 419 Error When Submitting Form In Production - Sorry, Your Session Has Expired. Please Refresh And Try Again

@ROERJO - This is super helpful. not sure why this is happening but comparing these two values seems definitely to be on to the issue root cause. So you inspect the hidden input field and that value should be present on the form submit request in network tab?

Activity icon

Replied to 419 Error When Submitting Form In Production - Sorry, Your Session Has Expired. Please Refresh And Try Again

@ROERJO -

<?php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;

class VerifyCsrfToken extends Middleware
{
    /**
     * The URIs that should be excluded from CSRF verification.
     *
     * @var array
     */
    protected $except = [
        //
    ];
}
Activity icon

Replied to 419 Error When Submitting Form In Production - Sorry, Your Session Has Expired. Please Refresh And Try Again

@TYKUS - I do have create session and create cache migrations. The "sessions" table is being created and in my config/sessions.php I have 'table' => 'sessions',. Session records are populating in the sessions table in production

Activity icon

Replied to 419 Error When Submitting Form In Production - Sorry, Your Session Has Expired. Please Refresh And Try Again

@ROERJO - Yes I switched to "database" for session permissions. My .env file looks like:

BROADCAST_DRIVER=log
CACHE_DRIVER=database
SESSION_DRIVER=database
SESSION_DOMAIN=null
SESSION_COOKIE=employbl
QUEUE_DRIVER=sync

and in config/session.php I have 'driver' => env('SESSION_DRIVER', 'database'),.

Confirmed that the session table is being created and populated with records on my production database.

Just in case I SSH'd into my forge server and checked file permissions, it looked like:

[email protected]:~/employbl.com$ ls
CNAME      composer.json  nova               resources   vendor
README.md  composer.lock  package-lock.json  routes      webpack.mix.js
app        config         package.json       server.php  yarn.lock
artisan    database       phpunit.xml        storage
bootstrap  laradock       public             tests
[email protected]:~/employbl.com$ ls -l
total 1248
-rw-rw-r--  1 forge forge     17 Jul 12  2018 CNAME
-rw-rw-r--  1 forge forge   2468 Feb 20 00:58 README.md
drwxrwxr-x 10 forge forge   4096 Feb 21 17:58 app
-rw-rw-r--  1 forge forge   1686 Jul 12  2018 artisan
drwxrwxr-x  3 forge forge   4096 Jul 12  2018 bootstrap
-rw-rw-r--  1 forge forge   2137 Feb 21 02:22 composer.json
-rw-rw-r--  1 forge forge 238627 Feb 21 02:22 composer.lock
drwxrwxr-x  2 forge forge   4096 Feb 21 17:58 config
drwxrwxr-x  7 forge forge   4096 Feb 19 23:02 database
drwxrwxr-x  2 forge forge   4096 Oct 19 23:37 laradock
drwxrwxr-x  9 forge forge   4096 Oct 29 22:41 nova
-rw-rw-r--  1 forge forge 729852 Feb  3 05:57 package-lock.json
-rw-rw-r--  1 forge forge   1457 Feb  3 05:57 package.json
-rw-rw-r--  1 forge forge   1142 Dec 27 05:01 phpunit.xml
drwxrwxr-x  8 forge forge   4096 Feb 21 18:52 public
drwxrwxr-x  5 forge forge   4096 Jul 12  2018 resources
drwxrwxr-x  2 forge forge   4096 Feb 21 18:47 routes
-rw-rw-r--  1 forge forge    563 Jul 12  2018 server.php
drwxrwxr-x  6 forge forge   4096 Jul 12  2018 storage
drwxrwxr-x  4 forge forge   4096 Dec 27 05:01 tests
drwxrwxr-x 42 forge forge   4096 Feb 21 18:52 vendor
-rw-rw-r--  1 forge forge    570 Jul 15  2018 webpack.mix.js
-rw-rw-r--  1 forge forge 218035 Jul 12  2018 yarn.lock
Activity icon

Replied to 419 Error When Submitting Form In Production - Sorry, Your Session Has Expired. Please Refresh And Try Again

@ROERJO - Okay so set the permissions for storage/framework/sessions? I might need to SSH into the machine for that. I originally had sessions being stored as "file" and switched them to be stored in "database"

Activity icon

Replied to 419 Error When Submitting Form In Production - Sorry, Your Session Has Expired. Please Refresh And Try Again

@MIDWESTDEV - Including a video here. The link is live at: https://employbl.com/candidates (I've customized the 419 error template for lolz)

It looks like there is no session data but there is cookie data being stored: http://recordit.co/BqBK7naeI3

Activity icon

Replied to 419 Error When Submitting Form In Production - Sorry, Your Session Has Expired. Please Refresh And Try Again

@ROERJO - Hmm, like this?

    protected $middlewareGroups = [
        'web' => [
            \App\Http\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            \Illuminate\Session\Middleware\AuthenticateSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            // \App\Http\Middleware\VerifyCsrfToken::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
            \Spatie\ResponseCache\Middlewares\CacheResponse::class,
        ],

Something to think about, but i'm kinda sketched out about getting hacked

Activity icon

Replied to 419 Error When Submitting Form In Production - Sorry, Your Session Has Expired. Please Refresh And Try Again

@MIDWESTDEV - Yes I do I have <meta name="csrf-token" content="{{ csrf_token() }}"> in the <head> of the application

Activity icon

Started a new conversation 419 Error When Submitting Form In Production - Sorry, Your Session Has Expired. Please Refresh And Try Again

I've got a Laravel 5.7 app that is working locally. For instance, when running locally I'll get flash messages about failed validation and it shows fine in the blade view:

I do have the @csrf helper in my blade form.

When I deploy and submit the form on production I get a 419 error: "Sorry, your session has expired. Please refresh and try again". Redirects are not working for social login with google or linkedin in production, though they're working locally.

I am using Laravel Forge for production and database tables for session and cache. So my .env file for production is:

BROADCAST_DRIVER=log
CACHE_DRIVER=database
SESSION_DRIVER=database
QUEUE_DRIVER=sync

I have tried changing the APP_NAME and APP_KEY and deleting all the contents of the "sessions" table as well but the 419 error persists on production.

Then my deployment script for Laravel Forge is:

cd /home/forge/employbl.com
git reset --hard origin/master
git pull origin master
composer install --no-ansi --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader
echo "" | sudo -S service php7.2-fpm reload
rm -rf node_modules
composer dump-autoload
php artisan config:clear
php artisan view:clear
php artisan responsecache:clear
php artisan config:cache
php artisan migrate --force
php artisan sitemap:generate 

How can I clear the sessions so I don't get the 419 "your session has expired" and the form works on the production server?

Feb
16
7 months ago
Activity icon

Started a new conversation Laravel Nova - Table 'action_events' Already Exists

Hi there, I am trying to run my migrations with Laravel Nova installed. I got everything running and deployed to production, but locally my migrations broke. I have tried php artisan migrate:reset, but afterwards I am getting an error that the "action_events" table already exists:

$ php artisan migrate
Migrating: 2014_10_12_000000_create_users_table
Migrated:  2014_10_12_000000_create_users_table
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated:  2014_10_12_100000_create_password_resets_table
Migrating: 2017_11_16_212051_create_companies_table
Migrated:  2017_11_16_212051_create_companies_table
Migrating: 2018_01_01_000000_create_action_events_table

In Connection.php line 664:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'action_events' already exists (SQL: create table `action_ev
  ents` (`id` bigint unsigned not null auto_increment primary key, `batch_id` char(36) not null, `user_id` int unsigned not n
  ull, `name` varchar(191) not null, `actionable_type` varchar(191) not null, `actionable_id` int unsigned not null, `target_
  type` varchar(191) not null, `target_id` int unsigned not null, `model_type` varchar(191) not null, `model_id` int unsigned
   null, `fields` text not null, `status` varchar(25) not null default 'running', `exception` text not null, `created_at` tim
  estamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')


In PDOStatement.php line 119:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'action_events' already exists


In PDOStatement.php line 117:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'action_events' already exists

This kind of makes sense because it said it created the "action_events" table. I have two create_actions_events migrations, one in, vendor/laravel/nova/database/migrations and one in nova/database/migrations.

My question is, why are the migrations running twice and how do I get it to stop? What's the best practice here for working with Nova and database migrations?

UPDATE:

I was able to get around this in my local environment by running migrate:reset and then going into sequel pro and deleting the action_events table. For some reason php artisan migrate:reset was not dropping that table.

Activity icon

Replied to Keep Getting TokenMismatchException VerifyCsrfToken.php On Line 46

For me solving the issue running my Laravel tests locally:

php artisan cache:clear
composer dump-autoload
php artisan config:clear
php artisan cache:clear // (just for good luck)
Jan
20
8 months ago
Activity icon

Replied to Laravel/PHPUnit Testing - TokenMismatchException

@BMLARSON - Nice! Fixed the issue... after I wiped out my whole local database

Jan
05
9 months ago
Activity icon

Replied to How To Submit A Vue Component In Laravel Blade?

@SHAWNRONG - Unfortunately you kind of need to do one or the other. Blade is rendered on the server side with PHP so you can't pop in Vue randomly

Activity icon

Replied to How To Submit A Vue Component In Laravel Blade?

I had the same question. This Medium article was really helpful. You can use axios to submit the form instead of HTML form element

https://medium.com/@mscherrenberg/laravel-5-6-vue-js-simple-form-submission-using-components-92b6d5fd4434

Oct
29
11 months ago
Activity icon

Replied to How To Add A Nova User In Production Using Laravel Forge?

Yes I did. It turns out the command is: ssh [email protected] where the XXX.XX.XXX.XXX is your server's IP address

Got it from here: https://mattstauffer.com/blog/getting-your-first-site-up-and-running-in-laravel-forge/ under "Other common tasks"

Activity icon

Started a new conversation How To Add A Nova User In Production Using Laravel Forge?

I have my site https://employbl.com/ deployed on Laravel Forge and recently installed Laravel Nova. Everything works great locally but I'm unable to login to the Nova dashboard in production. I'd like to run php artisan nova:user to create a production user. I've added my SSH keys to the Forge server.

How do I log into my Forge server and run the command to create a user?

Activity icon

Replied to Laravel 5 SSH Into Forge With Public SSH Key - Permission Denied (publickey).

Command to log into a forge server after you've added your key is: ssh [email protected]

Where XXX.XX.XXX.XXX is your server's IP Adress

Sep
21
1 year ago
Activity icon

Replied to Communications Between Components

@keevitaja I wrote a tutorial about how to communicate between Vue.js components here: https://blog.jscrambler.com/communicating-between-vue-2-components-and-google-maps/

It's common for people to use Vuex for building complex applications but is not required by any means. In the above tutorial I go through building an application that communicates across three different components and the Google Maps API. The way that we manage to communicate across Vue.js components is to emit events and respond to those events. There is a global event bus that listens for and responds to events in order to update data across components. I hope that you find it helpful

Jul
30
1 year ago
Activity icon

Replied to Writing Blog Posts In Markdown Language And Where To Save Posts

Parsedown is another popular option for converting markdown to html using PHP: https://github.com/parsedown/laravel

Jul
20
1 year ago
Activity icon

Replied to How To Clear The Users Browser Cache So That The Newest Vue Deploy Loads?

@tykus was right. Mix() instead of asset fixed the issue! Thank you

Jul
19
1 year ago
Activity icon

Started a new conversation How To Clear The Users Browser Cache So That The Newest Vue Deploy Loads?

I deployed my app to Laravel Forge. It looks great in an incognito window but in a normal Chrome window the app is broken. I know clearing my browser cache will work but I cannot tell that to every single returning user. How can I make sure that returning users see the latest version of my app?

I have the version method in my webpack.mix.js:

mix.js('resources/assets/js/app.js', 'public/js').version();
mix.sass('resources/assets/sass/app.scss', 'public/css').version();

In my layouts.blade.php I load in my Javascript like so:

<script src="{{ asset('js/app.js') }}"></script>

How can I make sure my returning users see the latest Vue.js?

Jul
07
1 year ago
Activity icon

Replied to Authenticating Users To Allow Edit/update Their Own Profile

@APPLE199 with the above code, can users edit someone else's profile assuming they're logged in?

Apr
04
1 year ago
Activity icon

Replied to Call To Undefined Method ViewTransactionListTest::visit()

Dusk requires a lot of changes to your tests that is different from the code Adam writes in the course. To get tests working in a similar manner using >= Laravel 5.5 you can use:

composer require laravel/browser-kit-testing --dev

Full setup instructions here (it's not too bad): https://github.com/laravel/browser-kit-testing

I have the tests running in functional dir using Laravel 5.6!

Activity icon

Replied to Visit() And See() And All That Not Working

Dusk requires a lot of changes to your tests. To get tests working in a similar manner using >= Laravel 5.5 you can use:

composer require laravel/browser-kit-testing --dev

Full setup instructions here (it's not too bad): https://github.com/laravel/browser-kit-testing

I have the tests running in functional dir using Laravel 5.6!

Mar
12
1 year ago
Activity icon

Replied to Class 'Memcached' Not Found

Thanks @danrichards I had to run the tests inside of my vagrant environment

Nov
04
1 year ago
Activity icon

Replied to Temporary URL Or URLs With A Limited Lifetime

In Laravel 5.5 you can use the Storage class and ->temporaryUrl(). This works for storing files on S3

https://laravel.com/docs/5.5/filesystem#file-urls

$url = Storage::temporaryUrl(
    'file1.jpg', Carbon::now()->addMinutes(5)
);
Activity icon

Replied to How To Upload File Private Mode And Retrive By Generated Url With Expired Time In Aws S3 In Laravel 5.3 Or 5.4

I believe this same functionality is baked into Laravel 5.5 through the temporaryUrl method

$url = Storage::temporaryUrl(
    'file1.jpg', Carbon::now()->addMinutes(5)
);

Docs: https://laravel.com/docs/5.5/filesystem#file-urls

Oct
09
2 years ago
Activity icon

Replied to Laravel 5 Omnipay With Rest API

Did you figure out an answer to this problem? I too would like to build a payment API with omnipay

Aug
09
2 years ago
Activity icon

Replied to How To Upgrade To Laravel 5.3?

So what if we have a massive laravel application? We're supposed to do "laravel new" and copy every single file into a new project. What about version control? It's suprising to me the solution is brand new project!

The alternative I gues would be to update composer.json and see what breaks

Aug
07
2 years ago
Activity icon

Replied to Laravel & Amazon AWS Deployment

+1 for tutorials on deployment to AWS. There are a lot of services out there to choose from: ElasticBeanstalk, CodeDeploy, CloudFormation etc

Looking forward to learning more! Thank you

Jul
10
2 years ago
Activity icon

Started a new conversation Images Not Rendering For Forge Deploy But Works Locally

I am having an issue rendering images when I deploy my Laravel 5.4 app using Forge.

I put my images in storage/app/public and then ran php artisan storage:link. I ran this locally and everything renders correctly.

I included the storage:link command in my Deploy Script for Forge. I reference the image in blade template like:

When I deploy my site using Forge I get a 404 error for rendering the images. The error says failed to load resource. Does anyone know why the images are rendering locally but the file path breaks when I deploy? Thank you!

Activity icon

Replied to Images Not Saving To Storage/app On Digital Ocean

When I try this I get an error on my forge deployment:

ln: failed to create symbolic link 'public/storage/public': File exists

However my images still don't render. How do I fix this?

Thank you

Jul
05
2 years ago
Activity icon

Replied to [L5] One Time Payment Cashier

For one time charges I would not use Cashier.

Build the client side form with Stripe JS library: https://stripe.com/docs/elements

This allows us to get a token that we can send to our server (Laravel)

Once you send the token to server follow these steps in PHP for processing the charge: https://stripe.com/docs/charges

Cashier is meant to be for subscriptions, which are more complex

Jan
29
2 years ago
Activity icon

Replied to How Do I Use Data From Vue.js Child Component Within Parent Component?

Okay cool! Thank you @KodeCept

I am using vue 1.0 so do need the .sync for this one. Shout out to @GuillaumeLeclerc for the vue-google-maps component: https://github.com/GuillaumeLeclerc/vue-google-maps

Final solution:

Blade template:

@extends('layouts.app')

@section('content')

    <div class='col-md-6 col-md-offset-3'>
        <h1>Add New Candidate</h1>

        <hr>

        <candidates-form endpoint='/candidates/create' buttontext='Add Candidate'></candidates-form>
            
    </div>
@stop 

Parent Vue component:

<template>
<div>
    {{endpoint}}

    
    <div class='form-group'>
        <label>Name:</label>
        <input type='text' class='form-control' v-model='name'>
    </div>

    <div class='form-group'>
        <location-input :location="locationData"></location-input>
    </div>

    <button class='btn btn-primary'>{{buttontext}}</button>

    <pre>{{ locationData | json }}</pre>

</div>

</template>

<script>

export default {

    data() {
        return {
            locationData: {
                place: {
                    name: ''
                },
                types: [],
                restrictions: {'country': 'usa'}
            }
        }
    },

    props: ['endpoint', 'buttontext'],


    ready() {
    }
}
</script>

Child Vue component:

<template>
    <place-input
            :place.sync="location.place"
            :types.sync="location.types"
            :component-restrictions.sync="location.restrictions"
            class='form-control'
            label='Location: '
            name='location'
    ></place-input>
</template>

<script>
    import { PlaceInput, Map } from 'vue-google-maps'

    export default {

        props: ['location'],

        components: {
            PlaceInput
        },
        ready() {
        }
    }
</script>
<style>
    label { display: block; }
</style>

Aaaaand the overall app.js file (this is within a Laravel 5.3 app btw)

import { load } from 'vue-google-maps'

load({
  key: '<API_KEY>',
  v: '3.24',             // Google Maps API version
  libraries: 'places',   // for places input
});

Vue.component('locationInput', require('./components/LocationInput.vue'));
Vue.component('candidatesForm', require('./components/CandidatesForm.vue'));
Vue.component('company-list', require('./components/CompanyList.vue'));

const app = new Vue({
    el: 'body'
});

This article from alligator.io also helped simplify things for me also. I was overthinking it!

Jan
17
2 years ago
Activity icon

Replied to How Do I Use Data From Vue.js Child Component Within Parent Component?

Okay cool. Do you have any code that illustrates this concept? Thank you!

Jan
12
2 years ago
Activity icon

Started a new conversation How Do I Use Data From Vue.js Child Component Within Parent Component?

I have a form component where I use a child component. I want to use data from the child component within the parent.

My component in html:

<candidates-form endpoint='/candidates/create' buttontext='Add Candidate'></candidates-form>

Then here is the Vue instance:

CandidatesForm.vue

<template>
<div class='row'>

    <div class='form-group'>
        <label>Name:</label>
        <input type='text' class='form-control' v-model='name'>
    </div>
    <div class='form-group'>
        <location-input></location-input>
    </div>

    <button class='btn btn-primary'>{{buttontext}}</button>
</div>
</template>
<script>
    export default {
        data() {
            return {}
        },

        props: ['endpoint', 'buttontext'],

        ready() {}
    }
</script>

I utilize the locationInput component in there and it renders to the screen nicely. That component implements Google Maps typeahead functionality for the input field and looks like this:

LocationInput.vue

<template>

    <place-input
            :place.sync="placeInput.place"
            :types.sync="placeInput.types"
            :component-restrictions.sync="placeInput.restrictions"
            class='form-control'
            label='Location: '
            name='location'
    ></place-input>

    <pre>{{ placeInput.place | json }}</pre>

</template>

<script>
    import { PlaceInput, Map } from 'vue-google-maps'

    export default {

        data() {
            return {
                placeInput: {
                    place: {
                        name: ''
                    },
                    types: [],
                    restrictions: {'country': 'usa'}
                }
            }
        },
        props: ['location'],

        components: {
            PlaceInput
        },
        ready() {
        }
    }
</script>
<style>
    label { display: block; }
</style>

I want to submit the name value and information from placeInput.place to the server.

I register both components in my main app file like so:

Vue.component('locationInput', require('./components/LocationInput.vue'));
Vue.component('candidatesForm', require('./components/CandidatesForm.vue'));

const app = new Vue({
    el: 'body'
});

How do I pass the placeInput.place data from location-input component to candidates-form component?

I want to send the placeInput.place and name data from the candidates-form component to the server, most likely using vue-resource.

Jan
10
2 years ago
Activity icon

Replied to How Do You Use RedirectIfAuthenticated Middleware?

Awesome thank you! Out of curiosity, how do you invoke it when using a controller?

If my code was set up like:

Route::get('/home', '[email protected]');

and the controller looked like:

public function index()
    {
        return view('home');
    }
Jan
08
2 years ago
Activity icon

Started a new conversation How Do You Use RedirectIfAuthenticated Middleware?

In the Ogres are like Middleware video Jeffrey mentions the RedirectIfAuthenticated to redirect logged in users from landing pages or login pages. How do I utilize this RedirectIfAuthenticated middleware in my routes or controllers?

For example, I have:

routes.php

Route::get('/', function index ()
    {
        return view('landing');
    });

I only want users to go to the landing page if they are not logged in. If they are logged in, go to /home. How do I protect this route from logged in users using middleware?

Thank you

Jan
07
2 years ago
Activity icon

Replied to Error Saying View Does Not Exist When It Does

For me it was much easier to change my path to @extends('layouts.app') instead of @extends('app')

Dec
28
2 years ago
Activity icon

Replied to How Do I Query By Geolocation In Laravel 5?

Thanks squad! I just finished the frontend for allowing users to select location using Google Maps typeahead API. Post is here: https://medium.com/@connorleech/build-google-maps-typeahead-functionality-with-vue-js-and-laravel-5-3-b75986c77df1#.j717fbnuu

@leber would the more simplistic query be:

DB::select('WHERE lat <'. $lat .'+ (10 * 0.018)');

I am going to have the more full featured one but if run into performance issues this is an awesome backup plan. Thank you

Dec
27
2 years ago
Activity icon

Started a new conversation How Do I Query By Geolocation In Laravel 5?

I am looking to add a geolocation attribute to my "Candidate" Eloquent model. I want to find Candidates based on their location. For instance, find all Candidates within 20 miles of San Francisco. What should my Eloquent model look like to store a location in the database?

How do I query for candidates based on their location? I am using Laravel 5.3.