Lordgreymaul

Full Stack PHP Developer at Lendy.co.uk

Experience

13,420

0 Best Reply Awards

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

25th May, 2018

Lordgreymaul left a reply on Getting Data Range • 3 weeks ago

man I couldnt see it! Thanks

Lordgreymaul left a reply on Getting Data Range • 3 weeks ago

sorry yeah

$today = Carbon::now(); $lastWeek = Carbon::now()->subDays(7);

Lordgreymaul started a new conversation Getting Data Range • 3 weeks ago

So I'm trying to get data within a 7-day date range

The data exists but I have no returning results

    $sageWorkers = DB::table('workers')
                         ->leftJoin('assign_worker_contracts', 'workers.id', '=', 'assign_worker_contracts.worker_id')
                         ->where('assign_worker_contracts.created_at', '=>' , $lastWeek)->where('assign_worker_contracts.created_at', '<=', $today)
                         ->get();

I'm sure I'm missing something easy but I have been staring at it for some time now

24th May, 2018

Lordgreymaul left a reply on Where Clause Is Ambiguous • 3 weeks ago

Perfect thank you! Right in front of me!

Lordgreymaul started a new conversation Where Clause Is Ambiguous • 3 weeks ago

Trying to get some data that sits between a 7 day period

DB::table('workers')
                         ->leftJoin('assign_worker_contracts', 'workers.id', '=', 'assign_worker_contracts.worker_id')
                         ->where('created_at', '>=' , $today)->where('created_at', '<=', $lastWeek)
                         ->get();

1052 Column 'created_at' in where clause is ambiguous is the error it spits at me

Any ideas? Never had this one before

18th May, 2018

Lordgreymaul left a reply on Return Foreach Loop • 1 month ago

I get a Undefined variable: messages on the call

Lordgreymaul started a new conversation Return Foreach Loop • 1 month ago

Hey folks, using a package to get some emails from GMail need to return the results as really an object but an array will work.

So far I'm here :

  //Testing get messages
    public function getMailbox() {
        $messages = LaravelGmail::message()->unread()->preload()->all();
        foreach($messages as $message) {
            $id = $message->getId();
            $date = $message->getDate();
            $from = $message->getFromEmail();
            $email = $message->getPlainTextBody();
        }
        return compact(array('email', 'date', 'from', 'id'));
    }

All I get is one result and there should be four

any ideas

15th May, 2018

Lordgreymaul left a reply on Socialite Hitting 404 Page • 1 month ago

Yep changed that and still a 404

Lordgreymaul started a new conversation Socialite Hitting 404 Page • 1 month ago

Hey new to this feature and I'm almost there but need to be steered int he right direction

So I have made Auth and have the login controller :

To which i have built in the following:

public function socialLogin($social) {
        return Socialite::driver($social)->redirect();
    }

    public function handleProviderCallback($social) {
        $userSocial = Socialite::driver($social)->user();
        $user = User::where(['email' => $userSocial->getEmail()])->first();

        if($user) {
            Auth::login($user);
            return redirect()->action('[email protected]');
        } else {
            return view('auth.register', ['name' => $userSocial->getName(),
                                                'email' => $userSocial->getEmail()]);

        }
    }

These two functions are controlled by the following routes:

Route::get('login/{social}', 'Auth\[email protected]')
            ->where('social','twitter|facebook|linkedin|google|github');
Route::get('login/{social/callback}', 'Auth\[email protected]')
            ->where('social','twitter|facebook|linkedin|google|github');

And i hit the link below:

<a href="{{ url('/login/twitter') }}" class="btn btn-twitter"><i class="fa fa-twitter"></i> Twitter</a>

The redirect URL is :

TWITTER_URL=http://localhost:8888/twitter/callback

Which I have added to the APP on the twitter console

And im getting a 404 on return from twitter

10th May, 2018

Lordgreymaul left a reply on PHP-imap Get All Mail • 1 month ago

I think i was confusing how I return the data cause the app is using Vue on the front end and using axios requests to get the response

Simply couldn't see the wood from the trees!

Lordgreymaul left a reply on PHP-imap Get All Mail • 1 month ago

yeah im getting there I moved on a bit now , Thanks again for your help buddy

Lordgreymaul left a reply on PHP-imap Get All Mail • 1 month ago

Kinda wish id just giving them google mail in the browser lol

Im currently here

 //Get all mail
    public function GetMail() {

        $mail = new Imap(array(
            'host' => 'imap.gmail.com',
            'user' => '[email protected]',
            'password' => 'kimi07Ferrari',
            'ssl' => 'ssl',
            'port' => 993
        ));

        $mail->countMessages();
        $content = array([ ]);
        foreach ($mail as $messageNum => $message) {
            $content = array([
               'from' => $message->from,
                'subject' =>$message->subject
            ]);
        }
        return $content;
    }

Here is where I'm lost what is the id returned ie $message-> id, cause that doesn't exist and also why am I only getting one message

Sorry for so many questions and really do appreciate your help

Lordgreymaul left a reply on PHP-imap Get All Mail • 1 month ago

One last question @Nash , any ideas how to return all messages as an object and not just the count ?

Lordgreymaul left a reply on PHP-imap Get All Mail • 1 month ago

That worked! Thank you very much , now I need to play to get stuff out!

Lordgreymaul left a reply on PHP-imap Get All Mail • 1 month ago

I have indeed ,

 public function GetMail() {

        $mail = new Imap(array('host'     => 'imap.gmail.com',
            'user'     => '[email protected]',
            'port'     => '993',
            'password' => '********',
            'ssl'      => 'tls',
            'auth'     => 'login'
        ));

        echo $mail->countMessages() . " messages found\n";
        foreach ($mail as $message) {
            printf("Mail from '%s': %s\n", $message->from, $message->subject);
        }
    }

Lordgreymaul left a reply on PHP-imap Get All Mail • 1 month ago

Totally just getting this 'cannot read - connection closed? ' at the moment

Lordgreymaul left a reply on PHP-imap Get All Mail • 1 month ago

Do you have much experience with the above?

Lordgreymaul started a new conversation PHP-imap Get All Mail • 1 month ago

Hi Guys

Another question on Email. I m using php-imap package to get all mail from a Gmail account.

Now I can get a single message but what I'm struggling to do is get all mail at once

public function GetMail() {
        $mailbox = new PhpImap\Mailbox('{imap.gmail.com:993/imap/ssl}INBOX', '[email protected]', 'password', __DIR__);
        // Read all messaged into an array:
        $mailsIds = $mailbox->searchMailbox('ALL');
        if(!$mailsIds) {
            return ('Mailbox is empty');
        }
        // Get the first message and save its attachment(s) to disk:
        $mail = $mailbox->getMail($mailsIds[1]);
        dd($mail);
    }

if I remove the [1] I get the error of 'cant get property of non-object'

The docs are pretty slim to be honest so just wondering if anyone has any experience with the package and have managed to do what I'm trying to do

9th May, 2018

Lordgreymaul left a reply on Use Of Undefined Constant STDIN - Assumed 'STDIN' Issue • 1 month ago

Yeah Tired that and I get

fgets() expects parameter 1 to be resource, string given

Lordgreymaul started a new conversation Use Of Undefined Constant STDIN - Assumed 'STDIN' Issue • 1 month ago

I'm trying to work with Google's Gmail API to get and send emails

I'm using there Quickstart PHP example and I'm getting a issue here

$authCode = trim(fgets(STDIN)); 

Which errors: Use of undefined constant STDIN - assumed 'STDIN'

The full script looks like so:

  $client = new Google_Client();
        $client->setApplicationName('Gmail API PHP Quickstart');
        $client->setScopes(Google_Service_Gmail::GMAIL_READONLY);
        $client->setAuthConfig(public_path('/gmail/client_secret.json'));
        $client->setAccessType('offline');

        // Load previously authorized credentials from a file.
        $credentialsPath = public_path('/gmail/credentials.json');
        if (file_exists($credentialsPath)) {
            $accessToken = json_decode(file_get_contents($credentialsPath), true);
        } else {
            // Request authorization from the user.
            $authUrl = $client->createAuthUrl();
            printf("Open the following link in your browser:\n%s\n", $authUrl);
            print 'Enter verification code: ';
            $authCode = trim(fgets(STDIN));

            // Exchange authorization code for an access token.
            $accessToken = $client->fetchAccessTokenWithAuthCode($authCode);

            // Store the credentials to disk.
            if (!file_exists(dirname($credentialsPath))) {
                mkdir(dirname($credentialsPath), 0700, true);
            }
            file_put_contents($credentialsPath, json_encode($accessToken));
            printf("Credentials saved to %s\n", $credentialsPath);
        }
        $client->setAccessToken($accessToken);

        // Refresh the token if it's expired.
        if ($client->isAccessTokenExpired()) {
            $client->fetchAccessTokenWithRefreshToken($client->getRefreshToken());
            file_put_contents($credentialsPath, json_encode($client->getAccessToken()));
        }
        return $client;

Any help would be greatly appreciated

Lordgreymaul left a reply on SSL For Multiple Domains Variations • 1 month ago

Worked perfectly thank you!!

8th May, 2018

Lordgreymaul started a new conversation SSL For Multiple Domains Variations • 1 month ago

Hey Folks

I have a domain that has an SSL via forge which is on working fine on a

example.com

But I need it to work also for

www.example.com

At the moment I get the non-secure warning for the www.

Anyone have any ideas

25th April, 2018

Lordgreymaul started a new conversation Laravel Forge Deployment • 1 month ago

New to Forge and new to webpack, I have a production server and test server with exactly the same code base on it, one builds fine and the other gives me this error

> [email protected] watch /home/forge/crm.geniusmoney.co.uk
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

Copying resources/assets/img to /home/forge/crm.geniusmoney.co.uk/public/img
  0% compiling 10% building modules 0/1 modules 1 active ....uk/resources/assets/sass/custom.scss                                          10% building modules 1/1 modules 0 active 10% building modules 1/2 modules 1 active ...ney.co.uk/resources/assets/js/main.js                                          10% building modules 2/2 modules 0 active
Webpack is watching the files…

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: watch resources/assets/img ENOSPC
    at _errnoException (util.js:1022:11)
    at FSWatcher.start (fs.js:1382:19)
    at Object.fs.watch (fs.js:1408:11)
    at createFsWatchInstance (/home/forge/crm.geniusmoney.co.uk/node_modules/laravel-mix/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/home/forge/crm.geniusmoney.co.uk/node_modules/laravel-mix/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/forge/crm.geniusmoney.co.uk/node_modules/laravel-mix/node_modules/chokidar/lib/nodefs-handler.js:228:14)
    at FSWatcher.NodeFsHandler._handleDir (/home/forge/crm.geniusmoney.co.uk/node_modules/laravel-mix/node_modules/chokidar/lib/nodefs-handler.js:407:19)
    at FSWatcher.<anonymous> (/home/forge/crm.geniusmoney.co.uk/node_modules/laravel-mix/node_modules/chokidar/lib/nodefs-handler.js:455:19)
    at FSWatcher.<anonymous> (/home/forge/crm.geniusmoney.co.uk/node_modules/laravel-mix/node_modules/chokidar/lib/nodefs-handler.js:460:16)
    at FSReqWrap.oncomplete (fs.js:153:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Phob[email protected] watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/forge/.npm/_logs/2018-04-25T07_29_45_227Z-debug.log

I have tried to remove unused assets and it's not working, any ideas

Lordgreymaul left a reply on Reload Page After Logout With VUE • 1 month ago

Thank you very much!! Works like a charm

24th April, 2018

Lordgreymaul left a reply on Reload Page After Logout With VUE • 1 month ago

yeah, I'm thinking that This whole Vue thing melts my brain! If I had my way a simple sever call would work, but my front end dev won't have it

Lordgreymaul left a reply on Reload Page After Logout With VUE • 1 month ago

the issue is its knowing what response to capture and push on to the then

23rd April, 2018

Lordgreymaul left a reply on Reload Page After Logout With VUE • 1 month ago

Im getting the 302 on log out and then getting a 401 which is the issue I think

tried something like

  axios.post('logout').then(response => {
                    if (response.status === 302 || 401) {
                        console.log('logout')
                    }
                    else {
                        // throw error and go to catch block
                    }
                }).catch(error => {
                    //run this code always when status!==200
                });

Lordgreymaul started a new conversation Reload Page After Logout With VUE • 1 month ago

Hey Chaps

So I'm trying to do a logout using an axios post, but its logging out and not hitting my then page reload?

Has any got any experience with this

 logout() {
                axios.post('logout').then(function() {
                    location.reload();
                })
                    .catch(e => {
                        this.errors.push(e)
                    })
            }

This is pretty much all I'm doing, I want to log out and then reload back to the login page

12th April, 2018

Lordgreymaul left a reply on Getting And Then Using Data In The Controller • 2 months ago

Perfect guys Thank you!

Lordgreymaul left a reply on Getting And Then Using Data In The Controller • 2 months ago

 //Auth Terms
        $temp->orderTOBname = $request->get('orderTOBname');
        $temp->save();

        Mail::send('emails.newOrder', $order = ['id'=>$temp->id, 'email'=>$temp->orderJCEmail], function ($message) use($temp) {
            $message->from('[email protected]');
            $message->sender('[email protected]');
            $message->to($temp->orderJCEmail);
            $message->bcc('[email protected]');
            $message->subject('Welcome to Genius Money');
            $message->from('[email protected]', 'Welcome to Genius Money');

Lordgreymaul left a reply on Getting And Then Using Data In The Controller • 2 months ago

Ahh so the ID will exist?

and I can use that in the email?

Lordgreymaul started a new conversation Getting And Then Using Data In The Controller • 2 months ago

Hey guys

So this is a really bad way to do it, but right now time is not my friend as id rather do this with Vue, is there a way I can save the data then go and get it again and then use that data to send in an email.

I need the ID in an email to use later!

$temp = new OrdersContract();

        //Main Order Details
        $temp->date = $request->get('dateoforder');
        $temp->consultant = $request->get('orderconsultant');
        $temp->type = $request->get('ordertype');
        $temp->clientname = $request->get('orderclient');

        //Order Information
        $temp->orderjobtitle = $request->get('orderjobtitle');
        $temp->orderJaddress = $request->get('orderJaddress');
        $temp->orderquantity = $request->get('orderquantity');
        $essqual = serialize($request->get('orderEssQual'));
        $temp->orderEssQual = $essqual;
        $temp->orderStartDate = $request->get('orderStartDate');
        $temp->orderEndDate = $request->get('orderEndDate');
        $temp->orderHoursChargeable = $request->get('orderHoursChargeable');
        $temp->orderLunchRestBreaks = $request->get('orderLunchRestBreaks');
        $temp->orderKeyrepons = $request->get('orderKeyrepons');
        $temp->orderKeyskillsexp = $request->get('orderKeyskillsexp');
        $temp->orderHandS = $request->get('orderHandS');
        $temp->orderPpeTools = $request->get('orderPpeTools');
        $temp->orderAddAssDets = $request->get('orderAddAssDets');
    $temp->save();

        $orderContracts = OrdersContract::orderby('created_at', 'desc')->first();

        Mail::send('emails.newOrder', $order = ['id'=>$orderContracts->id, 'email'=>$orderContracts->email], function ($message) use($orderContracts) {
            $message->from('[email protected]');
            $message->sender('[email protected]');
            $message->to($orderContracts->email);
            $message->bcc('[email protected]');
            $message->subject('Welcome to Genius Money');
            $message->from('[email protected]', 'Welcome to Genius Money');
        });

        return response('Order Raised & Email Sent');

cheers guys!

10th April, 2018

Lordgreymaul left a reply on Auth::user Returns HTML • 2 months ago

Still getting the HTML return @rin4ik

Lordgreymaul started a new conversation Auth::user Returns HTML • 2 months ago

Hey guys

It just stopped working! So I'm using Axios to get the signed in user and give me that information to use around my system.

My controller :

public function signedInConsultant() {
        $userProfile = Auth::user()->id;
        return $userProfile;
    }

and the return is

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>Title</title>
    <link rel="shortcut icon" href="favicon.ico"/>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>

    
<!-- CSRF Token -->
    <meta name="csrf-token" content="somerandomnumber">

    <!-- Styles -->
    <link href="http://localhost:8888/css/custom.css" media="all" rel="stylesheet" type="text/css" />

    <!-- Fontawesome -->
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.9/css/all.css" integrity="sha384-5SOiIsAziJl6AWe0HWRKTXlfcSHKmYV4RBF18PPJ173Kzn7jzMyFuTtk8JA7QQG1" crossorigin="anonymous">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
</head>

<body class="left-hidden">
    <div id="app"></div>
    <script type="text/javascript" src="http://localhost:8888/js/main.js"></script>
</body>

</html>

It just stopped working The front end dev says he has dont nothing on VUE to effect this and I cant see why it should just stop

31st January, 2018

Lordgreymaul left a reply on Making An API Call On User Auth Create • 4 months ago

It would seem its to do with the Validation and is now fixed

Lordgreymaul left a reply on Making An API Call On User Auth Create • 4 months ago

Yeah its the same table artisan make:auth creates

When I register it just reloads the page and the API is fine based on the SQL result on the API end

30th January, 2018

Lordgreymaul started a new conversation Making An API Call On User Auth Create • 4 months ago

Hey Guys

I'm trying to make an API call when a User signs up to my site

So the form will Post

and I have added a call in

 protected function create(array $data)
    {

        $response = (new GuzzleHttp\Client)->post('http://138.68.180.100/workers/register', [
            'form_params' => [
                'email' => ucwords($data['email']),
                'name' => ucwords($data['name']),
                'sname' => ucwords($data['surname'])
            ],
            'headers' => [
                'Authorization' => 'Bearer '.session()->get('token.access_token'),
                'Accept' => 'application/json',
            ]
        ]);


            return User::create([
                'name' => ucwords($data['name']),
                'surname' => ucwords($data['surname']),
                'email' => $data['email'],
                'password' => bcrypt($data['password'])
            ]);

   }

So it's hitting the API ok but not then going on and saving in the user's table in its own MYSQL tables

Any ideas?

5th January, 2018

Lordgreymaul started a new conversation Vue Watchers On Axios Request • 5 months ago

Hoping you can help me , Im calling a method to grab some notes and populating a data table. So what i need to do is when a new note is added have a watcher keep an eye and reload the data fro that method.

Im a little lost on how this is down and was hoping someone could give me a hand or point me in the right direction.

My get notes call is :

 //Get Worker Note
            var self = this;
            axios.get('worker/notes/get', {
                params: {
                    worker_id: this.$route.params.user_id
                }
            })
                .then(function (response) {
                    var notesdets = response.data;
                    self.notelist = notesdets;
                })
                .catch(function (error) {
                    console.log(error);
                });
        },

and I started purely with this on the watcher:

watch: {
            notelist: function () {
                console.log('watching')
            }
        },

and that all connects to a data object which is just called noteslist

19th December, 2017

Lordgreymaul left a reply on 500 Error On Passport Post Request • 5 months ago

I see, but I do actually have a call that is working fine

Lordgreymaul started a new conversation 500 Error On Passport Post Request • 5 months ago

So im new to guzzle and building API's , I have used Laravel Passport and on one GET call its fine. I have written a POST call and getting a 500 error in return

Post function

          $request = (new GuzzleHttp\Client)->post('http://138.68.180.100/news/article/single', [
              'headers' => [
                  'Authorization' => 'Bearer '.session()->get('token.access_token'),
                  'post_id' => $_POST['post_id']
              ]
          ]);
          $news = json_decode((string)$request->getBody());
          return view('pages.newsingle', compact('news'));
}```
Which does add the post item POST Data post_id "3"

on the other end I have

Route:

```Route::post('news/article/single', '[email protected]')->middleware('auth:api');```
Controller function:

```public function singlePost(Request $request) {
      $article = Articles::where('id', $request['post_id'])->get();
      return $article;
  } ```
my error:

Server error: `POST http://ipaddress/news/article/single` resulted in a `500 Intern

18th December, 2017

Lordgreymaul started a new conversation Passport Guzzle Response Directs To Login Page • 6 months ago

Hey guys , So i have 2 web apps talking and im trying to get a list of blog post from one to another. I have set up passport and I seem to be getting keys accepted etc but my

echo $response->getBody();

Just gives me the app login page

My Guzzle call looks like this

 $response = $client->post('http://138.68.180.100/oauth/token', [
                'form_params' => [
                    'client_id' => 2,
                    // The secret generated when you ran: php artisan passport:install
                    'client_secret' => 'secret',
                    'grant_type' => 'password',
                    'username' => '[email protected]com',
                    'password' => 'secret',
                    'scope' => '*',
                ]
            ]);

            // You'd typically save this payload in the session
            $auth = json_decode((string)$response->getBody());

            $response = $client->get('http://138.68.180.100/news/articles', [
                'headers' > [
                    'Authorization' => 'Bearer ' . $auth->access_token,
                    'Accept' => 'application/json'
                ]
            ]);
            echo $response->getBody();
            die();

On the other app side I have a route Route::get('news/articles', '[email protected]')->middleware('auth:api');

A controller method

 public function hello() {
        $articles = new Articles();
        $articles = $articles->get();
        return $articles;
    }

and I also updated my .htaccess

 # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} ^(.*)
    RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]

Any ideas would be greatly appricated

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" • 6 months 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 • 7 months 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 • 7 months ago

So it turns out label works

Lordgreymaul started a new conversation Using Data In MultiSelect • 7 months 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 • 7 months 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 • 8 months 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 • 8 months 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 • 8 months 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 • 8 months 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>
Edit Your Profile
Update

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