Saturday, August 17, 2013

SQLSTATE[42S02]: Base table or view not found: 1146 Table - Laravel Eloquent

If you got this error and you know for sure  that you are having the table name in your  database, Then the problem is the prefix of the table, why is that ?
I have my model declared like this :

class tableName extends Eloquent{} 

Now eloquent will take in account that table name in the database is table_names , As you see, it will add underscore before the capital letter and "s" for plural .this will happen by default unless you explicitly declare the name of the table inside the model class like this:

class tableName extends Eloquent{

protected $table = 'tableName'; 


}

Or Avoid the Capital letter in the name of the model.

Saturday, August 10, 2013

[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

This error happened if you are updating from MySQL 5.5 to MySQL 5.6 or when are using data folder that was on 5.5 server on 5.6 server . 
Anyway the solution is very easy and it is just a Warning but it is great to clear such things when you found it on your event log file.
 Add this line to MySQL configuration file , my.cnf or my.ini :

 explicit_defaults_for_timestamp = TRUE 

 restart your MySQL server and check your events log file.

Friday, August 9, 2013

NetworkError: 403 Forbidden Wamp Apache css js files

"NetworkError: 403 Forbidden   Wamp Apache css js files
SyntaxError: syntax error  <!DOCTYPE html>

Sometimes the Apache server cannot load static files other than html pages like images files, script and style files . when you have this error, that means some of the server configuration rules block the loading of these file and almost it will be in the Directory directive in http.conf file. So check the apache configuration file for Directory directive - Options Method - it may be duplicated in the main configuration file and the virtual host configuration file if you have virtual hosts, or it is not set .

if you get an error "forbidden" on directory with no index file then turn on the autoindex apache module or provide an index file if you don't want to list the files in that directory.
Other cause of this problem is that ,the server cannot reach the javascript files or there is a typing error in the syntax of the javascript tag check the script tag and the src attribute .