Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolving DB Factory Namespace Issue on Laravel 8.x #40

Merged
merged 2 commits into from
Apr 20, 2021

Conversation

nafiesl
Copy link
Owner

@nafiesl nafiesl commented Apr 20, 2021

Description

In this PR, we are resolving #39, where we are creating the model factory class within subdirectories and updating the class namespace.

  • Store the generated model factory class into subdirectories
  • Update the model factory class namespace.

How to test on localhost

  1. $ laravel new simple_crud_test
  2. $ cd simple_crud_test
  3. Update phpunit.xml using sqlite in memory database
    <server name="DB_CONNECTION" value="sqlite"/>
    <server name="DB_DATABASE" value=":memory:"/>
    
  4. $ composer require laravel/ui
  5. $ composer require luthfi/simple-crud-generator dev-39_db_factory_namespace_issue --dev
  6. $ php artisan ui bootstrap --auth
  7. $ php artisan make:crud Phone (Phone model on the app/Models directory)
  8. $ vendor/bin/phpunit (all tests are passed)
  9. $ php artisan make:crud Entities/Units/Unit (Unit model on the app/Entities/Units/Unit directory)
  10. $ vendor/bin/phpunit --stop-on-failure
  11. All tests should be passed (UnitFactory on the database/factories/Entities/Units directory).

Screenshot

screen_2021-04-20_010

@nafiesl nafiesl marked this pull request as ready for review April 20, 2021 07:40
@nafiesl nafiesl merged commit cf4be00 into master Apr 20, 2021
@nafiesl nafiesl deleted the 39_db_factory_namespace_issue branch April 20, 2021 07:42
@nafiesl nafiesl changed the title Resolving DB Factory Namespace Issue Resolving DB Factory Namespace Issue on Laravel 8.x Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant