diff --git a/app/Models/GenDoc.php b/app/Models/GenDoc.php index 02efb0f..5a5eaa1 100644 --- a/app/Models/GenDoc.php +++ b/app/Models/GenDoc.php @@ -15,8 +15,8 @@ class GenDoc extends Model // DocumentiGenerali public static function saveDocument($data){ - - $filename=$data->file('filename')->store(self::getEntityFolder($data['entity'])); + + $filename=$data->file('filename')->store(asset(self::getEntityFolder($data['entity']))); DB::table('gen_docs') ->insert([ 'entity'=>$data['entity'], @@ -26,14 +26,14 @@ class GenDoc extends Model ]); } - public static function listDocument($entity,$entity_id = 0) + public static function listDocument($entity,$entity_id = 1) { // Ritorna la lista dei documenti in base all'entità e al rispettivo id return DB::table('gen_docs')->where('entity','=',$entity)->where('entity_id','=',$entity_id)->get(); //nuova funzione // return DB::table('documentis')->where('movimenti_id','=', $entity_id)->get(); } - public static function countDocument($entity,$entity_id = 0){ + public static function countDocument($entity,$entity_id = 1){ // Conta i documenti inseriti per la determinata entità e id $quanti=DB::table('gen_docs') ->where('entity','=',$entity) @@ -55,7 +55,7 @@ class GenDoc extends Model $deleted = GenDoc::where('id',$id)->get(); Storage::delete($deleted[0]->filename); $removed = GenDoc::destroy($id); - //$removed->detete(); + //$removed->detete(); return 0; } }