I've successfully installed laravel version 4.1.24 (using softaculous) on my production server and now I want to move my application from my local machine to the production server (cPanel-type web hosting) but I'm having a bugger of a time figuring out how to do it. I've found a few forums online discussing similar problems but nothing has helped me yet. Which files do I need to move? Can I move them via FTP? I'm not familiar with any other method.
More detail: When I copy over all of the critical files in the "app" and "public" folders I get an error that it doesn't recognize my model classes. When I copy over everything (including "vendor" and "bootstrap" it still doesn't recognize my model classes). Someone's has to have done this before. What did you do?
Update:
I'm getting closer to the problem. I started with fresh installations on both my local and production environments and moved/overwrote files for the following folders:
/app/controllers
/app/models
/app/views
Also moved/overwrote the app/filters.php file. Besides the "public" folder this encompasses pretty much my entire application so far.
I then copied over a super-slimmed-down app/routes.php file that has only one route:
Route::get('/', function()
{
$users = User::where('id', '<' ,'100')->whereNotNull('first_name')->get();
foreach($users as $user){
echo $user->first_name . '<br>';
}
});
This worked as expected on both the local and production! I then changed the route to the following:
Route::get('/', function()
{
$cars = Car::where('id', '<' ,'100')->get();
foreach($cars as $car){
echo $car->name . '<br>';
}
});
This works just fine on the local environment but in the production it returns a "Class 'Car' not found" error. This is my problem and I think that user2094178 was onto something when he/she mentioned running "composer dump-autoload". Any idea how to do that remotely with cPanel?
Update #2
I found this thread: How to avoid using php composer dump-autoload with laravel 4?. This seems to be addressing exactly the same issue. Except that all of my models are already in the "models" folder so the line app_path().'/models',
should already be loading my classes. Right?
Also, I've found the "bootstrap/autoload.php" file that says this in the comments:
"Composer provides a convenient, automatically generated class loader for our application... We'll require it into the script here so that we do not have to worry about the loading of any our classes 'manually'."
This is followed by:
require __DIR__.'/../vendor/autoload.php';
I'm scared to modify this file because I have no idea what I'm doing in there. This has then lead me to a few other files with the same lack of direction. Any ideas?
Update 3:
Looks like Laravel 3 had something like this: http://three.laravel.com/docs/loading. I need to find out how to do it in Laravel 4.