title: How to get last insert id in laravel and view it in input text?
body: <pre><code>&lt;?php
  
  
  namespace Modules\ProductionComponents\Services;
  
  
  use Modules\ProductionComponents\Repositories\ThreadInfoRepositoryEloquent;
  class StoreThreadService
  {
      public $thread_info;
      public function __construct(ThreadInfoRepositoryEloquent $thread_info)
      {
          $this-&gt;thread_info = $thread_info;
      }
      public function store_thread($data)
      {  
         $this-&gt;thread_info-&gt;create([       
          'thread_code'=&gt;$data['thread_code'],
          'thread_name'=&gt;$data['thread_name'],
          'created_by'=&gt;auth()-&gt;user()-&gt;id,
          'created_at'=&gt;now()
         
      ]);
  </code></pre>