Ok, So I'm running to this problem i"m trying to split/ index the values in a column in my database. So i put the I've been trying to put it into a string, and all the combination I have tried should work, but everytime I try to split the value i keep getting this error Array to string conversion and the errors shows my database as appose to a string or even at the very least a column. Now sorry if my code at this point looks like more work than it should be haha. That was out of desperation and a attempt to get it to work.
this my controller:
public function FSC_List($id)
{
$fsg_find_id = fsgdata::find($id);
$fsc_list_all = fscdata::all();
$fsc_find_id = fscdata::find($id);
$num_match = fscdata::all()->toArray();
$fsc_num_col = fscdata::lists('fsc_number');
$newstring = implode("",$fsc_num_col);
$final = $newstring.str_split(0,2);
return View('FSC_views.FSC_List', compact('fsg_find_id','fsc_list_all',
'fsc_find_id', 'num_match', 'fsc_num_col', 'newstring','final'));
}
This is my view:
@extends('layout.master')
@section('content')
<div class="figure"><img src="/Content/images/figure2.jpg" /></div>
<div class="main">
<h2>Search Results for FSG Number: {{ $fsg_find_id->fsg_number }}</h2>
<ul>
@foreach($fsc_num_col as $fsc_find_id->fsg_number)
@if($fsg_find_id->fsg_number == $final);
<a href='/NSN_list={{ $fsc_find_id->id }}'>{{$fsc_find_id->fsc_number}}</a></br>
@endif
@endforeach
</ul>
</div>
@endsection
Note my goal is to have 2 numbers chosen by the users to match up with the first 2 digits of a bunch of 4 digit numbers in a database and to grab all of those that meet that criteria. Thanks in advance to anyone who can help.