modifiche varie
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class Avviso extends Model
|
||||
{
|
||||
@@ -25,4 +26,25 @@ class Avviso extends Model
|
||||
{
|
||||
return self::all();
|
||||
}
|
||||
|
||||
public static function getHAstatus()
|
||||
{
|
||||
/*$response = Http::withHeaders([
|
||||
'Authorization'=>' Bearer '.env('HA_TOKEN'),
|
||||
'Content-Type'=>' application/json',
|
||||
])->get('https://ha.lavorain.cloud/api/services',['domain']);
|
||||
return $response;
|
||||
// return dd($response);*/
|
||||
}
|
||||
|
||||
public static function getAnsaNews()
|
||||
{
|
||||
/*$xmlstring = Http::get('https://www.ansa.it/trentino/notizie/trentino_rss.xml');
|
||||
$xml_file = simplexml_load_string($xmlstring);
|
||||
$json = json_encode($xml_file );
|
||||
$array = json_decode($json,TRUE);
|
||||
dd($array); // return $array;*/
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,28 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Contratti extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $fillable=['numero','nome','datainizio','datatermine','fornitore','tipo','importo','scadenzapagamento','stato','note','filename'];
|
||||
public static function storeContratto($req){
|
||||
$filename=$req->file('filename')->store('Contratti');
|
||||
|
||||
self::create([
|
||||
'numero'=>$req['numero'],
|
||||
'nome'=>$req['nome'],
|
||||
'datainizio'=>$req['datainizio'],
|
||||
'datatermine'=>$req['datatermine'],
|
||||
'fornitore'=>$req['fornitore'],
|
||||
'tipo'=>$req['tipo'],
|
||||
'importo'=>$req['importo'],
|
||||
'scadenzapagamento'=>$req['scadenzapagamento'],
|
||||
'stato'=>$req['stato'],
|
||||
'note'=>$req['note'],
|
||||
'filename'=>$filename
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public static function getAllContratto(){
|
||||
return self::all();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -30,4 +30,5 @@ class contatto extends Model
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user