src/Controllers/ConfigurationsController.php
public function update(Request $request, $id)
    {
        $configuration = Configuration::findOrFail($id);

        $value = $request->value;

        if ($request->serialize) {
            //if(!Hash::check($request->password, Auth::user()->password)){
            if (!Auth::attempt($request->only('password'), false, false)) {
                return back()->withErrors([trans('ticketit::admin.config-edit-auth-failed')]);
            }
            if (false === eval('$value = serialize('.$value.');')) {
                return back()->withErrors([trans('ticketit::admin.config-edit-eval-error')]);
            }
        }

        $configuration->update(['value' => $value, 'lang' => $request->lang]);

        Session::flash('configuration', trans('ticketit::lang.configuration-name-has-been-modified', ['name' => $request->name]));
        // refresh cached settings
        \Cache::forget('ticketit::settings');
        \Cache::forget('ticketit::settings.'.$configuration->slug);
        //return redirect(route('ticketit::admin.configuration.index'));
        return redirect()->action('\Kordy\Ticketit\Controllers\ConfigurationsController@index');
    }
public function update(Request $request, $id)
    {
        $configuration = Configuration::findOrFail($id);

        $value = $request->value;

        if ($request->serialize) {
            //if(!Hash::check($request->password, Auth::user()->password)){
            if (!Auth::attempt($request->only('password'), false, false)) {
                return back()->withErrors([trans('ticketit::admin.config-edit-auth-failed')]);
            }
            if (false === eval('$value = serialize('.$value.');')) {
                return back()->withErrors([trans('ticketit::admin.config-edit-eval-error')]);
            }
        }

        $configuration->update(['value' => $value, 'lang' => $request->lang]);

        Session::flash('configuration', trans('ticketit::lang.configuration-name-has-been-modified', ['name' => $request->name]));
        // refresh cached settings
        \Cache::forget('ticketit::settings');
        \Cache::forget('ticketit::settings.'.$configuration->slug);
        //return redirect(route('ticketit::admin.configuration.index'));
        return redirect()->action('\Kordy\Ticketit\Controllers\ConfigurationsController@index');
    }
public function update ( Request $ request , $ id ) { $ configuration = Configuration :: findOrFail ( $ id ) ; $ value = $ request -> value ; if ( $ request -> serialize ) { //if(!Hash::check($request->password, Auth::user()->password)){ if ( ! Auth :: attempt ( $ request -> only ( 'password' ) , false , false ) ) { return back ( ) -> withErrors ( [ trans ( 'ticketit::admin.config-edit-auth-failed' ) ] ) ; } if ( false === eval ( '$value = serialize(' . $ value . ');' ) ) { return back ( ) -> withErrors ( [ trans ( 'ticketit::admin.config-edit-eval-error' ) ] ) ; } } $ configuration -> update ( [ 'value' => $ value , 'lang' => $ request -> lang ] ) ; Session :: flash ( 'configuration' , trans ( 'ticketit::lang.configuration-name-has-been-modified' , [ 'name' => $ request -> name ] ) ) ; // refresh cached settings \ Cache :: forget ( 'ticketit::settings' ) ; \ Cache :: forget ( 'ticketit::settings.' . $ configuration -> slug ) ; //return redirect(route('ticketit::admin.configuration.index')); return redirect ( ) -> action ( '\Kordy\Ticketit\Controllers\ConfigurationsController@index' ) ; }
Update the specified Configuration in storage.

@param int     $id
@param Request $request

@return $this|\Illuminate\Http\RedirectResponse
Update the specified Configuration in storage .