mardi 4 octobre 2016

Laravel blade checkbox creating curly braces

I'm using a super simple checkbox form in Laravel 5.3

@extends('layout')

@section('content')
    <h1>Hello</h1>
                @foreach($sorts as $sort)
                    <div class="checkbox">
                        <label>
                             
                        </label>
                    </div>
                @endforeach
@stop

It's printing the checkbox with this: {} Africa - North Africa

What's up with those curly braces?

I'm trying to grab data from the database, and for each line print the $Region. Which is working. But the available documentation and explanations for checkboxes in Laravel make no mention of this. What am I missing?

This is the controller btw:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use DB;
use App\Http\Requests;

class SortController extends Controller
{
    public function index(){
        $sorts = DB::table('list_countries')->get();
        return view('Sort', compact('sorts'));
    }
}

And this is the Route:

Route::get('Sort', 'SortController@index');



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire