3

Recently I added my hostname to use a local configuration on Laravel 4.2, then I added a copy of my database.php file and put into app/config/local/database.php. But when I try to do a migration o a composer update an error comes up:

PHP Parse error:  syntax error, unexpected 'return' (T_RETURN) in /app/config/local/database.php on line 3

In line 3 of this file there is indeed a return:

<?php

 return array( 
 ...

So I tried to put back the file in the app/config folder and got the same error.

Finally, I used the database.php file of one of my coworkers and still the same error.

5
  • can you post your database.php file ?? Commented Mar 3, 2016 at 6:54
  • It is exactly like the default database.php file, here's a link to this file on the Laravel GitHub project. Commented Mar 3, 2016 at 9:27
  • you must be missing something in that file. There should be some syntax error mate. Commented Mar 3, 2016 at 9:53
  • But I used a coworker file that he is actually using and it works perfectly for him but not for me! D: Commented Mar 3, 2016 at 11:05
  • try in app start global.php dd(\Config::get('database')); and check it give some error Commented Mar 3, 2016 at 14:03

1 Answer 1

2

I resolved this problem by copying and pasting the database.php from other project (copy and paste the file, not the content of this)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.