From 622a1a77784484bfde66044269206f101935ca64 Mon Sep 17 00:00:00 2001 From: Flavio Barachino Date: Tue, 21 Oct 2025 14:29:25 +0200 Subject: [PATCH] test salvataggio files --- app/Models/GenDoc.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; } }