Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8429bf7
Enabling Nova4 and updating package.json and composer.json files
wilkerwma Feb 1, 2023
5725191
Update field->options and request class
wilkerwma Feb 9, 2023
522244a
Update details view
wilkerwma Feb 9, 2023
bda20f8
First working version
wilkerwma Feb 9, 2023
121d57b
cs-fix
wilkerwma Feb 9, 2023
380e8d5
Updated PHP version on CI
luisdalmolin Feb 9, 2023
78b1681
Fixed composer nova config line
luisdalmolin Feb 9, 2023
f523126
Using license key
luisdalmolin Feb 9, 2023
631239e
Update PHPUnit files
wilkerwma Feb 9, 2023
4464d71
Translation and plural changes
wilkerwma Feb 9, 2023
c444f3e
wip
luisdalmolin Feb 9, 2023
39c3933
wip
luisdalmolin Feb 9, 2023
dfee4d7
Adjusting tests
luisdalmolin Feb 15, 2023
22edbdd
Fixed HasOneTest
luisdalmolin Feb 15, 2023
f10a4d1
Fixed code style
luisdalmolin Feb 15, 2023
94c92a4
Merge pull request #113 from kirschbaum-development/feature/nova-4-su…
luisdalmolin Feb 15, 2023
b2ef5d0
Updated readme
luisdalmolin Feb 15, 2023
ae2f026
Update README.md
adammparker May 24, 2023
efa4746
Update NovaInlineRelationshipObserver.php
einnar82 Jun 11, 2023
e1b5c91
fixed field to nova:4.26+
AguarLincoln Nov 20, 2023
0bcc79c
Use Nova Fluent instead of Laravel one
harrysbaraini Dec 21, 2023
a5593f8
Merge branch 'AguarLincoln-master'
harrysbaraini Dec 21, 2023
e2ada59
Add a custom fluent class
harrysbaraini Dec 21, 2023
909c00e
Fix style
harrysbaraini Dec 21, 2023
5103813
Merge branch 'master' into master
harrysbaraini Dec 21, 2023
ae8896d
Merge pull request #122 from einnar82/master
harrysbaraini Dec 21, 2023
13ab25b
tweaks to forceFill attribute
wilkerwma Dec 27, 2023
b3a60ac
use custom fluent class
harrysbaraini Jan 4, 2024
88806f9
Merge pull request #126 from kirschbaum-development/custom-fluent-class
harrysbaraini Jan 9, 2024
0daa7fc
Fix duplicated use
harrysbaraini Jan 9, 2024
fbb307e
Merge pull request #127 from kirschbaum-development/fix-duplicated-use
harrysbaraini Jan 9, 2024
f571a78
Respect $timestamps when updating model (#71)
genesiscz Jan 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
phpunit:
runs-on: ubuntu-latest
container:
image: kirschbaumdevelopment/laravel-test-runner:7.3.0
image: kirschbaumdevelopment/laravel-test-runner:8.0

services:
mysql:
Expand All @@ -23,8 +23,7 @@ jobs:
fetch-depth: 1

- name: Configure composer for Nova
run: |
composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_PASSWORD }}"
run: composer config 'http-basic.nova.laravel.com' '${{ secrets.NOVA_USERNAME }}' '${{ secrets.NOVA_LICENSE_KEY }}'

- name: Install composer dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
php-cs-fixer:
runs-on: ubuntu-latest
container:
image: kirschbaumdevelopment/laravel-test-runner:7.3.0
image: kirschbaumdevelopment/laravel-test-runner:8.0

steps:
- uses: actions/checkout@v1
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ composer.phar
composer.lock
phpunit.xml
.phpunit.result.cache
.php-cs-fixer.cache
.DS_Store
Thumbs.db
.php_cs.cache

auth.json
32 changes: 14 additions & 18 deletions .php_cs → .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
->ignoreDotFiles(true)
->ignoreVCS(true);

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setFinder($finder)
->setRules([
'@PSR2' => true,
Expand All @@ -20,9 +20,14 @@
],
'no_singleline_whitespace_before_semicolons' => true,
'no_extra_blank_lines' => [
'break', 'case', 'continue', 'curly_brace_block', 'default',
'extra', 'parenthesis_brace_block', 'return',
'square_brace_block', 'switch', 'throw', 'use', 'useTrait', 'use_trait',
'tokens' => [
'curly_brace_block',
'extra',
'parenthesis_brace_block',
'square_brace_block',
'throw',
'use',
]
],
'cast_spaces' => [
'space' => 'single',
Expand All @@ -43,7 +48,7 @@
// 'increment_style' => ['style' => 'post'],
'short_scalar_cast' => true,
'class_attributes_separation' => [
'elements' => ['const', 'method', 'property'],
'elements' => ['method' => 'one',],
],
'no_mixed_echo_print' => [
'use' => 'echo',
Expand All @@ -54,7 +59,7 @@
],
'no_empty_statement' => true,
'unary_operator_spaces' => true, // $number ++ becomes $number++
'hash_to_slash_comment' => true, // # becomes //
'single_line_comment_style' => true, // # becomes //
'standardize_not_equals' => true, // <> becomes !=
'native_function_casing' => true,
'ternary_operator_spaces' => true,
Expand All @@ -64,16 +69,7 @@
],
'function_typehint_space' => true,
'no_leading_import_slash' => true,
'blank_line_before_statement' => [
'statements' => [
'break', 'case', 'continue',
'declare', 'default', 'die',
'do', 'exit', 'for', 'foreach',
'goto', 'if', 'include',
'include_once', 'require', 'require_once',
'return', 'switch', 'throw', 'try', 'while', 'yield',
],
],
'blank_line_before_statement' => true,
'combine_consecutive_unsets' => true,
'method_chaining_indentation' => true,
'no_whitespace_in_blank_line' => true,
Expand All @@ -84,7 +80,7 @@
'compact_nullable_typehint' => true,
'explicit_string_variable' => true,
'no_leading_namespace_whitespace' => true,
'trailing_comma_in_multiline_array' => true,
'trailing_comma_in_multiline' => true,
'not_operator_with_successor_space' => true,
'object_operator_without_whitespace' => true,
'single_blank_line_before_namespace' => true,
Expand Down Expand Up @@ -113,7 +109,7 @@
'protected',
'private',
],
'sortAlgorithm' => 'none',
'sort_algorithm' => 'none',
],
'return_type_declaration' => [
'space_before' => 'none',
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@

Please note that this is experimental and is not actively maintained and supported by our team. If you are interested in helping to maintain/extend this project please reach out.

Background: we initially started this project in 2019 to add inline relationship functionality to Laravel Nova. In addition to running into some significant complexities that prevented us from efficiently moving forward, Laravel Nova has since added functionality that covers most, but not all, of what we were trying to accomplish here. We recommend using those core Laravel Nova features instead of this package at this point.
Background: we initially started this project in 2019 to add inline relationship functionality to Laravel Nova. In addition to running into some significant complexities that prevented us from efficiently moving forward, Laravel Nova has since added functionality that covers most, but not all, of what we were trying to accomplish here. We recommend using those core Laravel Nova features instead of this package at this point.

![Banner](https://raw.githubusercontent.com/kirschbaum-development/nova-inline-relationship/master/resources/imgs/banner.png "Banner")

## Nova Inline Relationship

[![Latest Version on Packagist](https://img.shields.io/packagist/v/kirschbaum-development/nova-inline-relationship.svg)](https://packagist.org/packages/kirschbaum-development/nova-inline-relationship)
[![Total Downloads](https://img.shields.io/packagist/dt/kirschbaum-development/nova-inline-relationship.svg)](https://packagist.org/packages/kirschbaum-development/nova-inline-relationship)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/56297e6b77604f37a505edf234ca2a4b)](https://www.codacy.com/manual/Kirschbaum/nova-inline-relationship?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=kirschbaum-development/nova-inline-relationship&amp;utm_campaign=Badge_Grade)
[![Actions Status](https://github.com/kirschbaum-development/nova-inline-relationship/workflows/CI/badge.svg)](https://github.com/kirschbaum-development/nova-inline-relationship/actions)

Nova Inline Relationship allows you to manage (add/edit/update/delete/reorder) an object's relationships directly from the parent object's create/edit screens. By presenting relationships as inline properties you can provide content editors with a streamlined and efficient workflow for managing complex data.

## Requirements

This Nova field requires Nova 2.0 or higher.
This package requires Laravel Nova 4.0.

## Installation

Expand Down
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
],
"license": "MIT",
"require": {
"php": ">=7.1.0"
"php": "^7.4|^8.0"
},
"repositories": [
{
Expand All @@ -16,11 +16,10 @@
}
],
"require-dev": {
"codedungeon/phpunit-result-printer": "^0.26.2",
"orchestra/testing": "^4.0",
"phpunit/phpunit": "^8.3",
"orchestra/testbench": "^7.4",
"phpunit/phpunit": "^9.5.10",
"mockery/mockery": "^1.1",
"laravel/nova": "*"
"laravel/nova": "4.2"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 1 addition & 0 deletions dist/css/field.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 2 additions & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions dist/js/field.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*!
* vuex v4.1.0
* (c) 2022 Evan You
* @license MIT
*/

/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/

/**!
* Sortable 1.14.0
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/
2 changes: 1 addition & 1 deletion dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/js/field.js": "/js/field.js",
"/css/field.css": "/css/field.css"
}
}
40 changes: 40 additions & 0 deletions mix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const mix = require('laravel-mix');
const webpack = require('webpack');
const path = require('path');

class NovaExtension {
name() {
return 'nova-extension';
}

register(name) {
this.name = name;
}

webpackPlugins() {
return new webpack.ProvidePlugin({
_: 'lodash',
Errors: 'form-backend-validation',
});
}

webpackConfig(webpackConfig) {
webpackConfig.externals = {
vue: 'Vue',
};

webpackConfig.resolve.alias = {
...(webpackConfig.resolve.alias || {}),
'laravel-nova': path.join(
__dirname,
'../../vendor/laravel/nova/resources/js/mixins/packages.js'
),
};

webpackConfig.output = {
uniqueName: this.name,
};
}
}

mix.extend('nova', new NovaExtension())
33 changes: 19 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,29 @@
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
"production": "mix --production"
},
"devDependencies": {
"cross-env": "^5.0.0",
"laravel-mix": "^1.0",
"laravel-nova": "^1.0"
},
"dependencies": {
"vue": "^2.5.0",
"vuedraggable": "^2.20.0",
"@inertiajs/inertia": "^0.11.0",
"@vue/babel-plugin-jsx": "^1.1.0",
"@vue/compiler-sfc": "^3.2.22",
"form-backend-validation": "^2.3.3",
"inflector-js": "^1.0.1",
"laravel-mix": "^6.0.41",
"lodash": "^4.17.21",
"postcss": "^8.3.11",
"vue-loader": "^16.8.3",
"vuex": "^4.0.2",
"lodash.template": "^4.5.0",
"mem": "^4.0.0",
"js-yaml": "^3.13.1",
"webpack-dev-server": "^3.1.11"
}
"webpack-dev-server": "^3.1.11",
"vuedraggable": "^4.1.0"
},
"dependencies": {}
}
32 changes: 11 additions & 21 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
printerClass="Codedungeon\PHPUnitPrettyResultPrinter\Printer">
<testsuites>
<testsuite name="Nova Inline Relationship Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Nova Inline Relationship Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
22 changes: 22 additions & 0 deletions phpunit.xml.dist.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Nova Inline Relationship Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
</phpunit>
Empty file added resources/css/field.css
Empty file.
Loading