https://github.com/lassehaslev/laravelpackagetemplate
Temmplate for kickstaring new LaravelPackages
https://github.com/lassehaslev/laravelpackagetemplate
Last synced: 6 days ago
JSON representation
Temmplate for kickstaring new LaravelPackages
- Host: GitHub
- URL: https://github.com/lassehaslev/laravelpackagetemplate
- Owner: LasseHaslev
- Created: 2016-11-23T17:19:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-05T13:00:07.000Z (over 9 years ago)
- Last Synced: 2025-01-05T09:29:19.672Z (over 1 year ago)
- Language: PHP
- Size: 79.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lassehaslev/LaravelPackageTemplate
## Getting started
#### Install dependencies
``` bash
# Make this package yours by running
# Make shure you have to \slash every special character ("\" and "/")
sh install.sh
# If you did not wanted to let the script install dependencies for you
# Install dependencies
composer install
# Install dependencies for automatic tests
yarn
```
## Development
#### Service provider
Your package service provider can be found in ```src/Providers/ServiceProvider.php```.
See [ Laravel documentations ](https://laravel.com/docs/5.3/packages#service-providers) for mor information.
#### Configuration
Your package configurations can be changed in ```config/```.
See [ Laravel documentations ](https://laravel.com/docs/5.3/database-testing#writing-factories) for mor information.
#### Migrations
Your migrations should be added in ```database/migrations/```.
See [ Laravel documentations ](https://laravel.com/docs/5.3/migrations) for mor information.
#### Factories
You can edit your factoreis in ```database/factories/ModelFactory.php```.
See [ Laravel documentations ](https://laravel.com/docs/5.3/database-testing#writing-factories) for mor information.
#### Write tests
We use [PHPUnit](https://phpunit.de/) to write tests.
For more information check out [https://laravel.com/docs/5.3/testing](https://laravel.com/docs/5.3/testing)
Add your tests in ```tests/``` folder.
Your migrations will automaticly be added before each test.
``` php
class MyTest extends TestCase {
/*
* This function will run before each test.
* ( Optional )
*/
public function setUp()
{
parent::setUp();
// Your logic here
}
/** @test */
public function my_first_test() {
$this->assertTrue( true );
}
}
```
## Usage after development
Run ```composer require %composername%```
Create your package and add the following line to ```providers``` in ```config/app.php```
```
%namespace%\Providers\ServiceProvider::class,
```
#### Runing tests
``` bash
# Run one time
npm run test
# Automaticly run test on changes
npm run dev
```