Giter Site home page Giter Site logo

blogpackage's Introduction

Introduction

This package is meant to provide a reference when you're following along with the documentation on LaravelPackage.com. Along the way, we'll build a demo package (called "BlogPackage") by introducing the functionalities (as listed below) one-by-one. When something doesn't work as expected in your own package, you might use this repository to quickly find out if the bug is in your package or in the documentation (by running this package's test suite).

Package contents

The demo package features the following components:

Installation and Usage

  • Clone this repository: git clone [email protected]:Jhnbrn90/BlogPackage.git
  • Install the dependencies: composer install
  • Confirm by running all tests: composer test

Now you're free to use this demo package to your advantage. You can also include the demo package in a Laravel project if you wish, check the section below.

Using this package in a Laravel project

You can easily use this packge in a local Laravel project, after cloning:

  1. Specify a new repository in your composer.json file of the Laravel project (not this package!):
// composer.json

{
  "repositories": [
    {
      "type": "path",
      "url": "../../blogpackage" // the relative path to your package
    }
  ]
}
  1. Require the package in the local Laravel project:
composer require johndoe/blogpackage
  1. Optionally publish the package assets:
php artisan vendor:publish --provider="JohnDoe\BlogPackage\BlogPackageServiceProvider" --tag="config"

php artisan vendor:publish --provider="JohnDoe\BlogPackage\BlogPackageServiceProvider" --tag="migrations"

php artisan vendor:publish --provider="JohnDoe\BlogPackage\BlogPackageServiceProvider" --tag="views"

php artisan vendor:publish --provider="JohnDoe\BlogPackage\BlogPackageServiceProvider" --tag="assets"

Testing

This package includes a Unit and Feature test suite covering all mentioned components. You can easily run all tests for this package using composer test, or a specific test using composer test-f test-name-here.

blogpackage's People

Contributors

jhnbrn90 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

blogpackage's Issues

Error running tests

I followed your instructions when it came to structuring the package. Every time I run composer test, I get this error:
PDOException: SQLSTATE[HY000]: General error: 1 no such table: users

This is the test class:

<?php

namespace Package\Tests\Feature\Auth;

use Package\Tests\User;
use Illuminate\Foundation\Testing\RefreshDatabase;

class AuthenticationTest extends \Orchestra\Testbench\TestCase
{
    use RefreshDatabase;

    /**
     * setup
     */
    public function setUp(): void
    {
        parent::setUp();
        // additional setup
    }

    /** @test */
    public function test_authentication_is_working()
    {       
        User::factory()->create();
    }

    protected function tearDown(): void
    {
        parent::tearDown();
    }
}

I still didn't assert anything but the error is showing anyway. Any help to solve it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.