connor11528

Experience

12,380

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 119 Lessons Completed
  • 3 Favorites

4th November, 2017

connor11528 left a reply on Temporary URL Or URLs With A Limited Lifetime • 2 weeks ago

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)
);

connor11528 left a reply on How To Upload File Private Mode And Retrive By Generated Url With Expired Time In Aws S3 In Laravel 5.3 Or 5.4 • 2 weeks ago

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

9th October, 2017

connor11528 left a reply on Laravel 5 Omnipay With Rest API • 1 month ago

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

9th August, 2017

connor11528 left a reply on How To Upgrade To Laravel 5.3? • 3 months ago

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

7th August, 2017

connor11528 left a reply on Laravel & Amazon AWS Deployment • 3 months ago

+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

10th July, 2017

connor11528 started a new conversation Images Not Rendering For Forge Deploy But Works Locally • 4 months ago

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!

connor11528 left a reply on Images Not Saving To Storage/app On Digital Ocean • 4 months ago

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

5th July, 2017

connor11528 left a reply on [L5] One Time Payment Cashier • 4 months ago

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

29th January, 2017

connor11528 left a reply on How Do I Use Data From Vue.js Child Component Within Parent Component? • 9 months ago

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>
@stopassola 

Parent Laravel 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 Laravel 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',
    data: store
});

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

17th January, 2017

connor11528 left a reply on How Do I Use Data From Vue.js Child Component Within Parent Component? • 10 months ago

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

12th January, 2017

connor11528 started a new conversation How Do I Use Data From Vue.js Child Component Within Parent Component? • 10 months ago

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

    <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

    <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.

10th January, 2017

connor11528 left a reply on How Do You Use RedirectIfAuthenticated Middleware? • 10 months ago

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');
    }

8th January, 2017

connor11528 started a new conversation How Do You Use RedirectIfAuthenticated Middleware? • 10 months ago

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

7th January, 2017

connor11528 left a reply on Error Saying View Does Not Exist When It Does • 10 months ago

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

28th December, 2016

connor11528 left a reply on How Do I Query By Geolocation In Laravel 5? • 10 months ago

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

27th December, 2016

connor11528 started a new conversation How To Store Locations With Laravel And Eloquent? • 10 months ago

I would like to add a location to an Eloquent model and query by location. What is the best practice for storing a Users location?

Thank you!

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.