GithubHelp home page GithubHelp logo

Comments (2)

msonowal avatar msonowal commented on May 25, 2024

@gmask Can you Log the $value and output here

from laravel-scout-mysql-driver.

benjivm avatar benjivm commented on May 25, 2024

What I don't get is why that mutator is even a concern of the indexer, since a mutator is only used on update of a new record?

Here is a tinker instance of the first record:

>>> $report = App\Models\Report::first();

=> App\Models\Report {#982 
    id: 1,
    author_id: 3, 
    customer_id: "555", 
    job_number: 123456, 
    contact_name: "Foo Bar", 
    contact_phone: "555-123-4567",
    start_date: "2017-11-06", 
    end_date: "2017-11-10", 
    active: 1,
    created_at: "2017-11-07 06:36:06",
    updated_at: "2017-12-12 10:08:21",
} 

>>> var_dump($report->created_at); 

object(Illuminate\Support\Carbon)#975 (3) {
    ["date"]=> 
    string(26) "2017-11-07 06:36:06.000000"
    ["timezone_type"]=>
    int(3) 
    ["timezone"]=> 
    string(19) "America/Los_Angeles" 
}

And here's how these records are created, $value is start_date and end_date before being converted to a Carbon timestamp.

>>> $report = new App\Models\Report;                             
=> App\Models\Report {#981}                                      
>>> $report->start_date = "12/13/2017";                          
=> "12/13/2017"                                                  
>>> $report->start_date;                                         
=> Illuminate\Support\Carbon @1513184688 {#975                   
     date: 2017-12-13 09:04:48.0 America/Los_Angeles (-08:00),   
   }                                                             
>>>                                                              

from laravel-scout-mysql-driver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.