Saturday 15 August 2015

php - Laravel - Class 'Setting' not found -



php - Laravel - Class 'Setting' not found -

i using laravel 4.2 & getting class 'setting' not found error on production server whereas working on localhost. here controller code (partial)

here controller code :

<?php // app/controllers/claimcontroller.php class claimcontroller extends \basecontroller { public function create() { $insurers = insurer::lists('insurers_name', 'id'); $office = office::lists('office_name', 'id'); $workshops = workshop::lists('workshop_name', 'id'); $type_of_report = setting::where('grp','=','type_of_report')->lists('name','id'); $vehicle_type = setting::where('grp','=','vehicle_type')->lists('name','id'); homecoming view::make('claim.create')->with('insurers',$insurers)->with('office',$office)->with('workshops',$workshops)->with('type_of_report', $type_of_report)->with('vehicle_type', $vehicle_type); } }

model code :

<?php // app/models/setting.php class setting extends eloquent { } ?>

getting error

symfony \ component \ debug \ exception \ fatalerrorexception (e_error) class 'setting' not found

when alter above 2 lines in create() function to

$type_of_report = db::table('settings')->where('grp','type_of_report')->lists('name','id'); $vehicle_type = db::table('settings')->where('grp','vehicle_type')->lists('name','id');

works fine on production server & on localhost.

the problem model file named setting.php , should setting.php capital letter. on localhost (probably windows) work without problem because in windows file aaa , aaa same in linux isn't.

php laravel

No comments:

Post a Comment