Giter Site home page Giter Site logo

nova-multiline-text's Introduction

Nova Multiline Field

Latest Version on Packagist Total Downloads

Sample Sample

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require orlyapps/nova-multiline-text

Usage

Use this field in your Nova Resource

// ...
use Orlyapps\NovaMultilineText\MultilineText;
// ...

public function fields(Request $request)
{
    return [
        ID::make()->sortable(),
        MultilineText::make('Company', function () {
            return [$this->company->name, $this->department->name, $this->location->name];
        }),
        MultilineText::make('Company', function () {
            return ['First Line highlighted', 'Second Line', 'Lorem Ipsum'];
        }),
         MultilineText::make('Company', function () {
            return ['First Line', 'Second Line', 'Lorem Ipsum'];
        })->highlightFirst(false),

    ];
}

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

nova-multiline-text's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nova-multiline-text's Issues

Using date breaks the layout.

Thank you for your work!

Since Nova requires the attribute having a date to be cast, using a date in the multiline field outputs:

{ "date": "1984-07-21 00:00:00.000000", "timezone_type": 3, "timezone": "UTC" }

Which i think is incorrect.

Add blank new line such as \r\n

how can i add an empty new line between the item inside the array, eg
return MultilineText::make('Name',function () {
return [
"First line",
"\r\n",
"Second line"
];
});

Thank you!

Doesn't work with relationships

Hello,
I can see that works in the index but not in the forms when you are using a relationship.

            MultilineText::make('Student', function () {
                return [$this->user->name, $this->user->email];
            }),

I am a bit noob in this then maybe answer is quite simple.
Thanks for your time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.