Support the ongoing development of Laravel.io →
Requests Input
Last updated 2 years ago.
0

UP UP UP UP!!!!

0

whats this line:

ErrorException in helpers.php line 671: (post all of that function).

I am assuming that the parameters to the function Form::text may need swapping..

What i would do if i were you is, get rid (or comment) all the form::text except for one..

0

Hi sir.

this is what on my helpers.php line 671;


668    function str_replace_array($search, array $replace, $subject)
669    {
670        foreach ($replace as $value) {
671            $subject = preg_replace('/'.$search.'/', $value, $subject, 1);
672        }
673
674        return $subject;
675    }
676 }

I think It has something to do with the controller ?

here is my controller store method


 public function store(AssetRequest $request)
    {
       $product = Auth::user()->products()->create($request->all());

        $imageName = $product->id . '.' . 
        $request->file('image')->getClientOriginalExtension();

        $request->file('image')->move(
        base_path() . '/public/images/product/', $imageName
        );
        
        
         $product->domains()->attach($request->input('domain_list'));
         $product->manufactures()->attach($request->input('manufacture_list'));
         $product->packs()->attach($request->input('pack_list'));
         $product->status()->attach($request->input('statu_list'));
         $product->systems()->attach($request->input('system_list'));
         $product->technicians()->attach($request->input('technician_list'));
         $product->types()->attach($request->input('type_list'));
         $product->versions()->attach($request->input('version_list'));
         $product->serials()->attach($request->input('serial_list'));
         $product->flashdrives()->attach($request->input('flashdrive_list'));
         $product->parallels()->attach($request->input('parallel_list'));
         $product->ethernets()->attach($request->input('ethernet_list'));
         $product->wifis()->attach($request->input('wifi_list'));
         $product->officers()->attach($request->input('officer_list'));
         $product->terms()->attach($request->input('term_list'));
         $product->postatus()->attach($request->input('postatu_list'));
         $product->departments()->attach($request->input('department_list'));
         $product->clasifications()->attach($request->input('clasification_list'));
         $product->phones()->attach($request->input('phone_list'));
         $product->receives()->attach($request->input('receive_list'));
         $product->disposals()->attach($request->input('disposal_list'));
         
        
      
        return redirect('assets');
    }

what function should I put to make this work ,,

Thank you again

0

up up up

0

I had this issue but managed to resolve it by using json_encode. It appears that the issue is caused when trying to save a field that is an array value.

$fieldData = ['hello' => 'world'];
$fieldData = json_encode($fieldData);

Hope it helps!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

spike03 spike03 Joined 22 Jul 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.