webpatser/laravel-uuid

Autoload Fails?

bitboss-ca opened this issue · 1 comments

Is this supposed to work outside of laravel? Not sure if this is by design or not...?

composer.json

{
	"require": {
			"webpatser/laravel-uuid":"2.*"
	}
}

uuid-test.php

<?php
require('vendor/autoload.php');
$uuid = Uuid::generate(4);
echo $uuid;
?>

Test

% php uuid-test.php
PHP Fatal error:  Uncaught Error: Class 'Uuid' not found in /Users/username/Desktop/mturk-php/uuid-test.php:7
Stack trace:
#0 {main}
  thrown in /Users/username/Desktop/mturk-php/uuid-test.php on line 7

Never mind, I just needed to use the correct namespace, like this:

$uuid = \Webpatser\Uuid\Uuid::generate(4);