zoha / laravel-meta Goto Github PK
View Code? Open in Web Editor NEWa package for working with models meta in laravel
License: MIT License
a package for working with models meta in laravel
License: MIT License
Automatically loading the migrations can make it difficult for the end-user to customise them. Consider publishing them instead to allow the developer to make any desired alterations.
laravel-meta/src/Meta/MetaServiceProvider.php
Lines 51 to 54 in 2de15ac
Feature request
Hi! Thank you for this awesome package, it's really useful.
It'd be great if you could add support for the float data type.
Thank you
Trying to upgrade to Laravel 9 and getting blocked due to composer requirements being wrong. Just needed to do a new release using the current master.
Hiya
Well done for creating a great package.
I was wondering if there is a way to be able to store permissions against a meta key?
What I need to be able to do is store which users/teams (using Jetstream) can read, edit, delete the metatag.
Then some way link that to Laravels search so that only those users/teams with read permission see results in the search.
Thanks for any help you can provide.
Do you plan on making a paid version with extra features?
Cheers
Nathan
Hi there, firstly, thanks for this great package, I love it, it's working great so far.
However, I have some issues when using it in a pivot table.
I use meta in a pivot table where I store some user data related to the organization he belongs to.
I'm unable to query a user based on a meta stored in this pivot table.
Example:
I want to get all users that has a specific meta (e.g. account_id
) inside the pivot table. Any ideas on how I can achieve this?
I prefer this package to the others and tried to use it on Laravel v.10.x but the installation failed due to:
Problem 1
- zoha/laravel-meta[v1.1, ..., v1.5] require illuminate/support ^5.6 -> found illuminate/support[v5.6.0, ..., v5.8.36] but these were not loaded, likely because it conflicts with another require.
- zoha/laravel-meta v1.6 requires illuminate/support ^5.8 -> found illuminate/support[v5.8.0, ..., v5.8.36] but these were not loaded, likely because it conflicts with another require.
- zoha/laravel-meta 1.6.1 requires illuminate/support ^5.8|^6.0 -> found illuminate/support[v5.8.0, ..., v5.8.36, v6.0.0, ..., v6.20.44] but these were not loaded, likely because it conflicts with another require.
- zoha/laravel-meta 1.7 requires illuminate/support ^5.8|^6.0|^7.0 -> found illuminate/support[v5.8.0, ..., v5.8.36, v6.0.0,
..., v6.20.44, v7.0.0, ..., v7.30.6] but these were not loaded, likely because it conflicts with another require.
- zoha/laravel-meta[1.8, ..., v1.9] require illuminate/support ^5.8|^6.0|^7.0|^8.0 -> found illuminate/support[v5.8.0, ..., v5.8.36, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.
- zoha/laravel-meta v2.0.0 requires laravel/framework ^8.0|^9.0 -> found laravel/framework[v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.4] but it conflicts with your root composer.json require (^10.0).
- Root composer.json requires zoha/laravel-meta * -> satisfiable by zoha/laravel-meta[v1.1, ..., v1.9, v2.0.0].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific
versions.
Thanks.
When I installed on a production environment, it installed version 1.1. Seemed to work locally but the files in my vendor folder on the server were very outdated.
Hi, I want to use this package with jenssegers/laravel-mongodb. Have any way to use it?
First off thank you so much for this wonderful package. Its a life saver coming from the wordpress world. Im wondering what would be the proper way to handle soft deletes ?
Like Post Model has default meta table,
but User Model may need another meta table, like user_metas.
Hi, firstly to say thank you for this package, it is great.
I have been working on adding an approval workflow to an application that uses this package and I can listen to creating/updating events correctly and can intercept/block the create/update of metadata if conditions are not met, however it appears the package utilises temporary cached data against the model that updates with newly passed data even though the database record is not updated.
For example, if I create an observer and listen for the ::updating event on the Zoha\Meta\Models\Meta model and get it to return false, if I already have a meta value for key "updated_time" as (for example) "1641464807" then call something like the below:
$user = \Auth::user();
$user->setMeta('updated_time',time());
ddd($user->getMeta('updated_time'));
it will dump the latest time even though the meta database record does now get updated.
It appears that in SetMetaHelper.php you save the meta (in both executeUpdateMeta()
and executeCreateMeta()
) but do not check to see whether the data was actually saved or not before setting the value of the temporary loaded meta items.
Would it be possible to tweak the code to check to see if the save was completed successfully or not and update the temporary meta items cache accordingly? It may also be useful to then return false from UpdateMetaHelper::updateMeta
and CreateMetaHelper::createMeta
if the executions do not get saved due to events blocking them?
Please do a release.
protected $metaTable = ['posts_field','posts_detail_field'];
For example, is it possible to use 2 tables as post_field and post_detail in the Post model?
getMeta()
doesn't work on soft deleted models.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.