Skip to content

Commit 90eae4d

Browse files
committed
Refactor package to use model:show (#31)
1 parent 63903d5 commit 90eae4d

15 files changed

+450
-570
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Laravel Model Factory Generator
2-
This package generates model factories from existing models using the new [class-based factories](https://laravel.com/docs/8.x/database-testing#writing-factories) in Laravel 8.
2+
This package generates model factories from existing models using the new [class-based factories](https://laravel.com/docs/8.x/database-testing#writing-factories) introduced in Laravel 8.
33

44

55
## Installation
@@ -9,7 +9,7 @@ You may install this package via composer by running:
99
composer require --dev laravel-shift/factory-generator
1010
```
1111

12-
The package will automatically register itself.
12+
The package will automatically register itself using Laravel's package discovery.
1313

1414

1515
## Usage
@@ -49,4 +49,4 @@ It has diverged to support the latest version of Laravel and to power part of th
4949

5050

5151
## Contributing
52-
Contributions should be submitted to the `master` branch. Any submissions should be complete with tests and adhere to the [PSR-2 code style](https://www.php-fig.org/psr/psr-2/). You may also contribute by [opening an issue](https://github.com/laravel-shift/factory-generator/issues).
52+
Contributions should be submitted to the `master` branch. Any submissions should be complete with tests and adhere to the [Laravel code style](https://www.php-fig.org/psr/psr-2/). You may also contribute by [opening an issue](https://github.com/laravel-shift/factory-generator/issues).

composer.json

+12-9
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,27 @@
55
"license": "MIT",
66
"keywords": ["laravel", "factory", "model", "testing"],
77
"require": {
8-
"illuminate/support": "^9.0|^10.0",
9-
"fakerphp/faker": "^1.9.1",
10-
"naoray/eloquent-model-analyzer": "^3.0|^4.0",
11-
"nikic/php-parser": "^4.15"
8+
"php": "^8.1",
9+
"illuminate/support": "^10.0|^11.0",
10+
"fakerphp/faker": "^1.9.1"
1211
},
1312
"require-dev": {
14-
"orchestra/testbench": "^7.0|^8.0"
13+
"orchestra/testbench": "^8.0|^9.0",
14+
"phpunit/phpunit": "^10.5"
1515
},
1616
"autoload": {
1717
"psr-4": {
18-
"Shift\\FactoryGenerator\\": "./src"
18+
"Shift\\FactoryGenerator\\": "src"
1919
}
2020
},
2121
"autoload-dev": {
2222
"psr-4": {
23-
"Tests\\": "./tests",
24-
"App\\": "./vendor/orchestra/testbench-core/laravel/app"
25-
}
23+
"Tests\\": "tests",
24+
"App\\": "vendor/orchestra/testbench-core/laravel/app"
25+
},
26+
"exclude-from-classmap": [
27+
"tests/migrations"
28+
]
2629
},
2730
"extra": {
2831
"laravel": {

phpunit.xml

+17-19
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false">
3-
4-
<testsuites>
5-
<testsuite name="naoray/laravel-factory-prefill Test Suite">
6-
<directory>tests</directory>
7-
</testsuite>
8-
</testsuites>
9-
<php>
10-
<env name="APP_ENV" value="testing"/>
11-
<env name="BCRYPT_ROUNDS" value="4"/>
12-
<env name="DB_CONNECTION" value="sqlite"/>
13-
<env name="DB_DATABASE" value=":memory:"/>
14-
</php>
15-
16-
<filter>
17-
<whitelist addUncoveredFilesFromWhitelist="false">
18-
<directory suffix=".php">src/</directory>
19-
</whitelist>
20-
</filter>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<testsuites>
4+
<testsuite name="naoray/laravel-factory-prefill Test Suite">
5+
<directory>tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
<php>
9+
<env name="APP_ENV" value="testing"/>
10+
<env name="BCRYPT_ROUNDS" value="4"/>
11+
<env name="DB_CONNECTION" value="sqlite"/>
12+
<env name="DB_DATABASE" value=":memory:"/>
13+
</php>
14+
<source>
15+
<include>
16+
<directory suffix=".php">src/</directory>
17+
</include>
18+
</source>
2119
</phpunit>

pint.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"preset": "laravel",
3+
"notPaths": []
4+
}

0 commit comments

Comments
 (0)