Skip to content

Commit

Permalink
Fix #14
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristories committed Sep 21, 2022
1 parent c663c4a commit 3b67759
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 27 deletions.
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,69 @@

A Laravel Nova field to generate QR Code.

![Logo & background](art/cover.png)

## Installation

You can install the Nova field in to a [Laravel](http://laravel.com) app that uses [Nova](http://nova.laravel.com) via composer :

```cli
composer require kristories/nova-qrcode-field
composer require devtical/nova-qrcode-field
```

## Usage

```
use Kristories\Qrcode\Qrcode;
use Devtical\Qrcode\Qrcode;
```

#### Basic

```php
Qrcode::make('QR Code', 'url')
Qrcode::make('QR Code', 'field')
```

![Basic](https://i.imgur.com/V15fjwl.png)

#### Setting sizes

```php
Qrcode::make('QR Code', 'url')
Qrcode::make('QR Code', 'field')
->indexSize(100)
->detailSize(500)
```

![Size](art/1-size.png)

#### With logo

```php
Qrcode::make('QR Code', 'url')
Qrcode::make('QR Code', 'field')
->logo('http://source.to/logo.png')
```

![Logo](https://i.imgur.com/YFlAvo3.png)
![Logo](art/2-logo.png)

#### With background

```php
Qrcode::make('QR Code', 'url')
Qrcode::make('QR Code', 'field')
->background('http://source.to/background.png')
```

![Background](https://i.imgur.com/nAbuKCc.png)
![Background](art/3-background.png)

#### With logo & background

```php
Qrcode::make('QR Code', 'url')
Qrcode::make('QR Code', 'field')
->logo('http://source.to/logo.png')
->background('http://source.to/background.png')
```

![Logo & background](https://i.imgur.com/ppVi4jn.png)
![Logo & background](art/4-logo-background.png)

## Related

- [Nova QR Code Manager](https://github.com/Kristories/nova-qrcode-manager)
- [Nova QR Code Manager](https://github.com/Devtical/nova-qrcode-manager)

## Credits

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "kristories/nova-qrcode-field",
"name": "devtical/nova-qrcode-field",
"description": "Nova QR code field",
"keywords": [
"laravel",
Expand All @@ -16,7 +16,7 @@
},
"autoload": {
"psr-4": {
"Kristories\\Qrcode\\": "src/"
"Devtical\\Qrcode\\": "src/"
}
},
"scripts": {
Expand All @@ -26,7 +26,7 @@
"extra": {
"laravel": {
"providers": [
"Kristories\\Qrcode\\FieldServiceProvider"
"Devtical\\Qrcode\\FieldServiceProvider"
]
}
},
Expand Down
10 changes: 5 additions & 5 deletions resources/js/components/DetailField.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<panel-item :field="field">
<p slot="value">
<PanelItem :index="index" :field="field">
<template #value>
<vue-qr
class="qr-item"
:text="field.value"
Expand All @@ -9,14 +9,14 @@
:logoSrc="field.logo"
:margin="0"
></vue-qr>
</p>
</panel-item>
</template>
</PanelItem>
</template>

<script>
import VueQr from 'vue-qr/src/packages/vue-qr.vue'
export default {
props: ['field'],
props: ['index', 'resource', 'resourceName', 'resourceId', 'field'],
components: {
VueQr
}
Expand Down
4 changes: 2 additions & 2 deletions resources/js/field.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import IndexField from './components/IndexField'
import DetailField from './components/DetailField'

Nova.booting((app, store) => {
app.component('index-qrcode-field', IndexField)
app.component('detail-qrcode-field', DetailField)
app.component('index-qrcode', IndexField)
app.component('detail-qrcode', DetailField)
})
6 changes: 3 additions & 3 deletions src/FieldServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Kristories\Qrcode;
namespace Devtical\Qrcode;

use Laravel\Nova\Nova;
use Laravel\Nova\Events\ServingNova;
use Illuminate\Support\ServiceProvider;
use Laravel\Nova\Events\ServingNova;
use Laravel\Nova\Nova;

class FieldServiceProvider extends ServiceProvider
{
Expand Down
2 changes: 1 addition & 1 deletion src/Qrcode.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Kristories\Qrcode;
namespace Devtical\Qrcode;

use Illuminate\Support\Facades\Cache;
use Laravel\Nova\Fields\Field;
Expand Down

0 comments on commit 3b67759

Please sign in to comment.