JasonTurpin's avatar

config() Values Not Accessible In Controller After Validate() is run

Hey Guys,

I ran into an issue in lumen where config values are not accessible after I pass validation. Why is this?

    protected $validationRules = [
        'startTime' => 'required|date',
        'endTime'   => 'required|date|after:startTime',
    ];

    public function do_fetch(Request $request) {
        // I have my correct value here
        echo config('app.cacheLife');

    // Run validate()
        $this->validate($request, $this->validationRules);

        // I am now null :(
        dd(config('app.cacheLife'));
    }

Also Cache is not working either after validate() is run. If I try to run Cache::has('key') or Cache::forget('key') for a known key before validate() it works correctly. But if I run it right after validate() it no longer will identify the key.

Any ideas?

Thanks,

TheNatureBoy

0 likes
1 reply

Please or to participate in this conversation.