Skip to content

Commit

Permalink
Experimental release
Browse files Browse the repository at this point in the history
  • Loading branch information
sawirricardo committed May 20, 2022
1 parent 7e67f9a commit 0bf828e
Show file tree
Hide file tree
Showing 22 changed files with 169 additions and 448 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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/sawirricardo/laravel-previousable/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/sawirricardo/laravel-previousable/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/sawirricardo/laravel-previousable/security/policy
about: Learn how to notify us for sensitive bugs
- name: Report a bug
url: https://github.com/:vendor_name/:package_name/issues/new
url: https://github.com/sawirricardo/laravel-previousable/issues/new
about: Report a reproducable bug
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ testbench.yaml
vendor
node_modules
.php-cs-fixer.cache
tests/temp/database.sqlite
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 `laravel-previousable` 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 <author@domain.com>
Copyright (c) sawirricardo <sawir.ricardo@gmail.com>

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
73 changes: 22 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,41 @@
# Generate previous attributes when saving Eloquent models

[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/support-ukraine.svg?t=1" />](https://supportukrainenow.org)
### From https://twitter.com/SteveTheBauman/status/1524865758043553816. Credit to Steve Bauman.

# :package_description
[![Latest Version on Packagist](https://img.shields.io/packagist/v/sawirricardo/laravel-previousable.svg?style=flat-square)](https://packagist.org/packages/sawirricardo/laravel-previousable)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/sawirricardo/laravel-previousable/run-tests?label=tests)](https://github.com/sawirricardo/laravel-previousable/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/sawirricardo/laravel-previousable/Check%20&%20fix%20styling?label=code%20style)](https://github.com/sawirricardo/laravel-previousable/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/sawirricardo/laravel-previousable.svg?style=flat-square)](https://packagist.org/packages/sawirricardo/laravel-previousable)

[![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/workflow/status/:vendor_slug/:package_slug/run-tests?label=tests)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/:vendor_slug/:package_slug/Check%20&%20fix%20styling?label=code%20style)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3A"Check+%26+fix+styling"+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:

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.
4. If you need help creating a package, consider picking up our <a href="https://laravelpackage.training">Laravel Package Training</a> video course.
---
<!--/delete-->
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
This package provides a trait that will generate previous attributes when saving any Eloquent model.

## Support us

[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/:package_name.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/:package_name)
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/laravel-previousable.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/laravel-previousable)

We invest a lot of resources into creating [best in class open source packages](https://github.com/sawirricardo). You can support by donating to

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
- [Paypal](https://paypal.me/sawirricardo)
- BCA 8330123584

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).
I appreciate you if you connect with me on [Twitter](https://twitter.com/RicardoSawir)

## Installation

You can install the package via composer:

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

You can publish and run the migrations with:

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

You can publish the config file with:

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

This is the contents of the published config file:

```php
return [
];
```

Optionally, you can publish the views using

```bash
php artisan vendor:publish --tag=":package_slug-views"
composer require sawirricardo/laravel-previousable
```

## Usage

```php
$variable = new VendorName\Skeleton();
echo $variable->echoPhrase('Hello, VendorName!');
$model = EloquentModel::create(['name' => 'Awesome application']);
$model->update(['name' => 'New attribute']);

$model->getPrevious(); // ['name' => 'Awesome application']
$model->getPrevious('name'); // 'Awesome application'
```

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

## Credits

- [:author_name](https://github.com/:author_username)
- [All Contributors](../../contributors)
- [Steve Bauman](https://twitter.com/SteveTheBauman)
- [sawirricardo](https://github.com/sawirricardo)
- [All Contributors](../../contributors)

## License

Expand Down
36 changes: 15 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": ":vendor_slug/:package_slug",
"description": ":package_description",
"name": "sawirricardo/laravel-previousable",
"description": "From https://twitter.com/SteveTheBauman/status/1524865758043553816. Credit to Steve Bauman.",
"keywords": [
":vendor_name",
"sawirricardo",
"laravel",
":package_slug"
"laravel-previousable"
],
"homepage": "https://github.com/:vendor_slug/:package_slug",
"homepage": "https://github.com/sawirricardo/laravel-previousable",
"license": "MIT",
"authors": [
{
"name": ":author_name",
"email": "author@domain.com",
"name": "sawirricardo",
"email": "sawir.ricardo@gmail.com",
"role": "Developer"
}
],
Expand All @@ -34,31 +34,25 @@
},
"autoload": {
"psr-4": {
"VendorName\\Skeleton\\": "src",
"VendorName\\Skeleton\\Database\\Factories\\": "database/factories"
"Sawirricardo\\Previousable\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"VendorName\\Skeleton\\Tests\\": "tests"
"Sawirricardo\\Previousable\\Tests\\": "tests"
}
},
"scripts": {
"analyse": "vendor/bin/phpstan analyse",
"test": "vendor/bin/pest",
"test-coverage": "vendor/bin/pest --coverage"
"test-coverage": "vendor/bin/pest --coverage",
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes"
},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"VendorName\\Skeleton\\SkeletonServiceProvider"
],
"aliases": {
"Skeleton": "VendorName\\Skeleton\\Facades\\Skeleton"
}
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"phpstan/extension-installer": true
}
},
"minimum-stability": "dev",
Expand Down
5 changes: 0 additions & 5 deletions config/skeleton.php

This file was deleted.

Loading

0 comments on commit 0bf828e

Please sign in to comment.