How can i get elements in select using by example, whereDoesntHave in Laravel 8 and Filament? - pivot-table

I've three tables Users, company and user_company (pivot). I need to, for example, associate users to a company in a form using select that show me only the user are nit associated to this company.
Could anybody help me?
Thanks in advance

check the Filaments Documentation on the relationshipmanager AND
#Attaching and detaching records either manually or by --attach when creating the relationship manager
Ensure withPivot is included in the EloquentModel and check the getRelations in the modelresource

See docs #Populating automatically from a relationship
This works for me:
Forms\Components\Select::make('companyId')
->multiple()
->relationship('companies','company_name'),

Related

How to use relations in Kibi, when creating a visualisation?

BACKGROUND
After moving our MSSQL DB to an ELK stack version 5.2, we realised we needed a relatiopnal visauliser. By then downgrading to 2.4.1 we were able to link Kibi.
TRIED
I have created the relations between the tables as shown below;
However, when trying to build a simple line graph to compare the tables tblaccounts and aspnetusers , it simply uses the values in tblaccountusers. None of the Kibi documentation seems to help, from what I have seen.
THE PROBLEM
The problem with this is I need the actual values to be used from both tables, through the child table of tblaccountusers, as to display account names rather than the ID number such as 1,2... etc.
If anyone has any guidance or links to help with this, please comment below.

using single database file for multiple users

I want to make a site in which every user has his own customers and products to manage.
Whats the best way to handle this??
Is it OK to use an additional field for each entry specifying the user this entry belongs to ? or there is a better way?
Im using sql server if it matters.
Thank You.
not really much info in the question... however:
it is much simpler to scale some more data in a single database than to create additional databases. so YES - make one database.
the exact schema you choose is more subtle - normalize, and link rows to appropriate users
Do NOT I repeat do NOT create a database per user, not even a table per user.
Add a column UserID to any table that may need to reference a person with a product or order.

Joomla! - Database tables related with users

I wanna make my own registration form as i need to include extra fields for the users. And it seems that there isn't any FREE extensions that is able to do it. So i have to find out how to insert the users into the database.
I have found out that there are 3 tables related with each other when creating a new user:
1. jos_users
2. jos_core_acl_aro
3. jos_core_acl_groups_aro_map
But i am running Joomla! 2.5.1 for my website and my database does not have jos_core_acl_aro and jos_core_acl_groups_aro_map tables!!
May i know what are the tables to take note of when i'm doing my own registration form?
Thanks in advance!
What you want is actually two things:
Your own registration form
add fields to jos_users
If you're looking for a plugin for the registration form:
http://extensions.joomla.org/extensions/clients-a-communities/user-management/13753
Steps to add fields for jos_users you can find here:
http://forum.joomla.org/viewtopic.php?p=2654947
You have to add an entry to #__user_usergroup_map, the 2nd field "group_id" must exist at #__usergroups.

how to create California in the DNN list in NB_Store country list

hi
I want to know "how to create California in the DNN list in NB_Store country list?" This is for implementing tax to California state Only. In order to do this i have created txapplies.list and put CA. But i can't get the result.
Thanks in advance.
I haven't tried it myself, because my test DNN deployment is busy, but I think adding a relevant entry to the List table will do the trick.
Here is SQL that retrieves countries from the Lists table:
select listname,value,text,parentid from lists where listname = 'Country'
Queue that up in SSMS, and try adding a country manually
Keep in mind, DNN utilizes heavy caching by default -- you may need to disable caching in your host settings for this test.

Matching DB records to Active Directory entries?

I have been tasked with coming up with a solution where I am not sure if there is a solid answer:
How can I match username records from an application's database to users in our Active Directory?
I have two applications this needs to be done for - 1st application I only have firstname and lastname information. Second application i have the application's username, which is similar to activeD's but not a definate match. I also have firstname lastname info.
Now, simply put I can just write a script that matches all the records in ActiveD that match the firstname lastname in the application DB, but that is fraught with errors.
Having no unique identifier to begin with might make this an impossible task, but before I start to task someone else with manually comparing the data after running the script, I thought I would ask the delightful StackOverflow crew to chew on it. There are always methods I don't think of, after all.
So any brilliant ideas out there to accomplish this task?
Thanks guys
Once you get them matched up automatically and the exceptions by hand, make a custom attribute in Active directory where you can store the information to keep them matched up in the future.
You could store the Active Directory object GUID against the database record.
Well, the one thing that will be indeed unique in AD is the sAMAccountName for each user. If you find a way to associate your users in your two databases with a SAM Account Name, you should have no big trouble anymore to do an automatic sync check with AD.
That property is already available in AD, you don't need to add any additional artificial IDs, and it's much easier to read than a GUID.
Marc

Resources