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

specify table key different from id #100

Open
kirchaj opened this issue Sep 4, 2015 · 2 comments
Open

specify table key different from id #100

kirchaj opened this issue Sep 4, 2015 · 2 comments

Comments

@kirchaj
Copy link

kirchaj commented Sep 4, 2015

Is there a way to generate the scaffold on a table that does not have ID as the key? It seems that it assumes that it must be there and does not recognize the real key.

@mitulgolakiya
Copy link
Owner

@kirchaj you can use Generator From Existing Tables to generate views which will create CRUD, but then you need to do changes based on your primary keys in your repository and controller.

@edermartins
Copy link

@kirchaj I have made a simple adjustment when you use "--fromTable" option, the generator will get the first field the table and use it like primary key, putting the (public $primaryKey = "first_field_id";) on the Eloquent Model. Also will use the primary key in the Views (before this change was hard coded with "id").

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

3 participants