Skip to content

Instantly share code, notes, and snippets.

app.js

This file is added ABOVE all other scripts in the HTML

window.$ = window.jQuery = require('jquery');

home.js

This file is loaded below app.js (as stated above)

$("body").html('Testing');
<head>
<style>
body {
min-height: 100vh;
background: #ffffff;
background: -moz-linear-gradient(top, #ffffff 0%, #000000 100%);
background: -webkit-linear-gradient(top, #ffffff 0%,#000000 100%);
background: linear-gradient(to bottom, #ffffff 0%,#000000 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#000000',GradientType=0 );

Setup

I simply created two apps using latest version of each framework, using: laravel new laravel lumen new lumen`

I added a route to each (on /) both simply returning 'ok'. Of cause, I added the route to Laravels API routes.

Command used to test

<?php
class UniqueId {
private $id;
public function __construct($prefix = '')
{
$this->id = uniqid($prefix, true);
}
Vue.http.headers.common['X-CSRF-TOKEN'] = Laravel.csrfToken;
Vue.http.interceptors.push((request, next) => {
request.headers.set('X-CSRF-TOKEN', Laravel.csrfToken);
next();
});
// I tried both of these approaches (even at the same time??)
// It even sends the token with the request, yet it still fails

Okay, so basically what I'm trying to do, is gather Companies and Employees from an external API. For the purpose of this, I'll call the API objects:

  • Companies = extCompanies
  • Employees = extEmployees

In my database, I also have Companies and Employees. I'll name them

  • Companies = intCompanies
  • Employees = intEmployees

Basically, I need to sync the external data, with the internal.

<?php
/*
* Various of other things going on up here. I slimmed down the code for readability,
* and focus. $companies is an array of .. companies .. gathered from an external API.
*/
$companiesToCreate = collect([]);
foreach ( $companies as $company )
{
?php
class Prestashop1ValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
* @return boolean
?php
class Prestashop1ValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
* @return boolean

Keybase proof

I hereby claim:

  • I am lasserafn on github.
  • I am lasserafn (https://keybase.io/lasserafn) on keybase.
  • I have a public key whose fingerprint is B54C 53C9 15E8 5C4B 335D 976D 0F94 580B EDF0 565E

To claim this, I am signing this object: