Lordgreymaul

Full Stack PHP Developer at Lendy.co.uk

Experience

12,410

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 88 Lessons Completed
  • 0 Favorites

20th November, 2017

Lordgreymaul started a new conversation Bootstrap Vue Model - [Vue Warn]: Error In Event Handler For "click": "TypeError: Cannot Read Property 'show' Of Undefined" • 3 days ago

So Im loading Vue Bootstrap Model and getting this message

[Vue warn]: Error in event handler for "click": "TypeError: Cannot read property 'show' of undefined"

Im Importing:

Vue.use(BootstrapVue);```

And using it on a button here:
```<b-btn  class="btn btn-success" v-on:click="openModelView(row.id)"   v-if="tabletype === 'workers'" >View</b-btn>```

And method is here:
``` openModelView: function() {
            this.$refs.workerviewnote.show();
        },```

Its just strange how its not working

2nd November, 2017

Lordgreymaul started a new conversation Use Dropdown Selected Data • 3 weeks ago

Hey guys

I have a drop down containing response data from a axios request

<multiselect v-model="order.orderJCname" id="orderJCname" name="orderJCname" :options="orderRCnameoptions" label="nicename"></multiselect>

On select of a record I want to then populate three other form fields with the data from that record.

<div class="col-md-6">
                                                <div class="form-group">
                                                    <div class="row">
                                                        <label class="col-sm-12" for="orderJCjobtitle">Job Title</label>
                                                        <div class="col-sm-12">
                                                            <input v-model="order.orderJCjobtitle" name="orderJCjobtitle" type="text" disabled class="form-control" id="orderJCjobtitle"/>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row formG">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <div class="row">
                                                        <label class="col-sm-12" for="orderJCphonenum">Phone Number</label>
                                                        <div class="col-sm-12">
                                                            <input v-model="order.orderJCphonenum" name="orderJCphonenum" type="text" disabled class="form-control" id="orderJCphonenum"/>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <div class="row">
                                                        <label class="col-sm-12" for="orderJCemail">Email</label>
                                                        <div class="col-sm-12">
                                                            <input v-model="order.orderJCemail" name="orderJCemail" type="text" disabled class="form-control" id="orderJCemail"/>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

Hope that makes sense , I tried v-bind:value but no joy!

30th October, 2017

Lordgreymaul left a reply on Using Data In MultiSelect • 3 weeks ago

So it turns out label works

Lordgreymaul started a new conversation Using Data In MultiSelect • 3 weeks ago

Quite a quick one I hope, I have some data returning on Response

contact: {
                    firstname: "",
                    surname: "",
                    job_title: "",
                    phone: "",
                    mobile: "",
                    fax: "",
                    email: "",
                    buiding: "",
                    address2: "",
                    address3: "",
                    postcode: "",
                    created_at: "",
                    updated_at: ""
                },

It loads into here and I want to use in with data to populate a dropdown select

orderJaddressoptions: ['one', 'two'],

Any ideas?

20th October, 2017

Lordgreymaul started a new conversation VUE Datatables • 1 month ago

Hey guys

Has any one had the pleasure of suing Vue Datatables?

I have dat coming in and working fine and the table looks great

What im trying to do is add a click through button to each row , it would seem from looking it needs to be added to the data?

My data looks like this:

  return {
                workerslist: [],

                columndata: [{
                    label: 'ID',
                    field: 'id',
                    numeric: true,
                    html: false,
                },{
                    label: 'First name',
                    field: 'fname',
                    numeric: true,
                    html: false,
                }, {
                    label: 'Surname',
                    field: 'sname',
                    numeric: false,
                    html: false,
                }, {
                    label: 'Date of Birth',
                    field: 'dob',
                    numeric: false,
                    html: false,
                }, {
                    label: 'Gender',
                    field: 'gender',
                    numeric: true,
                    html: false,
                }, {
                    label: 'Trade',
                    field: 'trade',
                    numeric: false,
                    html: false,
                }, {
                    label: 'Nationality',
                    field: 'nationality',
                    numeric: false,
                    html: true,
                }, {
                    label: 'Telephone',
                    field: 'telephone',
                    numeric: false,
                    html: true,
                }, {
                    label: 'Mobile',
                    field: 'mobile',
                    numeric: false,
                    html: true,
                }, {
                    label: 'Created',
                    field: 'created_at',
                    numeric: false,
                    html: true,
                },{
                    label: 'Edit',
                    field: 'edit',
                    numeric: false,
                    html: true,
                }],

            }

I just need to add a button with some HTML into it on that last field

16th October, 2017

Lordgreymaul started a new conversation Using Returned DATA Within VUE Data • 1 month ago

Hey

So i have a some axios data returning and need to use it with Multiselect form

data looks like

            return{
                formcreateorder: {},

                dateoforder: "",
                format: 'dd MMMM yyyy',

                orderconsultant: null,
                orderconsultantoptions: ['Mr', 'Mrs', 'Miss', 'Ms'],

                ordertype: null,
                ordertypeoptions: ['Mr', 'Mrs', 'Miss', 'Ms'],

                orderclient: null,
                orderclientoptions: ['Mr', 'Mrs', 'Miss', 'Ms'],

                clientslist:[],



            }
        },```

My Axios post looks like the below

// Make a ajax request to get data from client route axios.get('clients/get').then(response => this.clientslist = response.data);


So what i need to use a certain part of the returned object as the  orderclientoptions select which would be clientslist.clientname 

Hope that makes sense

11th October, 2017

Lordgreymaul left a reply on List Of Data To Single Record Using Axios • 1 month ago

I have got further I think I need to brush up on JS

10th October, 2017

Lordgreymaul left a reply on List Of Data To Single Record Using Axios • 1 month ago

Hey @topvillas I cant even get the form value to spit out the ID, I suppose my question was more of a has any one done this and could point me in the right direction. Its the first time I have built something with VUE this big and not used pure laravel

Lordgreymaul started a new conversation List Of Data To Single Record Using Axios • 1 month ago

Hey Guys

This is driving me nuts, using Laravel on the back end and VUE as the front and im stuck

I have a list of "Workers" and Im trying to make a post via a button with a hidden element containing the user id to a controller method to get a single record of data so I can make amends to that data

template vue is this

<template>
    <div>
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12">
                    <b-card header="Workers" header-tag="h4" class="bg-info-card">
                        <div class="table-responsive">
                            <table class="table">
                                <thead>
                                <tr>
                                    <td>ID</td>
                                    <td>First Name</td>
                                    <td>Surname</td>
                                    <td>Date Of Birth</td>
                                    <td>Gender</td>
                                    <td>Nationality</td>
                                </tr>
                                </thead>
                                <tbody>
                                <tr v-for="worker in workerslist">
                                    <td>{{worker.id}}</td>
                                    <td>{{worker.fname}}</td>
                                    <td>{{worker.sname}}</td>
                                    <td>{{worker.dob}}</td>
                                    <td>{{worker.gender}}</td>
                                    <td>{{worker.nationality}}</td>
                                    <td>{{worker.created}}</td>
                                    <form :state="viewbyid" @submit.prevent="onSubmit">
                                        <input type="hidden" :value="{{worker.id}}"  >
                                        <td><button type="button" class="btn btn-primary mt-3">Edit</button></td>
                                    </form>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </b-card>
                </div>
            </div>
        </div>
    </div>
</template>

VUE looks like below

<script>
    import Vue from "vue";

    export default {

        name: "Dashboard",

        data: function () {
            return {
                workerslist: [],

                viewbyid: {},
                user_id: "",
            }
        },

        mounted() {
            // Make a ajax request to get data from jobs route
            axios.get('workers/viewall').then(response => this.workerslist = response.data);

        },
        methods: {
            onSubmit: function() {
                axios.post('workers/view'.then(response => response.data));
                // Needs to do more here
            }
        }
    }
</script>

21st September, 2017

Lordgreymaul left a reply on Displaying AJAX Response • 2 months ago

So a little bit of an update

I changed the controller to

public function searching() {
        $search_keyword = $_POST['search_keyword'];
        $searchClients = DB::table('clients')->where('company', 'like', '%'.$search_keyword.'%')->get();

        return response()->json($searchClients);

    }

Which is now providing results, just need to work out populating the screen

20th September, 2017

Lordgreymaul started a new conversation Displaying AJAX Response • 2 months ago

Hey Guys

So I have a 'Live Search' form Im working on and all returns are coming in ok with 200 codes but im getting no front end updates!

Front end

<div class="col-md-6 col-md-offset-3">
                <form action="/clientsearchresults" method="post">
                    <div class="form-group">
                        {{ csrf_field() }}
                        <label for="search">Search</label>
                        <input type="text" class="search_keyword" id="search" name="search" class="form-control" placeholder="Enter Clients Name">
                    </div>
                </form>

                <div id="result">

                </div>
            </div>

JS

$(".search_keyword").keyup(function () {
    var search_keyword_value = $(this).val();
    var dataString = 'search_keyword=' + search_keyword_value;
    if(search_keyword_value != '') {
        $.ajax({
            type: "POST",
            url: "/searching",
            data: dataString,
            cache: false,
            headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') },
            success: function (html) {
                $("#result").html(html).show();
            },
            error: function () {
                alert('Not Okay');
            }
        });
    }
    return false;
});
$("#result").on("click", function (e) {
    console.log('Im Here');
    var $clicked = $(e.target);
    if (e.target.nodeName == "STRONG")
        $clicked = $(e.target).parent().parent();
    else if (e.target.nodeName == "SPAN")
        $clicked = $(e.target).parent();
    var $name = $clicked.find('.name').html();
    var decoded = $("<div/>").html($name).text();
    $('#search_keyword_id').val(decoded);
});

$(document).on("click", function (e) {
    var $clicked = $(e.target);
    if (!$clicked.hasClass("search_keyword")) {
        $("#result").fadeOut();
    }
});

$('#search_keyword_id').click(function () {
    $("#result").fadeIn();
});

and the controller

// Live Search
    public function searching() {
        $search_keyword = $_POST['search_keyword'];
        $searchClients = DB::table('clients')->where('company', $search_keyword)->get();

        $bold_search_keyword = '<strong>' . $search_keyword . '</strong>';

        if($searchClients) {
            foreach ($searchClients as $rows) {
                echo '<div class="show" align="left"><span class="name">' . str_ireplace
                    ($search_keyword, $bold_search_keyword, $rows['company']) . '</span></div>';
            }
        }
    }

Have no errors what so ever but simply have no display on typing

18th September, 2017

Lordgreymaul left a reply on Loading Vue Into 5.5 • 2 months ago

I actually ran php artisan make:auth and it all fired into place! No idea what I did wrong or why in never worked but its working fine now

15th September, 2017

Lordgreymaul left a reply on Loading Vue Into 5.5 • 2 months ago

So I have tried that

<div id="app">
                    <Example></Example>
                </div>

I have added the script still at the bottom

Node modules contains Vue as does my package.json and still nothing

Vue Dev tools isnt picking it up either

14th September, 2017

Lordgreymaul started a new conversation Loading Vue Into 5.5 • 2 months ago

Hey Guys

So I always used to bring Vue in via a CDN or some otherway and now I understand VUE is in webpack with 5.5.

So I have npm run watch and compiled

my Vue code is

const app = new Vue({
    el: '#app',
    data: {
        message:'This is a note!'
    }
});

and I have added it to my front end along with my public/js/app.js compiled file

 <div id="app">
                    <p>{{ message }}</p>
                    <input type="text" v-model="message">
                </div>

<script href="{{URL::asset('js/app.js')}}"></script>

And get nothing and just the string output of message!? and Vue Dev tools isnt picking up a instance

I no im missing a step here just cant seem to find it

13th September, 2017

Lordgreymaul left a reply on Laravel Vs Plan PHP With No Framework • 2 months ago

I went the other way and Learnt Laravel before learning plain old PhP and having now worked in both environments! I always come back to Laravel , I mean always.

I have used Codeigniter, Phalcon and Zend also and Laravel wins for me hands down every time. Its simple to understand and offers so much in terms of speed and its written in a way that it some how understands what it is we do and how quick we need to do it.

Laravel made my transition from Front end to Back end a simple one, Hope that helps in any way

23rd July, 2017

Lordgreymaul left a reply on Getting A Single Item From List Of Data • 4 months ago

So the fix as it would seem is

Route::get('/members/video/{id}', '[email protected]');

Remove the dollar sign!

Lordgreymaul left a reply on Getting A Single Item From List Of Data • 4 months ago

updated function

public function video($id) {
        $video = DB::table('videos')->where()->first($id);
        return view('members/video', ['video' => $video]);
    }

Still same issue as above

Lordgreymaul left a reply on Getting A Single Item From List Of Data • 4 months ago

So the error is

URL comes out as http://localhost:8888/membership/public/members/video/10

NotFoundHttpException```

Lordgreymaul started a new conversation Getting A Single Item From List Of Data • 4 months ago

Hey guys

Been a while since I did this and got stuck, Im trying to click through to an item by id from a list

Route

Route::get('/members/video/{$id}', '[email protected]');

Controller

 public function video($id) {
        $video = DB::table('videos')->where('id' , $id)->find();
        return view('members/video', ['video' => $video]);
    }

View

<a href="{{URL::asset('members/video/' . $video->id)}}" class="btn btn-success">Watch Now</a>

Thanks in advance guys

3rd July, 2017

Lordgreymaul started a new conversation Null Values From API In Vue • 4 months ago

Hey Guys

Have an issue i havent seen before , so grabbing data via an API and trying to output via Vue and getting an error in Vue of :

TypeError: Cannot read property 'reference' of null

Any one have any idea how to get around this?

Thanks

21st June, 2017

Lordgreymaul started a new conversation Issue With Vue • 5 months ago

Hey Guys

So im learning vue and have an issue where its not picking up my added array data and only giving me flat {{}} text in the html

Its a basic bulletin board type thing I'm building

Please check out this codepen and you will see what my error is straight away

https://codepen.io/GrahamMorbyDev/pen/yXbQBx

Thanks

19th April, 2017

Lordgreymaul left a reply on TokenMismatchException In VerifyCsrfToken.php Line 68: • 7 months ago

Within this form?

I added {{ csrf_field() }} to it and it threw me a new error so that seems legit

Thanks

Lordgreymaul started a new conversation TokenMismatchException In VerifyCsrfToken.php Line 68: • 7 months ago

So im playing with Cashier trying to set up a subscription form

form looks like

<div>
    <form action="/" method="POST">
       <script
                src="https://checkout.stripe.com/checkout.js" class="stripe-button"
                data-key="pk_test_ylThVfhN9BlO4pdm4evJTeWi"
                data-amount="2181"
                data-name="OG Pokemon"
                data-description="monthly UK"
                data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
                data-locale="auto"
                data-currency="gbp">
        </script>
    </form>
</div>

Posts to this route

Route::post('/', function() {
    $token = Input::get('stripeToken');
    Auth::user()->subscription('monthly')->create($token);
    return 'DONE';
});

and get this error

TokenMismatchException in VerifyCsrfToken.php line 68:

any ideas?

Thanks guys

6th April, 2017

Lordgreymaul left a reply on Router Controlling CSS And Images • 7 months ago

it was a HTaccess fix

Lordgreymaul started a new conversation Router Controlling CSS And Images • 7 months ago

Hey Guys

Been following along with the PHP series and hit a snag when I try and load images and style sheets.

so it looks like the router is looking for routes for everything

#0 /Users/Graham/Projects/OGPokedex/index.php(7): Router->direct('css/bootstrap.c...')
#1 {main}
  thrown in /Users/Graham/Projects/OGPokedex/core/Router.php on line 21
[06-Apr-2017 09:08:28 Europe/Berlin] PHP Fatal error:  Uncaught Exception: No route defined for this URI. in /Users/Graham/Projects/OGPokedex/core/Router.php:21
Stack trace:
#0 /Users/Graham/Projects/OGPokedex/index.php(7): Router->direct('css/bootstrap.c...')
#1 {main}
  thrown in /Users/Graham/Projects/OGPokedex/core/Router.php on line 21
[06-Apr-2017 09:08:28 Europe/Berlin] PHP Fatal error:  Uncaught Exception: No route defined for this URI. in /Users/Graham/Projects/OGPokedex/core/Router.php:21
Stack trace:
#0 /Users/Graham/Projects/OGPokedex/index.php(7): Router->direct('media/logo.png')
#1 {main}
  thrown in /Users/Graham/Projects/OGPokedex/core/Router.php on line 21
[06-Apr-2017 09:08:28 Europe/Berlin] PHP Fatal error:  Uncaught Exception: No route defined for this URI. in /Users/Graham/Projects/OGPokedex/core/Router.php:21
Stack trace:
#0 /Users/Graham/Projects/OGPokedex/index.php(7): Router->direct('js/bootstrap.mi...')
#1 {main}
  thrown in /Users/Graham/Projects/OGPokedex/core/Router.php on line 21

As you can see it cant loads routes for any of this

this is the router class

<?php

class Router {
    protected $routes = [];

    public static function load($file) {
        $router = new static;
        require $file;
        return $router;
    }

    public function define($routes){
        $this->routes = $routes;
    }

    public function direct($uri){
        if (array_key_exists($uri, $this->routes)){
            return $this->routes[$uri];
        }

        throw new Exception('No route defined for this URI.');
    }
}

and my routes look like this

<?php

$router->define([
    '' => 'controllers/index.php',
    'about' => 'controllers/about.php',
    'culture' => 'controllers/about-culture.php',
    'contact' => 'controllers/contact.php',
    'search' => 'controllers/search.php'
]);

Any help with this would be great

13th March, 2017

Lordgreymaul started a new conversation A Community Question • 8 months ago

Hey Guys

I'm after some advice and just a general picking people's brains. I want to build a streaming service, like Youtube Gaming and Twitch.

Im thinking Technology and what to build it in.

Any suggestions

Thanks

G

1st March, 2017

Lordgreymaul left a reply on Guzzle Error Connecting To Github API • 8 months ago

Thank you guys and I got it working a different way and its down to the Guzzle docs being a little different on 6.2

Lordgreymaul started a new conversation Guzzle Error Connecting To Github API • 8 months ago

Hey guys

Trying guzzle for the first time and have an issue with an error im getting

#0 /Users/Graham/Projects/zendesktest/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 /Users/Graham/Projects/zendesktest/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 /Users/Graham/Projects/zendesktest/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#3 /Users/Graham/Projects/zendesktest/vendor/guzzlehttp/guzzle/s in /Users/Graham/Projects/zendesktest/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 186

This is the error and here is the code

require_once 'vendor/autoload.php';
use GuzzleHttp\Client;


$client = new GuzzleHttp\Client([
    //Base URL
    'base_url' => 'https://api.github.com'
]);

$response = $client->get('user/lordgreymaul');

var_dump($response);

Hopefully easy fix

11th February, 2017

Lordgreymaul started a new conversation Issue Adding Deploying The Repo • 9 months ago

Hey guys

So set up a new server with digital ocean , added mariaDB etc , set up .ENV and connected to bitbucket

I get this error on deploy

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
Generating optimized class loader
Compiling common classes

                               
  [InvalidArgumentException]   
  Database [] not configured.  

Im sure its something simple but cant see where its wrong

22nd January, 2017

Lordgreymaul left a reply on TypeError: Elixir.ready Is Not A Function • 10 months ago

Ok updated my gulp file to

var elixir = require('laravel-elixir');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(function(mix) {
    mix.sass('app.scss');
});

and worked perfectly

Lordgreymaul left a reply on TypeError: Elixir.ready Is Not A Function • 10 months ago

Yep tired that already, I have Googled everything and nothing worked

Lordgreymaul left a reply on TypeError: Elixir.ready Is Not A Function • 10 months ago

var elixir = require('laravel-elixir');

require('laravel-elixir-vue-2');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(mix => {
    mix.sass('app.scss')
       .webpack('app.js');
});

Lordgreymaul started a new conversation TypeError: Elixir.ready Is Not A Function • 10 months ago

So I have this error on a project, trying to compile my SASS and its freaking out when i run Gulp in the Terminal

Running on Ubuntu(Not sure if this matters)

I have googled and tried everything

/var/www/html/padnellrover/node_modules/laravel-elixir-vue-2/index.js:3
Elixir.ready(function () {
       ^

TypeError: Elixir.ready is not a function
    at Object.<anonymous> (/var/www/html/padnellrover/node_modules/laravel-elixir-vue-2/index.js:3:8)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/var/www/html/padnellrover/gulpfile.js:3:1)
    at Module._compile (module.js:571:32)

Package.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.3.*"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.0",
        "symfony/css-selector": "3.1.*",
        "symfony/dom-crawler": "3.1.*"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

12th January, 2017

Lordgreymaul left a reply on Shuffle() Expects Parameter 1 To Be Array, Null Given • 10 months ago

yeah its not returning anything just that error

Lordgreymaul started a new conversation Shuffle() Expects Parameter 1 To Be Array, Null Given • 10 months ago

So this error keeps happening and Im not sure why and I havent looked at the project for an age

ErrorException in MarvelController.php line 49:
shuffle() expects parameter 1 to be array, null given

the error is on this else statement

else{
            $comics = Cache::get('comics');
            shuffle($comics);
            $comics = array_slice($comics, 0, 20);
        }

9th January, 2017

Lordgreymaul left a reply on Php Artisan Migrate , Windows PDO Exception Could Not Find Driver • 10 months ago

I have enabled it in the php.ini

;extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll

Lordgreymaul left a reply on Php Artisan Migrate , Windows PDO Exception Could Not Find Driver • 10 months ago

the actual error is PDO Exception could not find driver ill try to install sqlsrv

Lordgreymaul started a new conversation Php Artisan Migrate , Windows PDO Exception Could Not Find Driver • 10 months ago

Does any one have any experience with this?

Using MAMP on windows 10 and get this error when Migrating to database on local host

3rd January, 2017

Lordgreymaul left a reply on Your Local Changes To The Following Files Would Be Overwritten By Merge • 10 months ago

Yah it was the fact I had the .env committing and not on git ignore. I just started my repo again and made sure the .env etc was on git ignore

21st December, 2016

Lordgreymaul left a reply on MethodNotAllowedHttpException • 11 months ago

From that question I got it

I had :Route::get('/contactorm' , '[email protected]');

now changed to

Route::post('/contactorm' , '[email protected]');

and works!

Lordgreymaul started a new conversation MethodNotAllowedHttpException • 11 months ago

Hey Guys

Trying to convert a flat php site to Laravel and hitting a snag on the Contact Form

So the error is : MethodNotAllowedHttpException

Controller:

public function contact(){
        $response = [
            'success' => false,
            'errors' => []
        ];
        $errors = [];

        // Validate form

        if (empty($_POST['name'])) {
            $errors['name'] = 'Your Name is required';
        }

        if (null === $_POST['email'] || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) || '' === $_POST['email']) {
            $errors['email'] = 'Please enter a valid email address';
        }


        if (count($errors) == 0) {

            $emailSubject = 'Lendy Finance contact form request';
            $webmaster = '[email protected]';

            $name = $_POST['name'];
            $email = $_POST['email'];
            $company = $_POST['company'];
            $website = $_POST['website'];
            $message = $_POST['message'];

            $body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Company: $company<br>
Website: $website<br>
Message: $message <br>
EOD;
            $headers = "MIME-Version: 1.0" . "\r\n";
            $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
            $headers = "From: [email protected]\r\n";
            $headers .= "Reply-To: $email\r\n";
            $headers .= "Return-Path: [email protected]\r\n";
            $headers .= "Content-type: text/html\r\n";

            $res = mail($webmaster, $emailSubject, $body, $headers);

            if( !$res)
            {
                $errors['sys'] = "Unable to submit your enquiry, Please email us directly at [email protected]";
            }
            $response['success'] = $res;


        }
        $response['errors'] = $errors;

        echo json_encode($response);

    }

The view:

 {!! Form::open(['url' => '/contactorm']) !!}
                    <div class="col-md-12">
                        <div class="col-md-6">
                            <div class="form-group">
                                {!! Form::label('name' , 'Name') !!}
                                {!! Form::text('name', null , array('class' => 'form-control' , 'placeholder' => 'Enter Name')) !!}
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                {!! Form::label('email' , 'Email') !!}
                                {!! Form::email('email', null , array('class' => 'form-control' , 'placeholder' => 'Enter Email')) !!}
                            </div>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="col-md-6">
                            <div class="form-group">
                                {!! Form::label('website' , 'Website') !!}
                                {!! Form::text('website', null , array('class' => 'form-control' , 'placeholder' => 'Enter Website')) !!}
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                {!! Form::label('company' , 'Company') !!}
                                {!! Form::text('company', null , array('class' => 'form-control' , 'placeholder' => 'Enter Company')) !!}
                            </div>
                        </div>
                    </div>
                <div class="col-md-12">
                    <div class="col-md-12">
                        {!! Form::label('message' , 'Message') !!}
                        {!! Form::textarea('message', null , array('class' => 'form-control' , 'placeholder' => 'Enter Message')) !!}
                    </div>
                </div>
                <div class="col-md-12">
                    <div class="col-md-4">
                        <br>
                        {!! Form::submit('Submit', array('class'=>'btn btn-warning center-block')) !!}
                    </div>
                </div>
                {!! Form::close() !!}

and the some JS:

<script>
    $(function() {

        $("#submit").click(function (e) {

            // Validate & prep data here
            var formData = $('form').serialize();

            var div = $('#errors');
            div.empty();

            $.ajax("config/emailform.php",
                    {
                        data: formData,
                        dataType: "json",
                        type: "POST",
                        success: function (response) {
                            // Show success message
                            if (response.success) {
                                $('form').hide();
                                $('#successMessage').show();
                            } else {

                                for (var key in response.errors){
                                    div.append($('<p>' + response.errors[key] + '</p>'));
                                }
                            }
                        }
                    });

        });

    });

</script>

12th December, 2016

Lordgreymaul left a reply on FatalErrorException In OAuthExceptionHandlerMiddleware.php Line 13: • 11 months ago

It does, but looks like i may have this issue elsewhere with other files! I guess the only other way is to downgrade to 5.0 and start over

Lordgreymaul left a reply on FatalErrorException In OAuthExceptionHandlerMiddleware.php Line 13: • 11 months ago

ok cool

so my next question is how do i fix the file

I tried removing the class name and calling just middleware but fails and im at a loss on this now

Lordgreymaul started a new conversation FatalErrorException In OAuthExceptionHandlerMiddleware.php Line 13: • 11 months ago

Hey

I m running through a TuT on OAuth Api with Lumen and hit a snag

The TUT is here : http://esbenp.github.io/2015/05/26/lumen-web-api-oauth-2-authentication/

FatalErrorException in OAuthExceptionHandlerMiddleware.php line 13: Interface 'Illuminate\Contracts\Routing\Middleware' not found

<?php

namespace LucaDegasperi\OAuth2Server\Middleware;

use Closure;
use Illuminate\Http\JsonResponse;
use Illuminate\Contracts\Routing\Middleware;
use League\OAuth2\Server\Exception\OAuthException;

/*
* OAuthExceptionHandlerMiddleware
*/
class OAuthExceptionHandlerMiddleware implements Middleware
{
    public function handle($request, Closure $next)
    {
        try {

            return $next($request);

        } catch (OAuthException $e) {

            return new JsonResponse([
                    'error'             => $e->errorType,
                    'error_description' => $e->getMessage()
                ],
                $e->httpStatusCode,
                $e->getHttpHeaders()
            );
        }
    }
}

10th October, 2016

Lordgreymaul left a reply on Passing Returns From API To View • 1 year ago

Its cool got it!

Thanks for you help!

 @foreach($zendesks->tickets as $zendesk)
                <p>{{$zendesk->url}}</p>
                <p>{{$zendesk->subject}}</p>
            @endforeach 

Lordgreymaul left a reply on Passing Returns From API To View • 1 year ago

So now its

Cannot use object of type stdClass as array

Lordgreymaul left a reply on Passing Returns From API To View • 1 year ago

its the array i posted above?

#883 ▼
  +"tickets": array:100 [▼
    0 => {#187 ▼
      +"url": "Something/v2/tickets/5097.json"
      +"id": 5097
      +"external_id": null
      +"via": {#185 …2}
      +"created_at": "2016-02-09T17:57:24Z"
      +"updated_at": "2016-06-27T21:01:14Z"
      +"type": null
      +"subject": "Something"
      +"raw_subject": "Something"
      +"description": """
        Something
        """
      +"priority": null
      +"status": "closed"
      +"recipient": "[email protected]"
      +"requester_id": 1141596301
      +"submitter_id": 1141596301
      +"assignee_id": 712346221
      +"organization_id": null
      +"group_id": 24119601
      +"collaborator_ids": []
      +"forum_topic_id": null
      +"problem_id": null
      +"has_incidents": false
      +"is_public": true
      +"due_at": null
      +"tags": []
      +"custom_fields": array:1 [ …1]
      +"satisfaction_rating": null
      +"sharing_agreement_ids": []
      +"fields": array:1 [ …1]
      +"followup_ids": []
      +"brand_id": 450021
      +"allow_channelback": false
    }

Lordgreymaul left a reply on Passing Returns From API To View • 1 year ago

I get a return of all the arrays

Lordgreymaul left a reply on Passing Returns From API To View • 1 year ago

controller

 // Zendesk View
    public function zendesk()
    {
        $zendesks = Zendesk::tickets()->findAll()->get(10);
        return view('zendesk' , compact('zendesks'));
    }

Lordgreymaul left a reply on Passing Returns From API To View • 1 year ago

my code is this

@foreach($zendesks as $zendesk)
           <p>{{$zendesk->url}}</p>
               <p>{{$zendesk->subject}}</p>
            @endforeach 
Edit Your Profile
Update

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