Change laravel tinkering
This commit is contained in:
parent
b8232c03b3
commit
e72e0d79eb
5 changed files with 56 additions and 41 deletions
|
@ -52,5 +52,3 @@ TWITTER_ACCESS_TOKEN_SECRET=
|
|||
SCOUT_DRIVER=pgsql
|
||||
|
||||
PIWIK=false
|
||||
|
||||
PSYSH_CONFIG=tinker.config.php
|
||||
|
|
3
.psysh.php
Normal file
3
.psysh.php
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
|
||||
\Spatie\TinkerTools\ShortClassNames::register();
|
|
@ -25,6 +25,7 @@
|
|||
"predis/predis": "~1.0",
|
||||
"ramsey/uuid": "^3.5",
|
||||
"sensiolabs/security-checker": "^4.0",
|
||||
"spatie/laravel-tinker-tools": "^1.0",
|
||||
"thujohn/twitter": "~2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
|
|
53
composer.lock
generated
53
composer.lock
generated
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "af5dc6e36b50396acecb6c17d3392645",
|
||||
"content-hash": "17da475fc29dcd3b362b3e0d21c312d9",
|
||||
"packages": [
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
|
@ -2926,6 +2926,57 @@
|
|||
"description": "A security checker for your composer.lock",
|
||||
"time": "2017-03-31T14:50:32+00:00"
|
||||
},
|
||||
{
|
||||
"name": "spatie/laravel-tinker-tools",
|
||||
"version": "1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/spatie/laravel-tinker-tools.git",
|
||||
"reference": "4674f9a3d874c8ad488e25ffb7cd936bb7348e43"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/spatie/laravel-tinker-tools/zipball/4674f9a3d874c8ad488e25ffb7cd936bb7348e43",
|
||||
"reference": "4674f9a3d874c8ad488e25ffb7cd936bb7348e43",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/support": "5.3.*|5.4.*",
|
||||
"php": "^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^6.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Spatie\\TinkerTools\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Freek Van der Herten",
|
||||
"email": "freek@spatie.be",
|
||||
"homepage": "https://spatie.be",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "Flysystem Adapter for the Dropbox v2 API",
|
||||
"homepage": "https://github.com/spatie/laravel-tinker-tools",
|
||||
"keywords": [
|
||||
"Flysystem",
|
||||
"api",
|
||||
"dropbox",
|
||||
"laravel-tinker-tools",
|
||||
"spatie",
|
||||
"v2"
|
||||
],
|
||||
"time": "2017-05-22T11:30:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "swiftmailer/swiftmailer",
|
||||
"version": "v5.4.8",
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Automatically alias Laravel Model's to their base classname.
|
||||
* Ex: "App\Models\User" now can just be accessed by "User"
|
||||
*/
|
||||
|
||||
if (! function_exists('aliasModels')) {
|
||||
function aliasModels() {
|
||||
$finder = new \Symfony\Component\Finder\Finder();
|
||||
$finder->files()->name('*.php')->in(base_path().'/app');
|
||||
foreach ($finder as $file) {
|
||||
$namespace = 'App\\';
|
||||
if ($relativePath = $file->getRelativePath()) {
|
||||
$namespace .= strtr($relativePath, '/', '\\') . '\\';
|
||||
}
|
||||
$class = $namespace . $file->getBasename('.php');
|
||||
try {
|
||||
$r = new \ReflectionClass($class);
|
||||
if ($r->isSubclassOf('Illuminate\\Database\\Eloquent\\Model')) {
|
||||
class_alias($class, $file->getBasename('.php'));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
aliasModels();
|
||||
|
||||
return [
|
||||
'startupMessage' => '<info>Using local config file (tinker.config.php)</info>',
|
||||
|
||||
'commands' => [
|
||||
// new \App\Tinker\TestCommand,
|
||||
],
|
||||
];
|
Loading…
Add table
Reference in a new issue