Skip to content

Base library for repeated layout fields, content builders and other collection components

License

Notifications You must be signed in to change notification settings

whitecube/laravel-flexible-content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel-flexible-content

This package's only purpose is to build custom repeated layout components, such as Laravel Nova's Flexible Content field or your own content builders and manageable component collections. It is meant to provide a tested and multi-purpose backend API that should be extended by specific components (regardless of their frontend stack).

Docs (under construction)

  • Installation & base use cases
  • layouts registration
    • register($layout, $limit)
  • get all registered layouts
    • layouts()
    • layoutsMenu()
  • limiting layouts
    • limit($instances)
    • $layout->limit($instances)
  • building instances
    • build($data)
    • buildUsing($callback)
    • insert($key, $attributes, $index, $id)
  • serializing the flexible container's state
    • serialize()
    • serializeAs($format)
    • serializeUsingFormat($format)
    • serializeUsing($callback)
  • get all inserted instances, and manipulate the LayoutCollection :
    • instances()
    • instancesValues()
    • $instances->find($key)
    • $instances->whereKey($key)
    • $instances->whereKeyNot($key)
    • $instances->whereKeyIn($key)
    • $instances->whereKeyNotIn($key)
  • counting instances
    • count($key = null)

Testing

This library uses PestPHP. If you're considering contributing, please make sure all existing tests are still valid and that your changes are fully covered before submitting a PR.

Once installed, run the tests using ./vendor/bin/pest.

About

Base library for repeated layout fields, content builders and other collection components

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages