Skip to content

Commit

Permalink
Merge branch '0.8' into 0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
glennjacobs authored May 6, 2024
2 parents 8895072 + 6e0752a commit 70b5591
Show file tree
Hide file tree
Showing 151 changed files with 2,418 additions and 727 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_size = 4
indent_style = space
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
19 changes: 19 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
* text=auto eol=lf

*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php

/.github export-ignore
/docs export-ignore
/packages/**/tests export-ignore
/utils/**/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/monorepo-builder.php export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml export-ignore
/pint.json export-ignore
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: "\U0001F41B Bug report"
about: Report something that's broken.
title: ''
labels: bug
labels: bug,unconfirmed
assignees: ''

---
Expand Down
19 changes: 11 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
/vendor/
composer.lock
/vendor
.phpunit.result.cache
/.DS_Store
/.fleet
/.idea
/.nova
/.phpunit.cache
/.vscode
node_modules/
yarn.lock
/node_modules
/vendor

.phpunit.result.cache
composer.lock
package-lock.json
.DS_Store
.nova
phpstan.neon
Thumbs.db
yarn.lock
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This repository serves as a monorepo for the main packages that make up Lunar.
## Community

- [Join our discord server](https://discord.gg/v6qVWaf) and chat to the developers and people using Lunar.
- [We have a roadmap](https://github.com/orgs/lunarphp/projects/1) where we will be detailing which features are next.
- [We have a roadmap](https://github.com/orgs/lunarphp/projects/8) where we will be detailing which features are next.

## Packages in this monorepo

Expand Down
4 changes: 2 additions & 2 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ export default defineConfig({
]
},
{
text: '0.7',
text: '0.8',
items: [
{text: 'Changelog', link: '/core/upgrading'},
{text: 'Contributing', link: '/core/contributing'},
{text: 'Docs Next', link: 'https://docs-next.lunarphp.io/'}
{text: '1.x Docs', link: 'https://docs-v1.lunarphp.io/'}
]
}
],
Expand Down
6 changes: 0 additions & 6 deletions docs/core/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ You can contribute to the project in many different ways. Reporting bugs, fixing

Lunar uses a monorepo [lunarphp/lunar](https://github.com/lunarphp/lunar) approach to maintaining its codebase. [Monorepos](https://en.wikipedia.org/wiki/Monorepo) are quite common, but may not be familiar to some. The monorepo helps us to organise the code for ease of development.

## Repository Branching

**Bug Fixes** should target the latest compatible branch version i.e `0.7`. The `main` branch should never have bug fix PR's unless they fix features that are in an upcoming release.

**Features** that bring new (or enhance current) functionality to Lunar should always target the `main` branch.

## Contributing Code

The basic process for contributing to Lunar is as follows...
Expand Down
32 changes: 31 additions & 1 deletion docs/core/reference/carts.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ CartSession::add($purchasable, $quantity);
```php
CartSession::addLines([
[
'id' => 1,
'purchasable' => \Lunar\Models\ProductVariant::find(123),
'quantity' => 25,
'meta' => ['foo' => 'bar'],
],
Expand Down Expand Up @@ -466,3 +466,33 @@ return [
```

In most cases you won't need to change this.

## Pruning cart data

Over time you will experience a build up of carts in your database that you may want to regularly remove.

You can enable automatic removal of these carts using the `lunar.carts.prune_tables.enabled` config. By setting this to `true` any carts without an order associated will be removed after 90 days.

You can change the number of days carts are retained for using the `lunar.carts.prune_tables. prune_interval` config.

If you have specific needs around pruning you can also change the `lunar.carts.prune_tables.pipelines` array to determine what carts should be removed.



```php
return [
// ...
'prune_tables' => [

'enabled' => false,

'pipelines' => [
Lunar\Pipelines\CartPrune\PruneAfter::class,
Lunar\Pipelines\CartPrune\WithoutOrders::class,
],

'prune_interval' => 90, // days

],
];
```
4 changes: 2 additions & 2 deletions docs/core/reference/customers.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ $myModel->scheduleCustomerGroup(
// Schedule the product to be enabled straight away
$myModel->scheduleCustomerGroup($customerGroup);

// The schedule method will accept and array or collection of customer groups.
// The schedule method will accept an array or collection of customer groups.
$myModel->scheduleCustomerGroup(CustomerGroup::get());
```

Expand Down Expand Up @@ -217,7 +217,7 @@ You can override any of these yourself as they are merged behind the scenes.

The `HasCustomerGroup` trait adds a `customerGroup` scope to the model. This lets you query based on availability for a specific or multiple customer groups.

The scope will accept either a single ID or instance of `CustomerGroup` and will accept accept an array.
The scope will accept either a single ID or instance of `CustomerGroup` and will accept an array.

```php
$results = MyModel::customerGroup(1, $startDate, $endDate)->paginate();
Expand Down
8 changes: 8 additions & 0 deletions docs/core/reference/discounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ Discount::usable()->get();
Discount::products($productIds, $type = 'condition');
```

### Resetting the discount cache

For performance reasons the applicable discounts are cached per request. If you need to reset this cache (for example after adding a discount code) you should call `resetDiscounts()`:

```php
Discount::resetDiscounts();
```

## Discount Purchasable

You can relate a purchasable to a discount via this model. Each has a type for whether it's a `condition` or `reward`.
Expand Down
15 changes: 15 additions & 0 deletions docs/core/reference/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,18 @@ class YourCustomModel extends Model
```

Now your models will auto generate transforms as defined in your configuration and still use medialibrary under the hood.

## Use custom disk

By default, media is stored on the `public` disk. If you want to use a different disk, you need to set the environment variable `MEDIA_DISK` to the name of the disk you want to use.

```shell
MEDIA_DISK=s3
```
If you need more customisation, you can install publish the configuration file of `spatie/laravel-medialibrary`.

```shell
php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="config"
```

Then you can change the disk in the configuration file `config/media-library.php`.
5 changes: 2 additions & 3 deletions docs/core/reference/orders.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ $cart->canCreateOrder();
Under the hood this will use the `ValidateCartForOrderCreation` class which lunar provides and throw any validation
exceptions with helpful messages if the cart isn't ready to create an order.

You can specific you're own class to handle this in `config/cart.php`.
You can specify you're own class to handle this in `config/cart.php`.

```php
return [
Expand Down Expand Up @@ -365,8 +365,7 @@ $order->refunds; // Get all transactions that are refunds.
We will be looking to add support for the most popular payment providers, so keep an eye out here as we will list them
all out.

In the meantime, you can absolutely still get a storefront working, at the end of the day Lunar doesn't really mind if
you what payment provider you use or plan to use.
In the meantime, you can absolutely still get a storefront working, at the end of the day Lunar doesn't really mind what payment provider you use or plan to use.

In terms of an order, all it's worried about is whether or not the `placed_at` column is populated on the orders table,
the rest is completely up to you how you want to handle that. We have some helper utilities to make such things easier
Expand Down
4 changes: 2 additions & 2 deletions docs/core/reference/products.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $product->schedule($customerGroup, now()->addDays(14));
// Schedule the product to be enabled straight away
$product->schedule($customerGroup);

// The schedule method will accept and array or collection of customer groups.
// The schedule method will accept an array or collection of customer groups.
$product->schedule(CustomerGroup::get());
```

Expand Down Expand Up @@ -105,7 +105,7 @@ $product->load(['productType']);
## Product Identifiers

You can choose to add product identifiers to each product variant. These are fields which, as the name suggests, allow
you to identify a product and it's variants for use in your internal systems. You can choose whether these are required
you to identify a product and its variants for use in your internal systems. You can choose whether these are required
and unique in the hub whilst editing.

### Available fields
Expand Down
2 changes: 1 addition & 1 deletion docs/core/reference/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ If you installed the Lunar package in an existing project and you would like to
php artisan lunar:search:index
```

The command will import the records of the models listed in the `lunar/indexer.php` configuration file. Type `--help` to see the available options.
The command will import the records of the models listed in the `lunar/search.php` configuration file. Type `--help` to see the available options.

## Engine Mapping

Expand Down
4 changes: 3 additions & 1 deletion docs/core/reference/tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ You can then attach tags like so:
```php
$tags = collect(['Tag One', 'Tag Two', 'Tag Three']);

$model = SomethingWithTags::syncTags($tags);
$model = SomethingWithTags::first();

$model->syncTags($tags);

$model->tags;

Expand Down
4 changes: 4 additions & 0 deletions docs/core/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ php artisan lunar:hub:install

Lunar currently provides bug fixes and security updates for only the latest minor release, e.g. `0.7`.

## 0.8

No significant changes.

## 0.7

### High Impact
Expand Down
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"type": "module",
"devDependencies": {
"vitepress": "^1.0.0-rc.31"
},
Expand Down
7 changes: 7 additions & 0 deletions packages/admin/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* text=auto eol=lf

/.github export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml export-ignore
1 change: 1 addition & 0 deletions packages/admin/resources/lang/en/global.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,5 @@
'not_provided' => 'Not Provided',
'billing_email' => 'Billing Email',
'add_new' => 'Add new',
'store' => 'Store',
];
3 changes: 1 addition & 2 deletions packages/admin/resources/lang/en/partials.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
'discounts.limitations.limitation' => 'Limitation',
'discounts.limitations.exclusion' => 'Exclusion',
/**
* Product Collections.
*/
'products.collections.heading' => 'Collections',
Expand Down Expand Up @@ -133,7 +132,7 @@
'pricing.customer_groups.title' => 'Customer group pricing',
'pricing.customer_groups.strapline' => 'Determines if you would like different pricing across customer groups.',
'pricing.tiers.title' => 'Tiered Pricing',
'pricing.tiers.strapline' => 'Tired pricing allows you to offer discounted pricing based on units sold.',
'pricing.tiers.strapline' => 'Tiered pricing allows you to offer discounted pricing based on units sold.',
'pricing.non_default_currency_alert' => 'Some fields can only be changed when using the default currency.',
'pricing.tiers.add_tier_btn' => 'Add Tier',
/**
Expand Down
10 changes: 10 additions & 0 deletions packages/admin/resources/lang/fr/account.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

return [
'title' => 'Compte',
'save_btn' => 'Enregistrer',
'avatar_notice' => 'Votre avatar est généré à l\'aide de Gravatar via votre adresse email.',
'view-profile' => 'Voir mon profil',
'update_password' => 'Modifier mon mot de passe',
'logout' => 'Déconnexion',
];
46 changes: 46 additions & 0 deletions packages/admin/resources/lang/fr/auth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

return [
/**
* Collections.
*/
'permissions.catalogue.collections.name' => 'Collections',
'permissions.catalogue.collections.description' => 'Autoriser le membre du personnel à modifier les collections et leurs groupes.',
'permissions.settings.name' => 'Paramètres',
'permissions.settings.description' => 'Donne accès à la zone des paramètres du hub.',
'permissions.settings.core.name' => 'Paramètres de base',
'permissions.settings.core.description' => 'Accédez aux paramètres fondamentaux de la boutique, tels que les chaînes, les langues, les devises, etc.',
'permissions.settings.staff.name' => 'Gérer le personnel',
'permissions.settings.staff.description' => 'Autoriser le membre du personnel à gérer les autres membres du personnel.',
'permissions.settings.attributes.name' => 'Gérer les attributs',
'permissions.settings.attributes.description' => 'Autoriser le membre du personnel à gérer les attributs.',
'permissions.catalogue.products.name' => 'Gérer les produits',
'permissions.catalogue.products.description' => 'Autoriser le membre du personnel à gérer les produits.',
'permissions.catalogue.orders.name' => 'Gérer les commandes',
'permissions.catalogue.orders.description' => 'Autoriser le membre du personnel à gérer les commandes.',
'permissions.catalogue.customers.name' => 'Gérer les clients',
'permissions.catalogue.customers.description' => 'Autoriser le membre du personnel à gérer les clients.',
'permissions.discounts.name' => 'Gérer les remises',
'permissions.discounts.description' => 'Autoriser le membre du personnel à gérer les remises.',
/**
* Reset password.
*/
'reset-password.title' => 'Réinitialiser le mot de passe',
'reset-your-password' => 'Réinitialiser votre mot de passe',
'reset-password.invalid' => 'Cette page n\'est plus valide.',
'reset-password.back_link' => 'Retour connexion',
'reset-password.send_btn' => 'Envoyer un e-mail de réinitialisation',
'reset-password.update_btn' => 'Mettre à jour le mot de passe et l\'identifiant',
'forgot-password.message' => 'Mot de passe oublié ?',
'forgot-password.remember' => 'Se souvenir de votre mot de passe ?',
'forgot-password.link' => 'Réinitialiser le mot de passe',
'follow-link.reset' => 'Veuillez suivre ce lien pour réinitialiser votre mot de passe :',
'click-here.reset' => 'Cliquez ici pour réinitialiser',
'reset-link.not_working' => 'Le lien ne fonctionne pas ? Copiez ceci dans votre navigateur',
/**
* Login.
*/
'sign-in.btn' => 'Se connecter',
'welcome' => 'Bienvenue :name',
'prompt' => 'Connectez-vous pour administrer votre boutique e-commerce.',
];
Loading

0 comments on commit 70b5591

Please sign in to comment.