title: How to implement region-specific app in Laravel Controllers
body: <p>I am using Laravel 6.</p>
  
  <p>I am building an app that has Files (not a file stored on your desktop or storage). I have a File model, FileController controller and Files in the <code>DB</code> with <code>id, user_id</code> (as it belongs to a user) and data (which is a JSON column).</p>
  
  <p>For my app, a File can have different fields, based on jurisdiction, that need to be captured (via forms on the blade templates) and managed via the controller (primarily via show, edit, update).</p>
  
  <p>It is likely that I have many jurisdictions (imagine country, state and maybe city) versions of Files, with their respective fields that need to be captured, displayed, modified, etc.</p>
  
  <p>In many of these Files, especially if its in the same country, there are fields (columns/keys) that are repeated. </p>
  
  <p>Currently, I have one Controller, and when it comes to editing a File, showing a File or updating a File, I am starting to have logic that detects the country or state and modifying the logic or view.</p>
  
  <p>Initially I thought I would do something like this</p>
  
  <pre><code>File - model
  FileController - root controller
  - @edit calls FileControllers/country/state/FileController@edit.php
  - @show calls FileControllers/country/state/FileController@show.php
  - @update will reference FileControllers/country/state/FileController@update
  Files.view.blade - root view for Show
  Files.edit.blade - root view for Edit
  </code></pre>
  
  <p>but I have a feeling this is going to get out of hand really quickly, especially if certain File records have similar fields, views, data types that I will capture. There aren't any that are consist across the various different jurisdictions, which is why I opted for a JSON store in the mysql database.</p>
  
  <p>What are some ways to dynamically manage this sort of setup with relative ease of maintainability, in the long run? I am a beginner-ish to novice-ish developer.</p>