{"repo":"spatie/laravel-schemaless-attributes","free":true,"listed":false,"github":"https://github.com/spatie/laravel-schemaless-attributes","clone":"git clone https://github.com/spatie/laravel-schemaless-attributes.git","description":"Add schemaless attributes to Eloquent models","language":"PHP","stars":1085,"topics":["laravel","php","json","nosql","eloquent"],"license":"MIT","category":"databases-storage","readme_excerpt":"Add schemaless attributes to Eloquent models Wouldn't it be cool if you could have a bit of the spirit of NoSQL available in Eloquent? This package does just that. It provides a trait that when applied on a model, allows you to store arbitrary values in a single JSON column. Here are a few examples. We're using the extra attributes column here, but you can name it whatever you want. Support us We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products. We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall. Requirements This package requires a database with support for json columns like MySQL 5.7 or higher. Installation For Laravel versions 6 & 7 or PHP 7, use version 1.x of this package. You can install the package via composer: The schemaless attributes will be stored in a json column on the table of your model. Let's add that column and prepare the model. Adding the column where the schemaless attributes will be stored Add a migration for all models where you want to add schemaless attributes to. You should use schemalessAttributes method on Blueprint to add a column. The argument you give to schemalessAttributes is the column name that will be added. You can use any name you'd like. You're also free to add as many schemaless attribu","default_branch":null,"files":null,"tree":[],"storefront":"/r/spatie","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spatie/laravel-schemaless-attributes/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}