Skip to content

Jhnbrn90/BlogPackage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 git@github.com: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.