Skip to content

Commit

Permalink
feat: capabilities with basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-frey committed Sep 24, 2024
1 parent 38b0e11 commit be2c758
Show file tree
Hide file tree
Showing 44 changed files with 6,471 additions and 424 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/:vendor_name/:package_name/discussions/new?category=q-a
url: https://github.com/Guava/capabilities/discussions/new?category=q-a
about: Ask the community for help
- name: Request a feature
url: https://github.com/:vendor_name/:package_name/discussions/new?category=ideas
url: https://github.com/Guava/capabilities/discussions/new?category=ideas
about: Share ideas for new features
- name: Report a security issue
url: https://github.com/:vendor_name/:package_name/security/policy
url: https://github.com/Guava/capabilities/security/policy
about: Learn how to notify us for sensitive bugs
31 changes: 0 additions & 31 deletions .github/workflows/update-changelog.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Changelog

All notable changes to `:package_name` will be documented in this file.
All notable changes to `capabilities` will be documented in this file.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) :vendor_name <[email protected]>
Copyright (c) Guava <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
36 changes: 14 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
![:package_name Banner](docs/images/banner.jpg)
![capabilities Banner](docs/images/banner.jpg)


# :package_description
# This is my package capabilities

[![Latest Version on Packagist](https://img.shields.io/packagist/v/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/:vendor_slug/:package_slug/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/:vendor_slug/:package_slug/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
<!--delete-->
---
This repo can be used to scaffold a Laravel package. Follow these steps to get started:
[![Latest Version on Packagist](https://img.shields.io/packagist/v/guava/capabilities.svg?style=flat-square)](https://packagist.org/packages/guava/capabilities)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/guava/capabilities/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/guava/capabilities/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/guava/capabilities/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/guava/capabilities/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/guava/capabilities.svg?style=flat-square)](https://packagist.org/packages/guava/capabilities)

1. Press the "Use this template" button at the top of this repo to create a new repo with the contents of this skeleton.
2. Run "php ./configure.php" to run a script that will replace all placeholders throughout all the files.
3. Have fun creating your package.
---
<!--/delete-->
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

## Showcase
Expand All @@ -33,20 +25,20 @@ While our plugin is available for all to use, if you are utilizing it for commer
You can install the package via composer:

```bash
composer require :vendor_slug/:package_slug
composer require guava/capabilities
```

You can publish and run the migrations with:

```bash
php artisan vendor:publish --tag=":package_slug-migrations"
php artisan vendor:publish --tag="capabilities-migrations"
php artisan migrate
```

You can publish the config file with:

```bash
php artisan vendor:publish --tag=":package_slug-config"
php artisan vendor:publish --tag="capabilities-config"
```

This is the contents of the published config file:
Expand All @@ -59,14 +51,14 @@ return [
Optionally, you can publish the views using

```bash
php artisan vendor:publish --tag=":package_slug-views"
php artisan vendor:publish --tag="capabilities-views"
```

## Usage

```php
$variable = new VendorName\Skeleton();
echo $variable->echoPhrase('Hello, VendorName!');
$capabilities = new Guava\Capabilities();
echo $capabilities->echoPhrase('Hello, Guava!');
```

## Testing
Expand All @@ -89,9 +81,9 @@ Please review [our security policy](../../security/policy) on how to report secu

## Credits

- [:author_name](https://github.com/:author_username)
- [Lukas Frey](https://github.com/GuavaCZ)
- [All Contributors](../../contributors)
- Spatie - Our package skeleton is a modified version of [Spatie's Package Skeleton](https://github.com/spatie/package-skeleton-laravel)
- Spatie - Our package capabilities is a modified version of [Spatie's Package Capabilities](https://github.com/spatie/package-capabilities-laravel)

## License

Expand Down
36 changes: 18 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"name": ":vendor_slug/:package_slug",
"description": ":package_description",
"name": "guava/capabilities",
"description": "This is my package capabilities",
"keywords": [
":vendor_name",
"Guava",
"laravel",
":package_slug"
"capabilities"
],
"homepage": "https://github.com/:vendor_slug/:package_slug",
"homepage": "https://github.com/guava/capabilities",
"license": "MIT",
"authors": [
{
"name": ":author_name",
"email": "[email protected]",
"name": "Lukas Frey",
"email": "[email protected]",
"role": "Developer"
}
],
"require": {
"php": "^8.1",
"php": "^8.3",
"spatie/laravel-package-tools": "^1.14.0",
"illuminate/contracts": "^10.0|^11.0"
},
Expand All @@ -30,24 +30,24 @@
"pestphp/pest-plugin-laravel": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"spatie/laravel-ray": "^1.26"
"phpstan/phpstan-phpunit": "^1.0"
},
"autoload": {
"psr-4": {
"VendorName\\Skeleton\\": "src/",
"VendorName\\Skeleton\\Database\\Factories\\": "database/factories/"
"Guava\\Capabilities\\": "src/",
"Guava\\Capabilities\\Database\\Factories\\": "database/factories/"
}
},
"autoload-dev": {
"psr-4": {
"VendorName\\Skeleton\\Tests\\": "tests/",
"Tests\\": "tests/",
"Tests\\Database\\Factories\\": "tests/Fixtures/database/factories/",
"Workbench\\App\\": "workbench/app/"
}
},
"scripts": {
"post-autoload-dump": "@composer run prepare",
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"clear": "@php vendor/bin/testbench package:purge-capabilities --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"build": [
"@composer run prepare",
Expand All @@ -59,8 +59,8 @@
"@php vendor/bin/testbench serve"
],
"analyse": "vendor/bin/phpstan analyse",
"test": "vendor/bin/pest",
"test-coverage": "vendor/bin/pest --coverage",
"test": "vendor/bin/phpunit",
"coverage": "vendor/bin/phpunit -d xdebug.mode=coverage",
"format": "vendor/bin/pint"
},
"config": {
Expand All @@ -73,10 +73,10 @@
"extra": {
"laravel": {
"providers": [
"VendorName\\Skeleton\\SkeletonServiceProvider"
"Guava\\Capabilities\\CapabilitiesServiceProvider"
],
"aliases": {
"Skeleton": "VendorName\\Skeleton\\Facades\\Skeleton"
"Capabilities": "Guava\\Capabilities\\Facades\\Capabilities"
}
}
},
Expand Down
12 changes: 12 additions & 0 deletions config/capabilities.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

// config for Guava/Capabilities
return [
'user_class' => \Illuminate\Foundation\Auth\User::class,
'capability_class' => \Guava\Capabilities\Models\Capability::class,
'role_class' => \Guava\Capabilities\Models\Role::class,
'tenant_class' => null,

'tenancy' => false,
'tenant_column' => 'tenant_id',
];
6 changes: 0 additions & 6 deletions config/skeleton.php

This file was deleted.

Loading

0 comments on commit be2c758

Please sign in to comment.