Object class couldn’t be converted to string Laravel 5

When I return the request of my controller, I get: {“employees”:”3″,”reason”:”common reason”,”request”:”5000″,”ded_per_pay”:”500″,”months_to_pay”:”2″,”date_issued”:”2018-01-31″} And in my create function, I get this error: Object of class Symfony\Component\HttpFoundation\ParameterBag could not be converted to string Here’s my code: CashAdvance::create([ ’emp_id’ => $request->employees, ‘reason’ => $request->reason, ‘request’ => $request->request, ‘ded_per_pay’ => $request->ded_per_pay, ‘date_issued’ => $request->date_issued, ‘months_to_pay’ => $request->months_to_pay ]); What…

Laravel post::all(), how to just get pure data from post table

In Postscontroller, function index(), I have $data=Post::all(), but the data show me so many redundant ones, how can I just get pure data rows from Table post? use Illuminate\Http\Request; use App\Post; class PostsController extends Controller { public function index() { // $data=Post::all(); return view(‘posts.index’,compact(‘data’)); } … And in the database post table. I have one…