Giter Club home page Giter Club logo

laranote's Introduction

A note maker for Laravel

  1. Install Laranote composer require haymetg/laranote
  2. Run php artisan vendor:publish --provider="HaymeTG\Laranote\LaranoteServiceProvider"
  3. Use HasLaranote trait for models with notes.
  4. Use it.

Trait Methods:

createNote() for creating a note example: $user->createNote('Im a note'); will fetch all notes saved in the model.

getNote($index) for updating a note example: $user->getNote($index); will get note by index saved in the model. Please note that this will only return note belong to parent model

updateNote($index, $noteText) for updating a note example: $user->updateNote($index); will update note by index saved in the model. Please note that this will only update note belong to parent model

deleteNote($index) for deleting a note example: $user->deleteNote($index); will delete note by index saved in the model. Please note that this will only delete note belong to parent model

deleteAll() for deleting a note example: $user->deleteAll(); will delete all note saved in the model. Please note that this will only delete note belong to parent model

Trait Accessors:

  • notes example: $user->notes Will retrieve all notes saved. This will return a collection

  • first_note example: $user->first_note Will retrieve the first note created by id.

  • last_note example: $user->last_note Will retrieve the last note created by id.

  • latest_note example: $user->latest_note Will retrieve the latest note created by date.

Model Accessors:

  • laranotable example: $user->laranotable Will retrieve the parent model of a laranote.

laranote's People

Contributors

huhu2323 avatar

Stargazers

Liam Nicolo Demafelix avatar

Watchers

James Cloos avatar  avatar

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.