title: Remove ip from json response in Laravel
body: <p>I have rest api in Laravel like below:</p>
  
  <pre><code>{
      "id": 17,
      "title": "Devnet",
      "slug": "devnet",
      "content": "sfdf",
      "technology_id": 1,
      "image": "http://127.0.0.1:8000/uploads/posts/1570907475IMG_20171229_123822.jpg|uploads/posts/1570907475IMG_20171229_133927.jpg|uploads/posts/1570907475IMG_20180319_124721.jpg",
      "link": "https://www.somelink.com/in/test/",
      "deleted_at": null,
  }
  </code></pre>
  
  <p>I need to remove local ip (<code>127.0.0.1:8000</code>) address from all responses.For example in image I have 3 files but in code which I present you can see 3 links and only one of them have full path.</p>
  
  <p>Actually in DB they don't have full path.All of them posted to DB without local ip like this <code>uploads/posts/image_name.jpg</code>.In model creation I check with <strong>dd</strong> all my images without local ip (<code>127.0.0.1:8000</code>).Only <code>uploads/posts/image_name.jpg</code>.</p>
  
  <p>How I store data to db in controller:</p>
  
  <pre><code>    $images = array();
      if ($files = $request-&gt;file('image')) {
          foreach ($files as $file) {
              $name =  "uploads/posts/" . time() . $file-&gt;getClientOriginalName();
              $file-&gt;move("uploads/posts", $name);
              $images[] = $name;
          }
      }
  
      // validating in here ..
      if I dd($images) in here it show me 3 array of images without local ip.
  
      $project= Project::create([
          "title" =&gt; $request-&gt;title,
          "content" =&gt; $request-&gt;content,
          'image' =&gt;  implode("|", $images),
          "technology_id" =&gt; $request-&gt;technology_id,
          "slug" =&gt; str_slug($request-&gt;title),
          "tags" =&gt; "required",
          "link" =&gt; $request-&gt;link
      ]);
  </code></pre>
  
  <p>Also my main <code>Controller</code> which returns <code>json</code> to view nothing special.</p>
  
  <pre><code>public function index(){
      $result = Project::with('something','something')-&gt;get();
      return response()-&gt;json($result);
  }
  </code></pre>
  
  <p>Project model</p>
  
  <pre><code>class Project extends Model
  {
      use SoftDeletes;
  
      protected $fillable = [
          "title","content","image","technology_id","link","slug"
      ];
  
      public function getImageAttribute($image){
          return asset($image);
      }
      protected $dates = ["deleted_at"];
  }
  </code></pre>