Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

the best way to insert a row to user model #163

Closed
sithuaung opened this issue Nov 12, 2014 · 3 comments
Closed

the best way to insert a row to user model #163

sithuaung opened this issue Nov 12, 2014 · 3 comments

Comments

@sithuaung
Copy link

Hi Mr Juliuss

In my case, I have to add department_id to user table. So for creating a new user, I can't insert because foreign key is in the user table.What is the best way to edit create-user-view and create-user-controller without editing your code from vendor.

Regards.
Sithu

@sithuaung sithuaung changed the title the best way to insert to user model the best way to insert a row to user model Nov 12, 2014
@MrJuliuss
Copy link
Owner

Hi,

You can easily overrides views like this : http://mrjuliuss.github.io/syntara/docs/custom.html#custom-view
but it's not easy to override controllers (does'nt work very well, but you can try this laravel/framework#17)

My advice :

  • Create a new controller (which extends the Syntara BaseController or Syntara UserController).
  • Override the views which use this basic route you have overrided (change the URI in )

@sithuaung
Copy link
Author

Thanks Mr.Juliuss
I'll try.

@sithuaung
Copy link
Author

I can easily override the controller and routes. It works. thanks.

But first when I copied the code from your controller to avoid implementing the same functionality for checking groups and selecting permissions, I faced with weird error like "user already exist".I am so sure it didn't exist. May be that error because of Ajax or I don't know. So I write my own controller and it worked.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants