title: Insert data in laravel IDENTITY_INSERT is set to OFF
body: <p>So i got the problem when i insert the data on database sqlserver. the id sqlserver refuse to insert because the database want to insert id it self.</p>
  
  <p>i have to try to set IDENTITY_INSERT ON like this :</p>
  
  <p><code>DB::statement('SET IDENTITY_INSERT articles ON;');</code></p>
  
  <p>and set IDENTITY_INSERT to OFF like this :</p>
  
  <p><code>DB::statement('SET IDENTITY_INSERT articles OFF;');</code></p>
  
  <p>but it isn't work for my code.</p>
  
  <pre><code>   public function store(Request $request){
          //to sparate to methode
          $article = $request-&gt;isMethod('put') ? Article::findOrFail($request-&gt;article_id) : new Article;
  
          $article-&gt;id = $request-&gt;input('article_id');
          $article-&gt;title = $request-&gt;input('title');
          $article-&gt;body = $request-&gt;input('body');
  
          DB::statement('SET IDENTITY_INSERT articles ON;');
          if($article-&gt;save()){
              return new ArticleResources($article);
          }
          DB::statement('SET IDENTITY_INSERT articles OFF;');
  
      }
  </code></pre>
  
  <p>this error look like this: </p>
  
  <blockquote>
    <p>SQLSTATE[23000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cannot insert explicit value for identity column in table 'articles' when IDENTITY_INSERT is set to OFF.</p>
  </blockquote>