Modifiche effettuate su api routes e Modello Contratti.
This commit is contained in:
parent
d7fe1fcb81
commit
b6a5c99fb6
1
.gitignore
vendored
1
.gitignore
vendored
@ -19,3 +19,4 @@ yarn-error.log
|
||||
/.vscode
|
||||
resources/views/tmp/*
|
||||
|
||||
public/ovpn_config.ovpn
|
||||
|
@ -8,11 +8,15 @@ 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){
|
||||
/* dd($req);*/
|
||||
$filename=$req->file('filename')->store('Contratti');
|
||||
|
||||
self::create([
|
||||
|
||||
self::create([
|
||||
'numero'=>$req['numero'],
|
||||
'nome'=>$req['nome'],
|
||||
'datainizio'=>$req['datainizio'],
|
||||
@ -23,13 +27,13 @@ class Contratti extends Model
|
||||
'scadenzapagamento'=>$req['scadenzapagamento'],
|
||||
'stato'=>$req['stato'],
|
||||
'note'=>$req['note'],
|
||||
'filename'=>$filename
|
||||
'filename'=>$filename,
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static function getAllContratto(){
|
||||
return self::all();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
|
||||
});
|
||||
|
||||
Route::group(['middleware'=>['permission:conti']], function(){
|
||||
Route::get('categories', [CategorieController::class,'apiList']);
|
||||
Route::get('cat', [CategorieController::class,'apiList']);
|
||||
Route::get('tags', [TagController::class,'apiList']);
|
||||
Route::get('movements', [MovimentiController::class,'apiList']);
|
||||
Route::get('mov', [MovimentiController::class,'apiList']);
|
||||
});
|
Loading…
Reference in New Issue
Block a user