2个桌子之间的Laravel 4连接

I have 2 tables:

  1. Items table which has id, name, color_id. color_id references id on items table
  2. Colors table which has color and id. (e.g. purple with id=1)

When i want to add a new item and user uses purple color on item i want that color to be saved as color_id = 1 on items table. Is there any way to do that?

Yes, sure you can do that. At first you can query to Colors database so that you can get the id of color. Then you can insert that id to Items table. This is a general way. But as you are using Laravel 4, you can do this smartly by using Eloquent. Check out this point of laravel doc: http://laravel.com/docs/4.2/eloquent#relationships