I think the error saying that there is no file in the request(POST)
if( $request->hasFile('file'))
{
$extension = Input::file('file')->getClientOriginalExtension();
$filename = rand(11111111, 99999999). '.' . $extension;
Input::file('file')->move('192.168.2.68/practice/upload/public/files/uploads/', $filename);
$fullPath = 'myipaddress/practice/upload' . $filename;
return $fullPath ;
}
else
{
//file from post does not exist
}
EDIT
You got the paramaters wrong in your ajax
myApp.service('fileUpload', ['$http', function ($http) {
this.uploadFileToUrl = function(file, uploadUrl){
var fd = new FormData();
fd.append('file', file);
$http.post("http://myipaddress/practice/upload/blog/public/index.php/uploadavtar", fd, {
transformRequest: angular.identity,
headers: {'Content-Type': undefined,'Process-Data': false}
})
.success(function(response){
console.log(response.data);
})
.error(function(){
console.log("error");
});
}
}]);
the first paramater is for the link, second is the form data, and last is the settings