mercredi 7 décembre 2016

The Response content must be a string or object implementing __toString(), "boolean" given in laravel 5

I have reading a txt file contains barangays.

barangay.txt

Burol

Burol I

Burol II

Burol III

Datu Esmael

Emmanuel Bergado I

Emmanuel Bergado II

Fatima I

Fatima II

Fatima III

H-2

Langkaan I

my function is:

public function getBarangay() {
    $barangay = fopen('nav/barangay.txt', 'r');
    $list = array();
    if ($barangay) {
        while (($line = fgets($barangay)) !== false) {
            $list[] = $line;
        }
        fclose($barangay);
    }
    return $list;
}

when I go to localhost:8000/barangay-list. There is an error shows.

UnexpectedValueException in Response.php line 399: The Response content must be a string or object implementing __toString(), "boolean" given.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire