Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9224987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:27:58+00:00 2026-06-18T04:27:58+00:00

WARNING:: LARAVEL SUPER-BEGINNER, BE GENTLE:: In my controller: public function get_index(){ $lease_rates = DB::table(‘lease_rates’);

  • 0

WARNING:: LARAVEL SUPER-BEGINNER, BE GENTLE::

In my controller:

public function get_index(){
$lease_rates = DB::table('lease_rates');
$this->layout->nest('content','admin.lease_rates', array('lease_rates' => $lease_rates, ));

In my lease_rates table:

   id   lease_year   class_letter   rate
    1      2012           A          635
    2      2012           B          648
   ...     ....          ...         ...
    5      2012           E          789
    6      2011           A          629

In my lease_rates.blade.php:

<input type="text" 
       name="{{ $lease_rates->rate->find(1) }}" 
       value="{{ $lease_rates->rate->find(1) }}">

<input type="text" 
       name="{{ $lease_rates->rate->find(2) }}" 
       value="{{ $lease_rates->rate->find(2) }}">

Obviously the above doesn’t work. The end result that I want:

  • Sort the array sent to the page by lease_year, descending then by class_letter ascending.
  • Put the values of the rate for each id into text boxes where the textbox name is the id and the text displayed is the rate for said id.
  • After that works, I’ll need to submit any changes made to the table
  • After that, I’ll work on adding records

Thanks so much! Like I said, I’m new, but eager to learn (and even more eager to get this thing done)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:27:59+00:00Added an answer on June 18, 2026 at 4:27 am

    Did you look at the docs for the Fluent Query Builder (or Eloquent ORM)? http://laravel.com/docs/database/fluent

    You could do something like this (not checked, but you should get the idea):

    //In your controller
    $lease_rates = DB::table('lease_rates')->order_by('lease_year', 'desc')->order_by('class_letter', 'desc')->get();
    
    //In your view
    @foreach($lease_rates as $lease_rate)
        <input type="text" name="{{ $lease_rate->id) }}" value="{{ $lease_rate->rate }}">
    @endforeach
    
    
    //Save controller
    foreach(Input::all() as $id => $rate){
        DB::table('lease_rates')->where('id', '=', $id)
        ->update(array('rate' => rate));
    }
    

    You could also use the Eloquent ORM, to make it even easier.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm in the middle of some work and suddenly I get this. Warning: require(/opt/lampp/htdocs/ERP/laravel/÷5
Warning: mkdir() [function.mkdir]: No such file or directory in I keep getting this annoying
Warning: substr_count() [function.substr-count]: Empty substring. I get this message when calling the function browsertest.
WARNING: THIS CODE SUCKS, SEE ANTHONY'S COMMENTS Which is faster? 1. public bool IsValueType<T>(T
Warning: copy(/home/beradioc/public_html/phpfreechat-1.3/src/../data/public/themes/default/sound.swf) [function.copy]: failed to open stream: Permission denied in /home/beradioc/public_html/phpfreechat-1.3/src/pfctools.php on line 179
Warning: Note that this is a dumb question of something that I would probably
Warning: touch() [function.touch]: open_basedir restriction in effect. File() is not within the allowed path(s):
Warning: preg_replace_callback() [function.preg-replace-callback]: Requires argument 2, 'info', to be a valid callback in [...]
Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl}INBOX in /home/happy/public_html/source/imap/fet_mail_from_email_add.php on line 7 can't connect:
Warning: This is inherited legacy code that was initially put together in the early

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.