I am running a daily schedule in Laravel 5.5 which selects matching Posts and runs a foreach loop that calls a static function in PostController, editing the Post model and saving it afterwards.

When the code is executed, everything works fine on the first loop with the first post, but on the second pass, I get the `function name must be a string` error on when the function attempts saving the model.

Here is the schedule in `kernel.php`

```
$schedule->call(function () {
    $posts = DB::table('post')
        ->where('finish_time', '<', Carbon::now()->toDateTimeString())
        ->where('status', '=', '1')
        ->where('expiry_processed_at', '=', null)
        ->get()->all();

    if(count($posts) > 0){
        foreach ($posts as $post){
            PostController::processExpiry($post->post_id);
        }
    }
})->everyMinute();

```

And here is the function it calls in PostController:

```
public static function processExpiry($post_id){
    $post = Study::find($post_id);
    $latestLicense = $post->licenses->last();

    $email = $post->user->email;
    $param = ['post' => $post];

    \Mail::send(['html' => 'emails.post_expiry', 'text' => 'emails.txt.post_expiry'], $param, function ($message) use ($email) {
        $message->to($email)
            ->subject(trans('email_subject.post_expiry'));
    });

    // Identify post as processed
    $post->expiry_processed_at = Carbon::now()->toDateTimeString();

    $validator = \Validator::make(
        $post->toArray(),
        $post->rules
    );
    Log::info(print_r($post,true));
    try {
        $post->saveOrFail(); // This is the line where error occurs on second pass
    } catch (\Exception $e) {
        // catch is never triggered
        $messages = $e->getMessage();
        return (Object) array('status' => false, 'error_message' => 'Error saving post to database');
    }
    // return because same function can be called manually by user
    return (Object) array('status' => true);
}

```

`Log::info()` of `$post` before `$post->saveOrFail();` outputs:

```
[2018-02-01 10:25:00] local.INFO: App\Models\Post Object
(
    [table:protected] => post
    [timestamps] => 
    [guarded:protected] => Array
        (
            [0] => edit_time
        )

    [incrementing] => 1
    [primaryKey] => post_id
    [dates:protected] => Array
        (
            [0] => deleted_at
        )

    [refundThreshold] => 10
    [rules] => Array
        (

            [user_id] => Array
                (
                    [0] => required
                    [1] => integer
                )

            [title] => Array
                (
                    [0] => required
                    [1] => max:255
                    [2] => App\Rules\NotUrl Object
                        (
                        )
                )
            [description] => Array
                (
                    [0] => required
                )

            [finish_time] => Array
                (
                    [0] => sometimes
                    [1] => max:32
                    [2] => min:10
                )

            [status] => Array
                (
                    [0] => integer
                )

            [create_time] => Array
                (
                    [0] => max:32
                )

            [create_ip] => Array
                (
                    [0] => ip
                )

            [edit_time] => Array
                (
                    [0] => max:32
                )

            [edit_ip] => Array
                (
                    [0] => ip
                )

        )

    [connection:protected] => mysql
    [keyType:protected] => int
    [with:protected] => Array
        (
        )

    [withCount:protected] => Array
        (
        )

    [perPage:protected] => 15
    [exists] => 1
    [wasRecentlyCreated] => 
    [attributes:protected] => Array
        (
            [post_id] => 7
            [user_id] => 167
            [description] => Lorem ipsum
            [finish_time] => 2016-07-01 00:00:00
            [expiry_processed_at] => 2018-02-01 10:25:00
            [status] => 1
            [create_time] => 2018-01-30 21:27:11
            [create_ip] => 
            [edit_time] => 2014-01-31 21:28:27
            [edit_ip] => 
            [deleted_at] => 
        )

    [original:protected] => Array
        (
            [post_id] => 7
            [user_id] => 167
            [description] => Lorem ipsum
            [finish_time] => 2016-07-01 00:00:00
            [expiry_processed_at] => 
            [status] => 1
            [create_time] => 2014-02-05 21:27:11
            [create_ip] => 
            [edit_time] => 2014-08-11 15:54:22
            [edit_ip] => 
            [deleted_at] => 
        )

    [changes:protected] => Array
        (
        )

    [casts:protected] => Array
        (
        )

    [dateFormat:protected] => 
    [appends:protected] => Array
        (
        )

    [dispatchesEvents:protected] => Array
        (
        )

    [observables:protected] => Array
        (
        )

    [relations:protected] => Array
        (
            [licenses] => Illuminate\Database\Eloquent\Collection Object
                (
                    [items:protected] => Array
                        (
                        )

                )

        )

    [touches:protected] => Array
        (
        )

    [hidden:protected] => Array
        (
        )

    [visible:protected] => Array
        (
        )

    [fillable:protected] => Array
        (
        )

    [forceDeleting:protected] => 
)

```

Thank you for your help!