Roberto Santini il y a 3 ans
révision
af690283bc
100 fichiers modifiés avec 22633 ajouts et 0 suppressions
  1. 18
    0
      .editorconfig
  2. 52
    0
      .env.example
  3. 10
    0
      .gitattributes
  4. 15
    0
      .gitignore
  5. 14
    0
      .styleci.yml
  6. 10
    0
      README.md
  7. 156
    0
      SegnalazioniCliente.skipper
  8. 32
    0
      app/Console/Kernel.php
  9. 87
    0
      app/DataTables/IssueDataTable.php
  10. 129
    0
      app/DataTables/RoleDataTable.php
  11. 73
    0
      app/DataTables/RoleDataTableEditor.php
  12. 121
    0
      app/DataTables/UserDataTable.php
  13. 69
    0
      app/DataTables/UserDataTableEditor.php
  14. 41
    0
      app/Exceptions/Handler.php
  15. 63
    0
      app/Http/Controllers/Auth/AuthenticatedSessionController.php
  16. 44
    0
      app/Http/Controllers/Auth/ConfirmablePasswordController.php
  17. 27
    0
      app/Http/Controllers/Auth/EmailVerificationNotificationController.php
  18. 23
    0
      app/Http/Controllers/Auth/EmailVerificationPromptController.php
  19. 65
    0
      app/Http/Controllers/Auth/NewPasswordController.php
  20. 47
    0
      app/Http/Controllers/Auth/PasswordResetLinkController.php
  21. 54
    0
      app/Http/Controllers/Auth/RegisteredUserController.php
  22. 30
    0
      app/Http/Controllers/Auth/VerifyEmailController.php
  23. 69
    0
      app/Http/Controllers/ConfigController.php
  24. 13
    0
      app/Http/Controllers/Controller.php
  25. 276
    0
      app/Http/Controllers/IssueController.php
  26. 25
    0
      app/Http/Controllers/PermissionController.php
  27. 93
    0
      app/Http/Controllers/RoleController.php
  28. 130
    0
      app/Http/Controllers/UserController.php
  29. 70
    0
      app/Http/Kernel.php
  30. 21
    0
      app/Http/Middleware/Authenticate.php
  31. 17
    0
      app/Http/Middleware/EncryptCookies.php
  32. 17
    0
      app/Http/Middleware/PreventRequestsDuringMaintenance.php
  33. 32
    0
      app/Http/Middleware/RedirectIfAuthenticated.php
  34. 19
    0
      app/Http/Middleware/TrimStrings.php
  35. 20
    0
      app/Http/Middleware/TrustHosts.php
  36. 28
    0
      app/Http/Middleware/TrustProxies.php
  37. 17
    0
      app/Http/Middleware/VerifyCsrfToken.php
  38. 93
    0
      app/Http/Requests/Auth/LoginRequest.php
  39. 72
    0
      app/Models/AbstractModels/AbstractConfig.php
  40. 60
    0
      app/Models/AbstractModels/AbstractUser.php
  41. 28
    0
      app/Models/Config.php
  42. 90
    0
      app/Models/Issue.php
  43. 6
    0
      app/Models/Permission.php
  44. 6
    0
      app/Models/Role.php
  45. 33
    0
      app/Models/User.php
  46. 64
    0
      app/Notifications/ResetPasswordNotification.php
  47. 62
    0
      app/Observers/UserObserver.php
  48. 28
    0
      app/Providers/AppServiceProvider.php
  49. 30
    0
      app/Providers/AuthServiceProvider.php
  50. 21
    0
      app/Providers/BroadcastServiceProvider.php
  51. 32
    0
      app/Providers/EventServiceProvider.php
  52. 63
    0
      app/Providers/RouteServiceProvider.php
  53. 18
    0
      app/View/Components/AppLayout.php
  54. 18
    0
      app/View/Components/GuestLayout.php
  55. 53
    0
      artisan
  56. 55
    0
      bootstrap/app.php
  57. 2
    0
      bootstrap/cache/.gitignore
  58. 65
    0
      composer.json
  59. 9087
    0
      composer.lock
  60. 238
    0
      config/app.php
  61. 111
    0
      config/auth.php
  62. 64
    0
      config/broadcasting.php
  63. 110
    0
      config/cache.php
  64. 34
    0
      config/cors.php
  65. 147
    0
      config/database.php
  66. 73
    0
      config/filesystems.php
  67. 52
    0
      config/hashing.php
  68. 118
    0
      config/logging.php
  69. 118
    0
      config/mail.php
  70. 161
    0
      config/permission.php
  71. 93
    0
      config/queue.php
  72. 9
    0
      config/redmine.php
  73. 65
    0
      config/sanctum.php
  74. 33
    0
      config/services.php
  75. 201
    0
      config/session.php
  76. 36
    0
      config/view.php
  77. 1
    0
      database/.gitignore
  78. 39
    0
      database/factories/UserFactory.php
  79. 32
    0
      database/migrations/2014_10_12_100000_create_password_resets_table.php
  80. 36
    0
      database/migrations/2019_08_19_000000_create_failed_jobs_table.php
  81. 36
    0
      database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php
  82. 144
    0
      database/migrations/2022_03_18_134442_create_permission_tables.php
  83. 54
    0
      database/migrations/2022_03_18_143813_skipper_migrations_2022031814381384.php
  84. 36
    0
      database/migrations/2022_03_18_162345_skipper_migrations_2022031816234578.php
  85. 34
    0
      database/seeders/AdminSeeder.php
  86. 31
    0
      database/seeders/ConfigSeeder.php
  87. 20
    0
      database/seeders/DatabaseSeeder.php
  88. 48
    0
      database/seeders/PermissionSeeder.php
  89. 23
    0
      package.json
  90. 31
    0
      phpunit.xml
  91. 21
    0
      public/.htaccess
  92. BIN
      public/assets/contract.png
  93. BIN
      public/assets/logo_bgw.png
  94. BIN
      public/assets/logo_rm.png
  95. BIN
      public/assets/new_issue.png
  96. BIN
      public/assets/report.png
  97. 8008
    0
      public/assets/sql/comune.sql
  98. 251
    0
      public/assets/sql/nazione.sql
  99. 112
    0
      public/assets/sql/provincia.sql
  100. 0
    0
      public/css/app.css

+ 18
- 0
.editorconfig Voir le fichier

@@ -0,0 +1,18 @@
1
+root = true
2
+
3
+[*]
4
+charset = utf-8
5
+end_of_line = lf
6
+insert_final_newline = true
7
+indent_style = space
8
+indent_size = 4
9
+trim_trailing_whitespace = true
10
+
11
+[*.md]
12
+trim_trailing_whitespace = false
13
+
14
+[*.{yml,yaml}]
15
+indent_size = 2
16
+
17
+[docker-compose.yml]
18
+indent_size = 4

+ 52
- 0
.env.example Voir le fichier

@@ -0,0 +1,52 @@
1
+APP_NAME=Laravel
2
+APP_ENV=local
3
+APP_KEY=
4
+APP_DEBUG=true
5
+APP_URL=http://localhost
6
+
7
+LOG_CHANNEL=stack
8
+LOG_DEPRECATIONS_CHANNEL=null
9
+LOG_LEVEL=debug
10
+
11
+DB_CONNECTION=mysql
12
+DB_HOST=127.0.0.1
13
+DB_PORT=3306
14
+DB_DATABASE=laravel
15
+DB_USERNAME=root
16
+DB_PASSWORD=
17
+
18
+BROADCAST_DRIVER=log
19
+CACHE_DRIVER=file
20
+FILESYSTEM_DRIVER=local
21
+QUEUE_CONNECTION=sync
22
+SESSION_DRIVER=file
23
+SESSION_LIFETIME=120
24
+
25
+MEMCACHED_HOST=127.0.0.1
26
+
27
+REDIS_HOST=127.0.0.1
28
+REDIS_PASSWORD=null
29
+REDIS_PORT=6379
30
+
31
+MAIL_MAILER=smtp
32
+MAIL_HOST=mailhog
33
+MAIL_PORT=1025
34
+MAIL_USERNAME=null
35
+MAIL_PASSWORD=null
36
+MAIL_ENCRYPTION=null
37
+MAIL_FROM_ADDRESS=null
38
+MAIL_FROM_NAME="${APP_NAME}"
39
+
40
+AWS_ACCESS_KEY_ID=
41
+AWS_SECRET_ACCESS_KEY=
42
+AWS_DEFAULT_REGION=us-east-1
43
+AWS_BUCKET=
44
+AWS_USE_PATH_STYLE_ENDPOINT=false
45
+
46
+PUSHER_APP_ID=
47
+PUSHER_APP_KEY=
48
+PUSHER_APP_SECRET=
49
+PUSHER_APP_CLUSTER=mt1
50
+
51
+MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
52
+MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

+ 10
- 0
.gitattributes Voir le fichier

@@ -0,0 +1,10 @@
1
+* text=auto
2
+
3
+*.blade.php diff=html
4
+*.css diff=css
5
+*.html diff=html
6
+*.md diff=markdown
7
+*.php diff=php
8
+
9
+/.github export-ignore
10
+CHANGELOG.md export-ignore

+ 15
- 0
.gitignore Voir le fichier

@@ -0,0 +1,15 @@
1
+/node_modules
2
+/public/hot
3
+/public/storage
4
+/storage/*.key
5
+/vendor
6
+.env
7
+.env.backup
8
+.phpunit.result.cache
9
+docker-compose.override.yml
10
+Homestead.json
11
+Homestead.yaml
12
+npm-debug.log
13
+yarn-error.log
14
+/.idea
15
+/.vscode

+ 14
- 0
.styleci.yml Voir le fichier

@@ -0,0 +1,14 @@
1
+php:
2
+  preset: laravel
3
+  version: 8
4
+  disabled:
5
+    - no_unused_imports
6
+  finder:
7
+    not-name:
8
+      - index.php
9
+      - server.php
10
+js:
11
+  finder:
12
+    not-name:
13
+      - webpack.mix.js
14
+css: true

+ 10
- 0
README.md Voir le fichier

@@ -0,0 +1,10 @@
1
+# Segnalazioni clienti BGW
2
+Installare Laravel.
3
+
4
+Configurare nel file .env le seguenti variabili:
5
+
6
+```
7
+REDMINE_URL=<url redmine, senza https:// iniziale>
8
+REDMINE_USER=<utente admin di redmine>
9
+REDMINE_PWD=<password>
10
+```

+ 156
- 0
SegnalazioniCliente.skipper Voir le fichier

@@ -0,0 +1,156 @@
1
+<?xml version="1.0"?>
2
+<skipper version="3.2.25.1702" mvc="Laravel" orm="Laravel" name="SegnalazioniCliente" uuid="471b6d6e-fec4-4c2d-bb3c-b83ad14da19e">
3
+  <orm-attributes>
4
+    <attribute name="migrations-path">database/migrations</attribute>
5
+  </orm-attributes>
6
+  <module name="\Application module" local-name="Application module" namespace="\App\Models" local-namespace="App\Models" export-format="Laravel" export-path="." uuid="5d001242-7c7e-481d-9c96-deb7d7054d07">
7
+    <entity name="\App\Models\User" local-name="User" namespace="\App\Models" uuid="25689795-5af3-40e8-92a6-fdc2f985c0fa">
8
+      <field name="id" type="bigInteger" required="true" unique="true" primary="true" unsigned="true" auto-increment="true" uuid="1fd72276-84e6-4076-b708-b20cc0beb4c8"/>
9
+      <field name="nome" type="string" uuid="7355d7de-6d7c-4ad5-9be7-4eb7500baded"/>
10
+      <field name="cognome" type="string" uuid="92214e28-3800-4101-822a-f480d3a86d18"/>
11
+      <field name="email" type="string" unique="true" uuid="10d24f55-8b2e-4285-9bea-c21ea3f1a8d8"/>
12
+      <field name="password" type="string" uuid="af475c54-9b5d-4370-b974-0cb8dab62a46"/>
13
+      <field name="email_verified_at" type="timestamp" uuid="298fbbd8-6e02-4598-9062-3ac8f0303abf"/>
14
+      <field name="remember_token" type="string" uuid="195b6ad3-1e2c-4549-b08e-8cb93abbdf3c"/>
15
+      <field name="progetti" type="string" uuid="2032867f-d624-4182-9b78-090206d41bf2"/>
16
+      <field name="created_at" type="timestamp" uuid="c8f32666-5ce7-43c1-8068-8a38466b1bf5"/>
17
+      <field name="updated_at" type="timestamp" uuid="25472662-c3e5-401e-bf68-a194821ea700"/>
18
+      <orm-attributes>
19
+        <attribute name="table">users</attribute>
20
+        <attribute name="fillableAll">as-fillable-all</attribute>
21
+        <attribute name="extends">\Illuminate\Foundation\Auth\User</attribute>
22
+      </orm-attributes>
23
+    </entity>
24
+    <entity name="\App\Models\Config" local-name="Config" namespace="\App\Models" uuid="f746a2e3-bd41-4490-8b67-e935d27ac777">
25
+      <field name="key" type="string" required="true" unique="true" primary="true" uuid="e282ea2f-dd5e-4bcf-baf9-5e89caa75e29"/>
26
+      <field name="group" type="string" uuid="f5cdc210-d5bd-4e88-828f-c5c66ac1e64a"/>
27
+      <field name="display_name" type="string" uuid="f2f734d6-2adf-4498-9d8f-09d33ae82f27"/>
28
+      <field name="value" type="longText" uuid="1881dbb2-8d23-46f1-bc47-665179f625e0"/>
29
+      <field name="order" type="integer" uuid="e1bfe035-48f5-42ef-a4ab-4aa6196bcbae"/>
30
+      <field name="type" type="string" uuid="30617836-4b65-4729-9430-2a07e8319a75"/>
31
+      <field name="created_at" type="timestamp" uuid="9dd823e6-6f3a-48d8-b196-ebd6d5e1d1bf"/>
32
+      <field name="updated_at" type="timestamp" uuid="2cedcb2b-c4e1-4200-8d67-8208f654d57d"/>
33
+      <orm-attributes>
34
+        <attribute name="table">config</attribute>
35
+        <attribute name="fillableAll">as-fillable-all</attribute>
36
+      </orm-attributes>
37
+    </entity>
38
+    <migrations version="1.0">
39
+      <revision uuid="20640eb6-d377-431c-acd9-ee62c3411147" date="2022-03-18 14:38:13.845660" exportable="true">
40
+        <element action="add" uuid="5d001242-7c7e-481d-9c96-deb7d7054d07" type="module">
41
+          <property name="export-format" value="Laravel"/>
42
+          <property name="export-path" value="."/>
43
+          <property name="local-name" value="Application module"/>
44
+          <property name="local-namespace" value="App\Models"/>
45
+          <property name="name" value="\Application module"/>
46
+          <property name="namespace" value="\App\Models"/>
47
+        </element>
48
+        <element action="add" uuid="25689795-5af3-40e8-92a6-fdc2f985c0fa" parent-uuid="5d001242-7c7e-481d-9c96-deb7d7054d07" type="entity">
49
+          <property name="extends" value="\Illuminate\Foundation\Auth\User"/>
50
+          <property name="fillableAll" value="as-fillable-all"/>
51
+          <property name="local-name" value="User"/>
52
+          <property name="name" value="\App\Models\User"/>
53
+          <property name="namespace" value="\App\Models"/>
54
+          <property name="table" value="users"/>
55
+        </element>
56
+        <element action="add" uuid="f746a2e3-bd41-4490-8b67-e935d27ac777" parent-uuid="5d001242-7c7e-481d-9c96-deb7d7054d07" type="entity">
57
+          <property name="fillableAll" value="as-fillable-all"/>
58
+          <property name="local-name" value="Config"/>
59
+          <property name="name" value="\App\Models\Config"/>
60
+          <property name="namespace" value="\App\Models"/>
61
+          <property name="table" value="config"/>
62
+        </element>
63
+        <element action="add" uuid="1fd72276-84e6-4076-b708-b20cc0beb4c8" parent-uuid="25689795-5af3-40e8-92a6-fdc2f985c0fa" type="field">
64
+          <property name="auto-increment" value="true"/>
65
+          <property name="name" value="id"/>
66
+          <property name="primary" value="true"/>
67
+          <property name="required" value="true"/>
68
+          <property name="type" value="bigInteger"/>
69
+          <property name="unique" value="true"/>
70
+          <property name="unsigned" value="true"/>
71
+        </element>
72
+        <element action="add" uuid="7355d7de-6d7c-4ad5-9be7-4eb7500baded" parent-uuid="25689795-5af3-40e8-92a6-fdc2f985c0fa" sibling-uuid="1fd72276-84e6-4076-b708-b20cc0beb4c8" type="field">
73
+          <property name="name" value="nome"/>
74
+          <property name="type" value="string"/>
75
+        </element>
76
+        <element action="add" uuid="92214e28-3800-4101-822a-f480d3a86d18" parent-uuid="25689795-5af3-40e8-92a6-fdc2f985c0fa" sibling-uuid="7355d7de-6d7c-4ad5-9be7-4eb7500baded" type="field">
77
+          <property name="name" value="cognome"/>
78
+          <property name="type" value="string"/>
79
+        </element>
80
+        <element action="add" uuid="10d24f55-8b2e-4285-9bea-c21ea3f1a8d8" parent-uuid="25689795-5af3-40e8-92a6-fdc2f985c0fa" sibling-uuid="92214e28-3800-4101-822a-f480d3a86d18" type="field">
81
+          <property name="name" value="email"/>
82
+          <property name="type" value="string"/>
83
+          <property name="unique" value="true"/>
84
+        </element>
85
+        <element action="add" uuid="af475c54-9b5d-4370-b974-0cb8dab62a46" parent-uuid="25689795-5af3-40e8-92a6-fdc2f985c0fa" sibling-uuid="10d24f55-8b2e-4285-9bea-c21ea3f1a8d8" type="field">
86
+          <property name="name" value="password"/>
87
+          <property name="type" value="string"/>
88
+        </element>
89
+        <element action="add" uuid="298fbbd8-6e02-4598-9062-3ac8f0303abf" parent-uuid="25689795-5af3-40e8-92a6-fdc2f985c0fa" sibling-uuid="af475c54-9b5d-4370-b974-0cb8dab62a46" type="field">
90
+          <property name="name" value="email_verified_at"/>
91
+          <property name="type" value="timestamp"/>
92
+        </element>
93
+        <element action="add" uuid="195b6ad3-1e2c-4549-b08e-8cb93abbdf3c" parent-uuid="25689795-5af3-40e8-92a6-fdc2f985c0fa" sibling-uuid="298fbbd8-6e02-4598-9062-3ac8f0303abf" type="field">
94
+          <property name="name" value="remember_token"/>
95
+          <property name="type" value="string"/>
96
+        </element>
97
+        <element action="add" uuid="c8f32666-5ce7-43c1-8068-8a38466b1bf5" parent-uuid="25689795-5af3-40e8-92a6-fdc2f985c0fa" sibling-uuid="195b6ad3-1e2c-4549-b08e-8cb93abbdf3c" type="field">
98
+          <property name="name" value="created_at"/>
99
+          <property name="type" value="timestamp"/>
100
+        </element>
101
+        <element action="add" uuid="25472662-c3e5-401e-bf68-a194821ea700" parent-uuid="25689795-5af3-40e8-92a6-fdc2f985c0fa" sibling-uuid="c8f32666-5ce7-43c1-8068-8a38466b1bf5" type="field">
102
+          <property name="name" value="updated_at"/>
103
+          <property name="type" value="timestamp"/>
104
+        </element>
105
+        <element action="add" uuid="e282ea2f-dd5e-4bcf-baf9-5e89caa75e29" parent-uuid="f746a2e3-bd41-4490-8b67-e935d27ac777" type="field">
106
+          <property name="name" value="key"/>
107
+          <property name="primary" value="true"/>
108
+          <property name="required" value="true"/>
109
+          <property name="type" value="string"/>
110
+          <property name="unique" value="true"/>
111
+        </element>
112
+        <element action="add" uuid="f5cdc210-d5bd-4e88-828f-c5c66ac1e64a" parent-uuid="f746a2e3-bd41-4490-8b67-e935d27ac777" sibling-uuid="e282ea2f-dd5e-4bcf-baf9-5e89caa75e29" type="field">
113
+          <property name="name" value="group"/>
114
+          <property name="type" value="string"/>
115
+        </element>
116
+        <element action="add" uuid="f2f734d6-2adf-4498-9d8f-09d33ae82f27" parent-uuid="f746a2e3-bd41-4490-8b67-e935d27ac777" sibling-uuid="f5cdc210-d5bd-4e88-828f-c5c66ac1e64a" type="field">
117
+          <property name="name" value="display_name"/>
118
+          <property name="type" value="string"/>
119
+        </element>
120
+        <element action="add" uuid="1881dbb2-8d23-46f1-bc47-665179f625e0" parent-uuid="f746a2e3-bd41-4490-8b67-e935d27ac777" sibling-uuid="f2f734d6-2adf-4498-9d8f-09d33ae82f27" type="field">
121
+          <property name="name" value="value"/>
122
+          <property name="type" value="longText"/>
123
+        </element>
124
+        <element action="add" uuid="e1bfe035-48f5-42ef-a4ab-4aa6196bcbae" parent-uuid="f746a2e3-bd41-4490-8b67-e935d27ac777" sibling-uuid="1881dbb2-8d23-46f1-bc47-665179f625e0" type="field">
125
+          <property name="name" value="order"/>
126
+          <property name="type" value="integer"/>
127
+        </element>
128
+        <element action="add" uuid="30617836-4b65-4729-9430-2a07e8319a75" parent-uuid="f746a2e3-bd41-4490-8b67-e935d27ac777" sibling-uuid="e1bfe035-48f5-42ef-a4ab-4aa6196bcbae" type="field">
129
+          <property name="name" value="type"/>
130
+          <property name="type" value="string"/>
131
+        </element>
132
+        <element action="add" uuid="9dd823e6-6f3a-48d8-b196-ebd6d5e1d1bf" parent-uuid="f746a2e3-bd41-4490-8b67-e935d27ac777" sibling-uuid="30617836-4b65-4729-9430-2a07e8319a75" type="field">
133
+          <property name="name" value="created_at"/>
134
+          <property name="type" value="timestamp"/>
135
+        </element>
136
+        <element action="add" uuid="2cedcb2b-c4e1-4200-8d67-8208f654d57d" parent-uuid="f746a2e3-bd41-4490-8b67-e935d27ac777" sibling-uuid="9dd823e6-6f3a-48d8-b196-ebd6d5e1d1bf" type="field">
137
+          <property name="name" value="updated_at"/>
138
+          <property name="type" value="timestamp"/>
139
+        </element>
140
+      </revision>
141
+      <revision uuid="64eca5de-6016-4960-98e3-6fdacb0e06e7" date="2022-03-18 16:23:45.782882" exportable="true">
142
+        <element action="add" uuid="2032867f-d624-4182-9b78-090206d41bf2" parent-uuid="25689795-5af3-40e8-92a6-fdc2f985c0fa" sibling-uuid="195b6ad3-1e2c-4549-b08e-8cb93abbdf3c" type="field">
143
+          <property name="name" value="progetti"/>
144
+          <property name="type" value="string"/>
145
+        </element>
146
+        <element action="reorder" uuid="c8f32666-5ce7-43c1-8068-8a38466b1bf5" parent-uuid="25689795-5af3-40e8-92a6-fdc2f985c0fa" sibling-uuid="2032867f-d624-4182-9b78-090206d41bf2" previous-sibling-uuid="195b6ad3-1e2c-4549-b08e-8cb93abbdf3c" type="field" helper="true"/>
147
+      </revision>
148
+    </migrations>
149
+  </module>
150
+  <visual-data>
151
+    <entity uuid="25689795-5af3-40e8-92a6-fdc2f985c0fa" bg-color="#FFFFFF" hdr-color="#D2D2D2" position-x="9" position-y="18" size-x="0" size-x2="204" size-y="0" size-y2="227"/>
152
+    <entity uuid="f746a2e3-bd41-4490-8b67-e935d27ac777" bg-color="#FFFFFF" hdr-color="#D2D2D2" position-x="186" position-y="18" size-x="0" size-x2="119" size-y="0" size-y2="129"/>
153
+    <module uuid="5d001242-7c7e-481d-9c96-deb7d7054d07" bg-color="#EAE4F1" position-x="30" position-y="43" size-x="11" size-x2="894" size-y="22" size-y2="552"/>
154
+    <project uuid="471b6d6e-fec4-4c2d-bb3c-b83ad14da19e" size-x="0" size-x2="1193" size-y="0" size-y2="645"/>
155
+  </visual-data>
156
+</skipper>

+ 32
- 0
app/Console/Kernel.php Voir le fichier

@@ -0,0 +1,32 @@
1
+<?php
2
+
3
+namespace App\Console;
4
+
5
+use Illuminate\Console\Scheduling\Schedule;
6
+use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
7
+
8
+class Kernel extends ConsoleKernel
9
+{
10
+    /**
11
+     * Define the application's command schedule.
12
+     *
13
+     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
14
+     * @return void
15
+     */
16
+    protected function schedule(Schedule $schedule)
17
+    {
18
+        // $schedule->command('inspire')->hourly();
19
+    }
20
+
21
+    /**
22
+     * Register the commands for the application.
23
+     *
24
+     * @return void
25
+     */
26
+    protected function commands()
27
+    {
28
+        $this->load(__DIR__.'/Commands');
29
+
30
+        require base_path('routes/console.php');
31
+    }
32
+}

+ 87
- 0
app/DataTables/IssueDataTable.php Voir le fichier

@@ -0,0 +1,87 @@
1
+<?php
2
+
3
+namespace App\DataTables;
4
+
5
+use Yajra\DataTables\Services\DataTable;
6
+use Yajra\DataTables\Html\Button;
7
+use Yajra\DataTables\Html\Column;
8
+use Yajra\DataTables\Html\Editor\Editor;
9
+use Yajra\DataTables\Html\Editor\Fields;
10
+use Auth;
11
+use Form;
12
+use Carbon\Carbon;
13
+
14
+class IssueDataTable extends DataTable
15
+{
16
+  public function __construct(){
17
+    $this->dataTableVariable = 'dataTable_issues';
18
+  }
19
+
20
+  /**
21
+  * Build DataTable class.
22
+  *
23
+  * @param mixed $query Results from query() method.
24
+  * @return \Yajra\DataTables\DataTableAbstract
25
+  */
26
+  public function dataTable($query)
27
+  {
28
+    return datatables()
29
+    ->collection($this->issues)
30
+    ->setRowId('id')
31
+    ->addColumn('created_on_label', function($entity){
32
+      try{
33
+        return Carbon::parse($entity->created_on)->format('d/m/Y');
34
+      }catch(\Exception $e){
35
+
36
+      }
37
+    })
38
+    ->addColumn('action', function($entity){
39
+      $button = "<a class='btn btn-primary' href='".route('issue.show', ['id' => $entity->id])."'><i class='fas fa-chevron-right'></i></a>";
40
+      return $button;
41
+      return view('issue.menu', ['entity' => $entity]);
42
+    });
43
+  }
44
+
45
+  /**
46
+  * Optional method if you want to use html builder.
47
+  *
48
+  * @return \Yajra\DataTables\Html\Builder
49
+  */
50
+  public function html()
51
+  {
52
+    $buttons = [];
53
+
54
+    return $this->builder()
55
+    ->setTableId($this->dataTableVariable)
56
+    ->columns($this->getColumns())
57
+    // ->minifiedAjax()
58
+    ->language(asset('plugins/datatables/Italian.json'))
59
+    ->dom(count($buttons)==0?'rtip':'Brtip')
60
+    ->orderBy(0, 'desc')
61
+    ->pageLength(20)
62
+    ->buttons($buttons);
63
+    }
64
+
65
+    /**
66
+    * Get columns.
67
+    *
68
+    * @return array
69
+    */
70
+    protected function getColumns()
71
+    {
72
+      return [
73
+        Column::make('id')->title('#'),
74
+        Column::make('project.name')->title('Cliente'),
75
+        Column::make('created_on')->title('Data')->data('created_on_label'),
76
+        Column::make('subject')->title('Oggetto'),
77
+        Column::make('status.name')->title('Stato'),
78
+        Column::computed('action')
79
+        ->exportable(false)
80
+        ->printable(false)
81
+        ->width('10%')
82
+        ->title(' ')
83
+        ->addClass('text-right'),
84
+      ];
85
+    }
86
+
87
+  }

+ 129
- 0
app/DataTables/RoleDataTable.php Voir le fichier

@@ -0,0 +1,129 @@
1
+<?php
2
+
3
+namespace App\DataTables;
4
+
5
+use Yajra\DataTables\Services\DataTable;
6
+use Yajra\DataTables\Html\Button;
7
+use Yajra\DataTables\Html\Column;
8
+use Yajra\DataTables\Html\Editor\Editor;
9
+use Yajra\DataTables\Html\Editor\Fields;
10
+use App\Models\Role;
11
+use Auth;
12
+use Form;
13
+
14
+class RoleDataTable extends DataTable
15
+{
16
+  public function __construct(){
17
+    $this->dataTableVariable = 'dataTable_role';
18
+  }
19
+
20
+  /**
21
+  * Build DataTable class.
22
+  *
23
+  * @param mixed $query Results from query() method.
24
+  * @return \Yajra\DataTables\DataTableAbstract
25
+  */
26
+  public function dataTable($query)
27
+  {
28
+    return datatables()
29
+    ->eloquent($query)
30
+    ->setRowId('id')
31
+    ->addColumn('action', function($entity){
32
+      return view('role.menu', ['entity' => $entity]);
33
+    });
34
+  }
35
+
36
+
37
+  /**
38
+  * Get query source of dataTable.
39
+  *
40
+  * @param \App\Role $model
41
+  * @return \Illuminate\Database\Eloquent\Builder
42
+  */
43
+  public function query(Role $model)
44
+  {
45
+    return $model->newQuery();
46
+  }
47
+
48
+  /**
49
+  * Optional method if you want to use html builder.
50
+  *
51
+  * @return \Yajra\DataTables\Html\Builder
52
+  */
53
+  public function html()
54
+  {
55
+    $buttons = [];
56
+    if(Auth::user()->can('create-roles-permissions')){
57
+      array_push($buttons, Button::make('create')
58
+      ->editor('editor')
59
+      ->className('btn btn-sm btn-primary')
60
+      ->formTitle('Crea nuovo ruolo')
61
+      ->formButtons(
62
+        [Button::raw('Annulla')
63
+        ->className('btn btn-secondary ml-2')
64
+        ->actionClose(),
65
+        Button::raw('Salva')
66
+        ->className('btn btn-success ml-2')
67
+        ->actionHandler('create')]
68
+        )
69
+      ->text('<i class="fas fa-plus"></i> Nuovo ruolo'));
70
+    }
71
+
72
+    return $this->builder()
73
+    ->setTableId($this->dataTableVariable)
74
+    ->columns($this->getColumns())
75
+    ->minifiedAjax()
76
+    ->language(asset('plugins/datatables/Italian.json'))
77
+    ->dom(count($buttons)==0?'rtip':'Brtip')
78
+    ->orderBy(1, 'ASC')
79
+    ->buttons($buttons)
80
+    ->editor(
81
+      Editor::make()
82
+      ->fields([
83
+        Fields\Text::make('display_name', 'Nome'),
84
+        Fields\Hidden::make('guard_name')->default('web'),
85
+        Fields\Hidden::make('name')
86
+      ])
87
+      ->on('preSubmit', "function(e, data, action){
88
+        if(action == 'create'){
89
+          data.data[0]['name'] = convertToSlug(data.data[0]['display_name']);
90
+        }
91
+      }")
92
+      ->on('submitComplete', "function( e, mode, action ){}"
93
+        )
94
+      )
95
+      ->initComplete("function(settings, json){
96
+        initComplete();
97
+      }");
98
+    }
99
+
100
+    /**
101
+    * Get columns.
102
+    *
103
+    * @return array
104
+    */
105
+    protected function getColumns()
106
+    {
107
+      return [
108
+        Column::make('id')->title('ID')->width('10%')->visible(false),
109
+        Column::make('display_name')->title('Nome ruolo'),
110
+        Column::computed('action')
111
+        ->exportable(false)
112
+        ->printable(false)
113
+        ->width('10%')
114
+        ->title(' ')
115
+        ->addClass('text-right'),
116
+      ];
117
+    }
118
+
119
+    /**
120
+    * Get filename for export.
121
+    *
122
+    * @return string
123
+    */
124
+    protected function filename()
125
+    {
126
+      return 'Ruoli' . date('YmdHis');
127
+    }
128
+
129
+  }

+ 73
- 0
app/DataTables/RoleDataTableEditor.php Voir le fichier

@@ -0,0 +1,73 @@
1
+<?php
2
+
3
+namespace App\DataTables;
4
+
5
+use App\Models\Role;
6
+use Illuminate\Database\Eloquent\Model;
7
+use Illuminate\Validation\Rule;
8
+use Yajra\DataTables\DataTablesEditor;
9
+
10
+class RoleDataTableEditor extends DataTablesEditor
11
+{
12
+  protected $model = Role::class;
13
+  protected $messages = [
14
+    'display_name.required' => 'Il nome è richiesto',
15
+    'name.unique' => 'Nome non valido'
16
+  ];
17
+
18
+  /**
19
+  * Get create action validation rules.
20
+  *
21
+  * @return array
22
+  */
23
+  public function createRules()
24
+  {
25
+
26
+    return [
27
+      'display_name'  => 'required',
28
+      'name' => 'unique:roles'
29
+    ];
30
+  }
31
+
32
+  public function createMessages(){
33
+    return $this->messages;
34
+  }
35
+
36
+  /**
37
+  * Get edit action validation rules.
38
+  *
39
+  * @param Model $model
40
+  * @return array
41
+  */
42
+  public function editRules(Model $model)
43
+  {
44
+    return [
45
+      'display_name'  => 'required|unique:roles',
46
+    ];
47
+  }
48
+
49
+  public function editMessages(){
50
+    return $this->messages;
51
+  }
52
+
53
+  /**
54
+  * Get remove action validation rules.
55
+  *
56
+  * @param Model $model
57
+  * @return array
58
+  */
59
+  public function removeRules(Model $model)
60
+  {
61
+    return [];
62
+  }
63
+
64
+  public function creating(Model $model, array $data)
65
+  {
66
+    return $data;
67
+  }
68
+
69
+  public function updating(Model $model, array $data)
70
+  {
71
+    return $data;
72
+  }
73
+}

+ 121
- 0
app/DataTables/UserDataTable.php Voir le fichier

@@ -0,0 +1,121 @@
1
+<?php
2
+
3
+namespace App\DataTables;
4
+
5
+use Yajra\DataTables\Services\DataTable;
6
+use Yajra\DataTables\Html\Button;
7
+use Yajra\DataTables\Html\Column;
8
+use Yajra\DataTables\Html\Editor\Editor;
9
+use Yajra\DataTables\Html\Editor\Fields;
10
+use App\Models\User;
11
+use Auth;
12
+use Form;
13
+
14
+class UserDataTable extends DataTable
15
+{
16
+  public function __construct(){
17
+    $this->dataTableVariable = 'dataTable_user';
18
+  }
19
+
20
+  /**
21
+  * Build DataTable class.
22
+  *
23
+  * @param mixed $query Results from query() method.
24
+  * @return \Yajra\DataTables\DataTableAbstract
25
+  */
26
+  public function dataTable($query)
27
+  {
28
+    return datatables()
29
+    ->eloquent($query)
30
+    ->setRowId('id')
31
+    ->addColumn('action', function($entity){
32
+      return view('user.menu', ['entity' => $entity]);
33
+    })
34
+    ->rawColumns(['action']);
35
+  }
36
+
37
+
38
+  /**
39
+  * Get query source of dataTable.
40
+  *
41
+  * @param \App\Models\User $model
42
+  * @return \Illuminate\Database\Eloquent\Builder
43
+  */
44
+  public function query(User $model)
45
+  {
46
+    return $model->newQuery();
47
+  }
48
+
49
+  /**
50
+  * Optional method if you want to use html builder.
51
+  *
52
+  * @return \Yajra\DataTables\Html\Builder
53
+  */
54
+  public function html()
55
+  {
56
+    $buttons = [];
57
+    if(Auth::user()->can('create-users')){
58
+      array_push(
59
+        $buttons,
60
+        Button::make('create')
61
+        ->editor('editor')
62
+        ->className('btn btn-sm btn-primary')
63
+        ->text('<i class="fas fa-plus"></i> Nuovo utente')
64
+        ->formTitle('Nuovo utente')
65
+        ->formButtons(
66
+          [Button::raw('Annulla')
67
+          ->className('btn btn-secondary ml-2')
68
+          ->actionClose(),
69
+          Button::raw('Salva')
70
+          ->className('btn btn-success ml-2')
71
+          ->actionHandler('create')
72
+        ])
73
+      );
74
+    }
75
+
76
+    return $this->builder()
77
+    ->setTableId($this->dataTableVariable)
78
+    ->columns($this->getColumns())
79
+    ->minifiedAjax()
80
+    ->language(asset('plugins/datatables/Italian.json'))
81
+    // ->select()
82
+    ->dom('Brtip')
83
+    ->orderBy(1, 'asc')
84
+    ->buttons($buttons)
85
+    ->editor(
86
+      Editor::make()
87
+      ->fields([
88
+        Fields\Text::make('nome', 'Nome'),
89
+        Fields\Text::make('cognome', 'Cognome'),
90
+        Fields\Text::make('email', 'Email'),
91
+        Fields\Password::make('password_new', 'Password (lasciare vuoto per non modificare)'),
92
+        Fields\Password::make('password_new_confirmation', 'Conferma password')
93
+      ])
94
+      ->on('submitComplete', "function( e, mode, action ){}"
95
+        )
96
+      )->initComplete("function(settings, json){
97
+        initComplete();
98
+      }");
99
+    }
100
+
101
+    /**
102
+    * Get columns.
103
+    *
104
+    * @return array
105
+    */
106
+    protected function getColumns()
107
+    {
108
+      return [
109
+        Column::make('id')->title('ID')->width('10%')->visible(false),
110
+        Column::make('nome')->title('Nome'),
111
+        Column::make('cognome')->title('Cognome'),
112
+        Column::make('email')->title('Email'),
113
+        Column::computed('action')
114
+        ->exportable(false)
115
+        ->printable(false)
116
+        ->title(' ')
117
+        ->addClass('text-right'),
118
+      ];
119
+    }
120
+
121
+  }

+ 69
- 0
app/DataTables/UserDataTableEditor.php Voir le fichier

@@ -0,0 +1,69 @@
1
+<?php
2
+
3
+namespace App\DataTables;
4
+
5
+use App\Models\User;
6
+use Illuminate\Database\Eloquent\Model;
7
+use Illuminate\Validation\Rule;
8
+use Yajra\DataTables\DataTablesEditor;
9
+use Hash;
10
+
11
+class UserDataTableEditor extends DataTablesEditor
12
+{
13
+  protected $model = User::class;
14
+
15
+  /**
16
+  * Get create action validation rules.
17
+  *
18
+  * @return array
19
+  */
20
+  public function createRules()
21
+  {
22
+    return [
23
+      'nome'  => 'required',
24
+      'email' => 'required|email|unique:users,email'
25
+    ];
26
+  }
27
+
28
+  /**
29
+  * Get edit action validation rules.
30
+  *
31
+  * @param Model $model
32
+  * @return array
33
+  */
34
+  public function editRules(Model $model)
35
+  {
36
+    return [
37
+      'nome'  => 'required',
38
+      'email' => 'required|email|unique:users,email,'.$model->id,
39
+      'password_new' => 'nullable|confirmed|min:6'
40
+    ];
41
+  }
42
+
43
+  /**
44
+  * Get remove action validation rules.
45
+  *
46
+  * @param Model $model
47
+  * @return array
48
+  */
49
+  public function removeRules(Model $model)
50
+  {
51
+    return [];
52
+  }
53
+
54
+  public function creating(Model $model, array $data)
55
+  {
56
+    $data['password'] = Hash::make($data['password_new']);
57
+    return $data;
58
+  }
59
+
60
+  public function updating(Model $model, array $data)
61
+  {
62
+    //reset password
63
+    if($data['password_new'] != null && $data['password_new'] != ''){
64
+      $data['password'] = Hash::make($data['password_new']);
65
+    }
66
+
67
+    return $data;
68
+  }
69
+}

+ 41
- 0
app/Exceptions/Handler.php Voir le fichier

@@ -0,0 +1,41 @@
1
+<?php
2
+
3
+namespace App\Exceptions;
4
+
5
+use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
6
+use Throwable;
7
+
8
+class Handler extends ExceptionHandler
9
+{
10
+    /**
11
+     * A list of the exception types that are not reported.
12
+     *
13
+     * @var array<int, class-string<Throwable>>
14
+     */
15
+    protected $dontReport = [
16
+        //
17
+    ];
18
+
19
+    /**
20
+     * A list of the inputs that are never flashed for validation exceptions.
21
+     *
22
+     * @var array<int, string>
23
+     */
24
+    protected $dontFlash = [
25
+        'current_password',
26
+        'password',
27
+        'password_confirmation',
28
+    ];
29
+
30
+    /**
31
+     * Register the exception handling callbacks for the application.
32
+     *
33
+     * @return void
34
+     */
35
+    public function register()
36
+    {
37
+        $this->reportable(function (Throwable $e) {
38
+            //
39
+        });
40
+    }
41
+}

+ 63
- 0
app/Http/Controllers/Auth/AuthenticatedSessionController.php Voir le fichier

@@ -0,0 +1,63 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers\Auth;
4
+
5
+use App\Http\Controllers\Controller;
6
+use App\Http\Requests\Auth\LoginRequest;
7
+use App\Providers\RouteServiceProvider;
8
+use Illuminate\Http\Request;
9
+use Illuminate\Support\Facades\Auth;
10
+use Illuminate\Support\Facades\Http;
11
+
12
+class AuthenticatedSessionController extends Controller
13
+{
14
+  /**
15
+  * Display the login view.
16
+  *
17
+  * @return \Illuminate\View\View
18
+  */
19
+  public function create()
20
+  {
21
+    return view('auth.login');
22
+  }
23
+
24
+  /**
25
+  * Handle an incoming authentication request.
26
+  *
27
+  * @param  \App\Http\Requests\Auth\LoginRequest  $request
28
+  * @return \Illuminate\Http\RedirectResponse
29
+  */
30
+  public function store(LoginRequest $request)
31
+  {
32
+    $request->authenticate();
33
+
34
+    $request->session()->regenerate();
35
+
36
+    try{
37
+      $response = Http::get("https://".config('redmine.user').":".config('redmine.password')."@".config('redmine.url').'/my/account.json');
38
+      $redmineUser = $response->object()->user;
39
+      $request->session()->put('redmine_user', $redmineUser);
40
+    }catch(\Exception $e){
41
+      $request->session()->put('redmine_user', null);
42
+    }
43
+
44
+    return redirect()->intended(RouteServiceProvider::HOME);
45
+  }
46
+
47
+  /**
48
+  * Destroy an authenticated session.
49
+  *
50
+  * @param  \Illuminate\Http\Request  $request
51
+  * @return \Illuminate\Http\RedirectResponse
52
+  */
53
+  public function destroy(Request $request)
54
+  {
55
+    Auth::guard('web')->logout();
56
+
57
+    $request->session()->invalidate();
58
+
59
+    $request->session()->regenerateToken();
60
+
61
+    return redirect('/');
62
+  }
63
+}

+ 44
- 0
app/Http/Controllers/Auth/ConfirmablePasswordController.php Voir le fichier

@@ -0,0 +1,44 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers\Auth;
4
+
5
+use App\Http\Controllers\Controller;
6
+use App\Providers\RouteServiceProvider;
7
+use Illuminate\Http\Request;
8
+use Illuminate\Support\Facades\Auth;
9
+use Illuminate\Validation\ValidationException;
10
+
11
+class ConfirmablePasswordController extends Controller
12
+{
13
+    /**
14
+     * Show the confirm password view.
15
+     *
16
+     * @return \Illuminate\View\View
17
+     */
18
+    public function show()
19
+    {
20
+        return view('auth.confirm-password');
21
+    }
22
+
23
+    /**
24
+     * Confirm the user's password.
25
+     *
26
+     * @param  \Illuminate\Http\Request  $request
27
+     * @return mixed
28
+     */
29
+    public function store(Request $request)
30
+    {
31
+        if (! Auth::guard('web')->validate([
32
+            'email' => $request->user()->email,
33
+            'password' => $request->password,
34
+        ])) {
35
+            throw ValidationException::withMessages([
36
+                'password' => __('auth.password'),
37
+            ]);
38
+        }
39
+
40
+        $request->session()->put('auth.password_confirmed_at', time());
41
+
42
+        return redirect()->intended(RouteServiceProvider::HOME);
43
+    }
44
+}

+ 27
- 0
app/Http/Controllers/Auth/EmailVerificationNotificationController.php Voir le fichier

@@ -0,0 +1,27 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers\Auth;
4
+
5
+use App\Http\Controllers\Controller;
6
+use App\Providers\RouteServiceProvider;
7
+use Illuminate\Http\Request;
8
+
9
+class EmailVerificationNotificationController extends Controller
10
+{
11
+    /**
12
+     * Send a new email verification notification.
13
+     *
14
+     * @param  \Illuminate\Http\Request  $request
15
+     * @return \Illuminate\Http\RedirectResponse
16
+     */
17
+    public function store(Request $request)
18
+    {
19
+        if ($request->user()->hasVerifiedEmail()) {
20
+            return redirect()->intended(RouteServiceProvider::HOME);
21
+        }
22
+
23
+        $request->user()->sendEmailVerificationNotification();
24
+
25
+        return back()->with('status', 'verification-link-sent');
26
+    }
27
+}

+ 23
- 0
app/Http/Controllers/Auth/EmailVerificationPromptController.php Voir le fichier

@@ -0,0 +1,23 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers\Auth;
4
+
5
+use App\Http\Controllers\Controller;
6
+use App\Providers\RouteServiceProvider;
7
+use Illuminate\Http\Request;
8
+
9
+class EmailVerificationPromptController extends Controller
10
+{
11
+    /**
12
+     * Display the email verification prompt.
13
+     *
14
+     * @param  \Illuminate\Http\Request  $request
15
+     * @return mixed
16
+     */
17
+    public function __invoke(Request $request)
18
+    {
19
+        return $request->user()->hasVerifiedEmail()
20
+                    ? redirect()->intended(RouteServiceProvider::HOME)
21
+                    : view('auth.verify-email');
22
+    }
23
+}

+ 65
- 0
app/Http/Controllers/Auth/NewPasswordController.php Voir le fichier

@@ -0,0 +1,65 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers\Auth;
4
+
5
+use App\Http\Controllers\Controller;
6
+use Illuminate\Auth\Events\PasswordReset;
7
+use Illuminate\Http\Request;
8
+use Illuminate\Support\Facades\Hash;
9
+use Illuminate\Support\Facades\Password;
10
+use Illuminate\Support\Str;
11
+use Illuminate\Validation\Rules;
12
+
13
+class NewPasswordController extends Controller
14
+{
15
+    /**
16
+     * Display the password reset view.
17
+     *
18
+     * @param  \Illuminate\Http\Request  $request
19
+     * @return \Illuminate\View\View
20
+     */
21
+    public function create(Request $request)
22
+    {
23
+        return view('auth.reset-password', ['request' => $request]);
24
+    }
25
+
26
+    /**
27
+     * Handle an incoming new password request.
28
+     *
29
+     * @param  \Illuminate\Http\Request  $request
30
+     * @return \Illuminate\Http\RedirectResponse
31
+     *
32
+     * @throws \Illuminate\Validation\ValidationException
33
+     */
34
+    public function store(Request $request)
35
+    {
36
+        $request->validate([
37
+            'token' => ['required'],
38
+            'email' => ['required', 'email'],
39
+            'password' => ['required', 'confirmed', Rules\Password::defaults()],
40
+        ]);
41
+
42
+        // Here we will attempt to reset the user's password. If it is successful we
43
+        // will update the password on an actual user model and persist it to the
44
+        // database. Otherwise we will parse the error and return the response.
45
+        $status = Password::reset(
46
+            $request->only('email', 'password', 'password_confirmation', 'token'),
47
+            function ($user) use ($request) {
48
+                $user->forceFill([
49
+                    'password' => Hash::make($request->password),
50
+                    'remember_token' => Str::random(60),
51
+                ])->save();
52
+
53
+                event(new PasswordReset($user));
54
+            }
55
+        );
56
+
57
+        // If the password was successfully reset, we will redirect the user back to
58
+        // the application's home authenticated view. If there is an error we can
59
+        // redirect them back to where they came from with their error message.
60
+        return $status == Password::PASSWORD_RESET
61
+                    ? redirect()->route('login')->with('status', __($status))
62
+                    : back()->withInput($request->only('email'))
63
+                            ->withErrors(['email' => __($status)]);
64
+    }
65
+}

+ 47
- 0
app/Http/Controllers/Auth/PasswordResetLinkController.php Voir le fichier

@@ -0,0 +1,47 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers\Auth;
4
+
5
+use App\Http\Controllers\Controller;
6
+use Illuminate\Http\Request;
7
+use Illuminate\Support\Facades\Password;
8
+
9
+class PasswordResetLinkController extends Controller
10
+{
11
+    /**
12
+     * Display the password reset link request view.
13
+     *
14
+     * @return \Illuminate\View\View
15
+     */
16
+    public function create()
17
+    {
18
+        return view('auth.forgot-password');
19
+    }
20
+
21
+    /**
22
+     * Handle an incoming password reset link request.
23
+     *
24
+     * @param  \Illuminate\Http\Request  $request
25
+     * @return \Illuminate\Http\RedirectResponse
26
+     *
27
+     * @throws \Illuminate\Validation\ValidationException
28
+     */
29
+    public function store(Request $request)
30
+    {
31
+        $request->validate([
32
+            'email' => ['required', 'email'],
33
+        ]);
34
+
35
+        // We will send the password reset link to this user. Once we have attempted
36
+        // to send the link, we will examine the response then see the message we
37
+        // need to show to the user. Finally, we'll send out a proper response.
38
+        $status = Password::sendResetLink(
39
+            $request->only('email')
40
+        );
41
+
42
+        return $status == Password::RESET_LINK_SENT
43
+                    ? back()->with('status', __($status))
44
+                    : back()->withInput($request->only('email'))
45
+                            ->withErrors(['email' => __($status)]);
46
+    }
47
+}

+ 54
- 0
app/Http/Controllers/Auth/RegisteredUserController.php Voir le fichier

@@ -0,0 +1,54 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers\Auth;
4
+
5
+use App\Http\Controllers\Controller;
6
+use App\Models\User;
7
+use App\Providers\RouteServiceProvider;
8
+use Illuminate\Auth\Events\Registered;
9
+use Illuminate\Http\Request;
10
+use Illuminate\Support\Facades\Auth;
11
+use Illuminate\Support\Facades\Hash;
12
+use Illuminate\Validation\Rules;
13
+
14
+class RegisteredUserController extends Controller
15
+{
16
+    /**
17
+     * Display the registration view.
18
+     *
19
+     * @return \Illuminate\View\View
20
+     */
21
+    public function create()
22
+    {
23
+        return view('auth.register');
24
+    }
25
+
26
+    /**
27
+     * Handle an incoming registration request.
28
+     *
29
+     * @param  \Illuminate\Http\Request  $request
30
+     * @return \Illuminate\Http\RedirectResponse
31
+     *
32
+     * @throws \Illuminate\Validation\ValidationException
33
+     */
34
+    public function store(Request $request)
35
+    {
36
+        $request->validate([
37
+            'name' => ['required', 'string', 'max:255'],
38
+            'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
39
+            'password' => ['required', 'confirmed', Rules\Password::defaults()],
40
+        ]);
41
+
42
+        $user = User::create([
43
+            'name' => $request->name,
44
+            'email' => $request->email,
45
+            'password' => Hash::make($request->password),
46
+        ]);
47
+
48
+        event(new Registered($user));
49
+
50
+        Auth::login($user);
51
+
52
+        return redirect(RouteServiceProvider::HOME);
53
+    }
54
+}

+ 30
- 0
app/Http/Controllers/Auth/VerifyEmailController.php Voir le fichier

@@ -0,0 +1,30 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers\Auth;
4
+
5
+use App\Http\Controllers\Controller;
6
+use App\Providers\RouteServiceProvider;
7
+use Illuminate\Auth\Events\Verified;
8
+use Illuminate\Foundation\Auth\EmailVerificationRequest;
9
+
10
+class VerifyEmailController extends Controller
11
+{
12
+    /**
13
+     * Mark the authenticated user's email address as verified.
14
+     *
15
+     * @param  \Illuminate\Foundation\Auth\EmailVerificationRequest  $request
16
+     * @return \Illuminate\Http\RedirectResponse
17
+     */
18
+    public function __invoke(EmailVerificationRequest $request)
19
+    {
20
+        if ($request->user()->hasVerifiedEmail()) {
21
+            return redirect()->intended(RouteServiceProvider::HOME.'?verified=1');
22
+        }
23
+
24
+        if ($request->user()->markEmailAsVerified()) {
25
+            event(new Verified($request->user()));
26
+        }
27
+
28
+        return redirect()->intended(RouteServiceProvider::HOME.'?verified=1');
29
+    }
30
+}

+ 69
- 0
app/Http/Controllers/ConfigController.php Voir le fichier

@@ -0,0 +1,69 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers;
4
+
5
+use Illuminate\Http\Request;
6
+use App\Models\Config;
7
+use App\Models\User;
8
+use Session;
9
+
10
+class ConfigController extends Controller
11
+{
12
+  public static $permission_group = "Configurazione";
13
+  public static $permissions = [
14
+    'view-configurazione' => 'Vedi e modifica la configurazione',
15
+  ];
16
+
17
+  public function __construct()
18
+  {
19
+    $this->middleware('permission:view-configurazione')->only(['index', 'save']);
20
+  }
21
+
22
+  function index(){
23
+    return view('config.index');
24
+  }
25
+
26
+  public function save(Request $request){
27
+    $input = $request->all();
28
+    // $index = 0;
29
+    $index_file = 0;
30
+
31
+    foreach($input['key'] as $key => $value){
32
+      $config = Config::find($value);
33
+      switch ($config->type) {
34
+        case 'file':
35
+        $file = $request->file('value');
36
+        if($file != null && array_key_exists($key, $file)){
37
+          $filename = $file[$key]->storeAs('public', $file[$key]->getClientOriginalName());
38
+          $config->value = $filename;
39
+          $index_file++;
40
+        }
41
+        break;
42
+
43
+        case 'array_status':
44
+        $config->value = json_encode($request->value[$key]);
45
+        break;
46
+
47
+        case 'users':
48
+        $config->value = json_encode($request->value[$key]);
49
+        break;
50
+
51
+        case 'password':
52
+        if($request->value[$key] != null && $request->value[$key] != ''){
53
+            $config->value = $request->value[$key];
54
+        }
55
+        break;
56
+
57
+        default:
58
+        $config->value = $request->value[$key];
59
+        // $index++;
60
+        break;
61
+      }
62
+      $config->save();
63
+    }
64
+
65
+    Session::flash('flash_message', 'Configurazione aggiornata');
66
+    return redirect()->route('config.index');
67
+  }
68
+
69
+}

+ 13
- 0
app/Http/Controllers/Controller.php Voir le fichier

@@ -0,0 +1,13 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers;
4
+
5
+use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
6
+use Illuminate\Foundation\Bus\DispatchesJobs;
7
+use Illuminate\Foundation\Validation\ValidatesRequests;
8
+use Illuminate\Routing\Controller as BaseController;
9
+
10
+class Controller extends BaseController
11
+{
12
+    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
13
+}

+ 276
- 0
app/Http/Controllers/IssueController.php Voir le fichier

@@ -0,0 +1,276 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers;
4
+
5
+use Illuminate\Http\Request;
6
+use Yajra\DataTables\DataTables;
7
+use Illuminate\Support\Facades\Http;
8
+use Illuminate\Support\Collection;
9
+use Illuminate\Support\Facades\Log;
10
+// use App\DataTables\ContabilitaDataTableEditor;
11
+use App\DataTables\IssueDataTable;
12
+use App\Models\Issue;
13
+use App\Models\User;
14
+use Carbon\Carbon;
15
+use Auth;
16
+use Storage;
17
+use Session;
18
+
19
+class IssueController extends Controller
20
+{
21
+  public $messages = [
22
+    'subject.required' => "Devi indicare l'oggetto",
23
+    'referente.required' => "Devi indicare il referente",
24
+    'telefono.required' => "Devi indicare il telefono",
25
+    'description.required' => "Devi inserire una descrizione della problematica",
26
+    'accetto_condizioni.accepted' => 'Devi accettare le condizioni',
27
+  ];
28
+
29
+
30
+  public function index(IssueDataTable $dataTable){
31
+    $collection = Issue::getCollection();
32
+
33
+    return $dataTable->with(['issues' => $collection])->render('issue.index');
34
+  }
35
+
36
+  public function show($id = null, Request $request){
37
+    $redmineUser = session('redmine_user');
38
+
39
+
40
+    $response_issue = Http::get(config('redmine.url').'/issues/'.$id.'.json?include=attachments,relations,journals', [
41
+      'key' => $redmineUser->api_key,
42
+      'include' => 'journals,attachments,relations'
43
+    ]);
44
+
45
+
46
+    $response_helpesk = Http::get(config('redmine.url').'/helpdesk_tickets/'.$id.'.json', [
47
+      'key' => $redmineUser->api_key,
48
+    ]);
49
+
50
+
51
+    if($response_issue->ok()){
52
+      $issue = $response_issue->object()->issue;
53
+
54
+      $helpdesk = $response_helpesk->object()->helpdesk_ticket;
55
+
56
+      // Controllo che l'issue sia di uno dei progetti abilitati
57
+      if(!in_array($issue->project->id, json_decode(Auth::user()->progetti))){
58
+        return redirect()->route('dashboard');
59
+      }
60
+
61
+      try{
62
+        $author = $helpdesk->contact->name." (".$helpdesk->from_address.")";
63
+      }catch(\Exception $e){
64
+        $author = $issue->author->name;
65
+      }
66
+
67
+
68
+      return view('issue.show')->with(['issue' => $issue, 'author' => $author]);
69
+    }else{
70
+      Session::flash('flash_message', "Errore generico");
71
+      return redirect()->route('dashboard');
72
+    }
73
+  }
74
+
75
+  // public function firma($id){
76
+  //   $redmineUser = session('redmine_user');
77
+  //
78
+  //   // Issue details
79
+  //   $response_issue = Http::get(session('azienda')->redmine_url.'/issues/'.$id.'.json?include=attachments,relations', [
80
+  //     'key' => $redmineUser->api_key,
81
+  //   ]);
82
+  //   $issue = $response_issue->object()->issue;
83
+  //
84
+  //   // Activity
85
+  //   $response = Http::get(session('azienda')->redmine_url.'/enumerations/time_entry_activities.json', [
86
+  //     'key' => $redmineUser->api_key,
87
+  //   ]);
88
+  //
89
+  //   $attivita = array();
90
+  //   foreach($response->object()->time_entry_activities as $time_entry_activities){
91
+  //     if(!$time_entry_activities->active) continue;
92
+  //     $attivita[$time_entry_activities->id] = $time_entry_activities->name;
93
+  //   }
94
+  //
95
+  //   // issueStatus
96
+  //   $issueStatus = Issue::getStati();
97
+  //   // $response = Http::get(session('azienda')->redmine_url.'/issue_statuses.json', [
98
+  //   //   'key' => $redmineUser->api_key,
99
+  //   // ]);
100
+  //   //
101
+  //   // foreach($response->object()->issue_statuses as $issue_status){
102
+  //   //   $issueStatus[$issue_status->id] = $issue_status->name;
103
+  //   // }
104
+  //
105
+  //   // Altri tecnici
106
+  //   $response = Http::get(session('azienda')->redmine_url.'/projects/'.$issue->project->id.'/memberships.json', [
107
+  //     'key' => $redmineUser->api_key,
108
+  //   ]);
109
+  //
110
+  //   $memberships = $response->object()->memberships;
111
+  //   $altriTecnici = array();
112
+  //
113
+  //   try{
114
+  //     foreach($memberships as $membership){
115
+  //       if($membership->user->id == $redmineUser->id) continue; // Scarto il tecnico attualmente loggato
116
+  //       $altriTecnici[$membership->user->id] = $membership->user->name;
117
+  //     }
118
+  //   }catch(\Exception $e){
119
+  //   }
120
+  //
121
+  //   // Altre segnalazioni dello stesso progetto, da associare come sottoattività
122
+  //   $altreSegnalazioni = Http::get(session('azienda')->redmine_url.'/issues.json', [
123
+  //     'key' => $redmineUser->api_key,
124
+  //     'project_id' => $issue->project->id
125
+  //   ]);
126
+  //
127
+  //   $collectionAltreSegnalazioni = new Collection();
128
+  //
129
+  //   foreach($altreSegnalazioni->object()->issues as $issue){
130
+  //     $collectionAltreSegnalazioni->push($issue);
131
+  //   }
132
+  //
133
+  //   // foreach($collectionAltreSegnalazioni as $t){
134
+  //   //   dd($t->status);
135
+  //   // }
136
+  //
137
+  //   $user = User::where('redmine_id', $redmineUser->id)->first();
138
+  //
139
+  //
140
+  //   return view('issue.firma')->with([
141
+  //     'issue' => $issue,
142
+  //     'attivita' => $attivita,
143
+  //     'issueStatus' => $issueStatus,
144
+  //     'altriTecnici' => $altriTecnici,
145
+  //     'altreSegnalazioni' => $collectionAltreSegnalazioni,
146
+  //     'user' => $user
147
+  //   ]);
148
+  // }
149
+
150
+  // public function success(Request $request){
151
+  //   $success_issue_id = session('success_issue_id');
152
+  //   if($success_issue_id != null){
153
+  //     $request->session()->forget('success_issue_id');
154
+  //     return view('issue.success')->with(['issue_id' => $success_issue_id]);
155
+  //   }else{
156
+  //     return redirect()->route('home');
157
+  //   }
158
+  // }
159
+
160
+  public function download(Request $request, $id){
161
+    $redmineUser = session('redmine_user');
162
+    $tempImage = tempnam(sys_get_temp_dir(), $request->filename);
163
+    copy("https://".config('redmine.url')."/attachments/download/".$id."/".$request->filename."?key=".$redmineUser->api_key, $tempImage);
164
+
165
+    return response()->download($tempImage, $request->filename)->deleteFileAfterSend();
166
+  }
167
+
168
+  public function nuovo(){
169
+    return view('issue.nuovo');
170
+  }
171
+
172
+  public function crea(Request $request){
173
+    $rules = [
174
+      'subject' => 'required|string|max:255',
175
+      'referente' => 'required|string|max:255',
176
+      'telefono' => 'required|string|max:255',
177
+      'description' => 'required',
178
+      'accetto_condizioni' =>'accepted'
179
+    ];
180
+
181
+    $request->validate($rules, $this->messages);
182
+
183
+    $redmineUser = session('redmine_user');
184
+    $uploads = array();
185
+
186
+    // Upload degli allegati
187
+    if($request->hasFile('allegato')){
188
+      // foreach($request->allegato as $allegato){
189
+      $exploded = explode(".", $request->allegato->getClientOriginalName());
190
+      $originalFilename = "";
191
+      if(count($exploded) > 1){
192
+        $index = count($exploded) - 2;
193
+        $exploded[count($exploded)-1] = ".".$request->allegato->extension();
194
+      }else{
195
+        $index = 0;
196
+      }
197
+      $exploded[$index] .= '_'.time();
198
+
199
+      $originalFilename = implode($exploded);
200
+
201
+      $response = Http::withHeaders([
202
+        'content-type' => 'application/octet-stream'
203
+      ])
204
+      ->withBody($request->allegato->get(), $request->allegato->getMimeType())
205
+      ->post("https://".$redmineUser->api_key."@".config('redmine.url').'/uploads.json', [
206
+        'filename' => $originalFilename
207
+      ]);
208
+
209
+      $uploadToken = $response->object()->upload->token;
210
+      $uploads[] = [
211
+        'token' => $uploadToken,
212
+        'filename' => $originalFilename,
213
+        'description' => $originalFilename,
214
+        'content_type' => $request->allegato->getMimeType()
215
+      ];
216
+
217
+      // }
218
+    }
219
+
220
+    $response = Http::get("https://".config('redmine.url').'/contacts.xml', [
221
+      'key' => $redmineUser->api_key,
222
+      'search' => Auth::user()->email
223
+    ]);
224
+
225
+    try{
226
+      $string = $response->body();
227
+      $xml = simplexml_load_string($string);
228
+      $contact_id = intval($xml->contact->id);
229
+    }catch(\Error $e){
230
+      $contact_id = null;
231
+    }
232
+
233
+    if($contact_id == null){
234
+      // creo il contatto
235
+      $response = Http::post("https://".config('redmine.url').'/contacts.xml', [
236
+        'key' => $redmineUser->api_key,
237
+        'contact' => [
238
+          'project_id' => $request->project_id,
239
+          'email' => Auth::user()->email,
240
+          'first_name' => Auth::user()->nome,
241
+          'last_name' => Auth::user()->cognome,
242
+        ]
243
+      ]);
244
+
245
+      $string = $response->body();
246
+      $xml = simplexml_load_string($string);
247
+      $contact_id = intval($xml->id);
248
+    }
249
+
250
+    $descrizione = "Tipologia di richiesta: ".$request->tipo_richiesta."\n";
251
+    $descrizione .= "Referente per la problematica: ".$request->referente."\n";
252
+    $descrizione .= "Telefono: ".$request->telefono."\n\n";
253
+    $descrizione .= "Descrizione problema: ".$request->description;
254
+
255
+
256
+    $response = Http::acceptJson()->post("https://".config('redmine.url').'/issues.xml', [
257
+      'key' => $redmineUser->api_key,
258
+      'customer_address' => $contact_id,
259
+      'customer_id' => $contact_id,
260
+      'issue' => [
261
+        'project_id' => $request->project_id,
262
+        'subject' => $request->subject,
263
+        'description' => $descrizione,
264
+        'uploads' => $uploads,
265
+      ],
266
+    ]);
267
+
268
+    $response->throw(function ($response, $e) {
269
+      Session::flash('flash_message', "Errore nell'update dell'issue");
270
+      return redirect()->route('dashboard');
271
+    });
272
+
273
+    Session::flash('flash_message', "Grazie, abbiamo ricevuto la tua segnalazione!");
274
+    return redirect()->route('dashboard');
275
+  }
276
+}

+ 25
- 0
app/Http/Controllers/PermissionController.php Voir le fichier

@@ -0,0 +1,25 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers;
4
+
5
+use Illuminate\Http\Request;
6
+use Session;
7
+use Storage;
8
+use Auth;
9
+use Yajra\DataTables\DataTables;
10
+use App\Models\Permission;
11
+use App\Models\Role;
12
+
13
+class PermissionController extends Controller
14
+{
15
+
16
+  public function index(Request $request)
17
+  {
18
+    $input = $request->all();
19
+    if($request->has('role_id')){
20
+      $role = Role::find($input['role_id']);
21
+      return view('permission.index', ['role' => $role]);
22
+    }
23
+  }
24
+
25
+}

+ 93
- 0
app/Http/Controllers/RoleController.php Voir le fichier

@@ -0,0 +1,93 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers;
4
+
5
+use Illuminate\Http\Request;
6
+use App\Models\Role;
7
+use App\Models\Permission;
8
+use Yajra\DataTables\DataTables;
9
+use App\DataTables\RoleDataTableEditor;
10
+use App\DataTables\RoleDataTable;
11
+use App\Models\User;
12
+use Session;
13
+use Auth;
14
+
15
+class RoleController extends Controller
16
+{
17
+  public static $permission_group = "Ruoli e permessi";
18
+  public static $permissions = [
19
+    'create-roles-permissions' => 'Permetti di modificare i ruoli/permessi',
20
+    'edit-roles-permissions' => 'Permetti di modificare i ruoli/permessi',
21
+  ];
22
+
23
+  public function __construct(){
24
+    $this->middleware('permission:edit-roles-permissions')->only(['index']);
25
+  }
26
+
27
+  public function index(RoleDataTable $dataTable)
28
+  {
29
+    return $dataTable->render('role.index');
30
+  }
31
+
32
+  public function store(RoleDataTableEditor $editor)
33
+  {
34
+    $request = request();
35
+    $input = $request->all();
36
+
37
+    if($request->has('action')){
38
+      switch($input['action']){
39
+        case 'create':
40
+        if(!Auth::user()->can('create-roles-permissions')) return;
41
+        break;
42
+
43
+        case 'edit':
44
+        if(!Auth::user()->can('edit-roles-permissions')) return;
45
+        break;
46
+
47
+        case 'remove':
48
+        if(!Auth::user()->can('edit-roles-permissions')) return;
49
+        break;
50
+      }
51
+    }
52
+
53
+
54
+    return $editor->process(request());
55
+  }
56
+
57
+  public function updatePermission(Request $request){
58
+    $input = $request->all();
59
+    $permissions = [];
60
+    $role = Role::find($input['role_id']);
61
+
62
+    if($request->has('permesso')){
63
+      foreach($input['permesso'] as $key => $value){
64
+        $p = Permission::find($value);
65
+        if($p != null){
66
+          array_push($permissions, $p->name);
67
+        }
68
+      }
69
+
70
+      $role->syncPermissions($permissions);
71
+    }
72
+
73
+    Session::flash('flash_message', 'Permessi aggiornati!');
74
+    return redirect()->route('roles.index');
75
+  }
76
+
77
+  public function role_user(Request $request)
78
+  {
79
+    $input = $request->all();
80
+    if($request->has('role_id')){
81
+      $role = Role::find($input['role_id']);
82
+      return view('role.user', ['role' => $role]);
83
+    }
84
+  }
85
+
86
+  public function rimuovi_utente(Request $request){
87
+    $input = $request->all();
88
+    $role = Role::find($input['role_id']);
89
+    $user = User::find($input['user_id']);
90
+
91
+    $user->removeRole($role->name);
92
+  }
93
+}

+ 130
- 0
app/Http/Controllers/UserController.php Voir le fichier

@@ -0,0 +1,130 @@
1
+<?php
2
+
3
+namespace App\Http\Controllers;
4
+
5
+use Illuminate\Http\Request;
6
+use App\Models\User;
7
+use App\Models\Role;
8
+use App\Models\Permission;
9
+use Yajra\DataTables\DataTables;
10
+use App\DataTables\UserDataTableEditor;
11
+use App\DataTables\UserDataTable;
12
+use Illuminate\Support\Facades\Http;
13
+use Illuminate\Support\Collection;
14
+use Session;
15
+use Auth;
16
+
17
+class UserController extends Controller
18
+{
19
+  public static $permission_group = "Utenti";
20
+  public static $permissions = [
21
+    'view-users' => 'Permetti di vedere la pagina',
22
+    'create-users' => 'Permetti la creazione',
23
+    'edit-users' => 'Permetti la modifica',
24
+    'remove-users' => 'Permetti la cancellazione',
25
+    'edit-role_user' => 'Permetti la modifica di ruoli e permessi degli utenti'
26
+  ];
27
+
28
+  public function __construct(){
29
+    $this->middleware('permission:view-users')->only(['index', 'load_progetti']);
30
+    $this->middleware('permission:create-users|edit-users|remove-users')->only(['store', 'update_progetti']);
31
+  }
32
+
33
+  public function index(UserDataTable $dataTable)
34
+  {
35
+    return $dataTable->render('user.index');
36
+  }
37
+
38
+  public function store(UserDataTableEditor $editor)
39
+  {
40
+    $request = request();
41
+    $input = $request->all();
42
+
43
+    if($request->has('action')){
44
+      switch($input['action']){
45
+        case 'create':
46
+        if(!Auth::user()->can('create-users')) return;
47
+        break;
48
+
49
+        case 'edit':
50
+        if(!Auth::user()->can('edit-users')) return;
51
+        break;
52
+
53
+        case 'remove':
54
+        if(!Auth::user()->can('remove-users')) return;
55
+        break;
56
+      }
57
+    }
58
+
59
+
60
+    return $editor->process(request());
61
+  }
62
+
63
+  public function roles(Request $request){
64
+    $input = $request->all();
65
+    if($request->has('user_id')){
66
+      $user = User::find($input['user_id']);
67
+      return view('user.roles', ['user' => $user]);
68
+    }
69
+  }
70
+
71
+  public function updateRole(Request $request){
72
+    $input = $request->all();
73
+
74
+    // Ruoli
75
+    $roles = [];
76
+    $user = User::find($input['user_id']);
77
+
78
+    if($request->has('ruolo')){
79
+      foreach($input['ruolo'] as $key => $value){
80
+        $r = Role::find($value);
81
+        if($r != null){
82
+          array_push($roles, $r->name);
83
+        }
84
+      }
85
+
86
+      $user->syncRoles($roles);
87
+    }
88
+
89
+    // Permessi diretti
90
+    $permissions = [];
91
+
92
+    if($request->has('permesso')){
93
+      foreach($input['permesso'] as $key => $value){
94
+        $p = Permission::find($value);
95
+        if($p != null){
96
+          array_push($permissions, $p->name);
97
+        }
98
+      }
99
+
100
+      $user->syncPermissions($permissions);
101
+    }
102
+
103
+    Session::flash('flash_message', 'Ruoli aggiornati!');
104
+    return redirect()->route('user.index');
105
+  }
106
+
107
+  public function load_progetti(Request $request){
108
+    $redmineUser = session('redmine_user');
109
+    $collection = new Collection();
110
+
111
+    $projectResponse = Http::get(config('redmine.url').'/projects.json', [
112
+      'key' => $redmineUser->api_key
113
+    ]);
114
+
115
+    foreach($projectResponse->object()->projects as $project){
116
+      $collection->push($project);
117
+    }
118
+
119
+    return view('user.progetti')->with(['user' => User::find($request->user_id), 'progetti' => $collection]);
120
+  }
121
+
122
+  public function update_progetti(Request $request){
123
+    $user = User::find($request->user_id);
124
+    $user->progetti = json_encode($request->progetto);
125
+    $user->save();
126
+
127
+    Session::flash('flash_message', 'Progetti aggiornati');
128
+    return redirect()->route('user.index');
129
+  }
130
+}

+ 70
- 0
app/Http/Kernel.php Voir le fichier

@@ -0,0 +1,70 @@
1
+<?php
2
+
3
+namespace App\Http;
4
+
5
+use Illuminate\Foundation\Http\Kernel as HttpKernel;
6
+
7
+class Kernel extends HttpKernel
8
+{
9
+  /**
10
+  * The application's global HTTP middleware stack.
11
+  *
12
+  * These middleware are run during every request to your application.
13
+  *
14
+  * @var array<int, class-string|string>
15
+  */
16
+  protected $middleware = [
17
+    // \App\Http\Middleware\TrustHosts::class,
18
+    \App\Http\Middleware\TrustProxies::class,
19
+    \Fruitcake\Cors\HandleCors::class,
20
+    \App\Http\Middleware\PreventRequestsDuringMaintenance::class,
21
+    \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
22
+    \App\Http\Middleware\TrimStrings::class,
23
+    \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
24
+  ];
25
+
26
+  /**
27
+  * The application's route middleware groups.
28
+  *
29
+  * @var array<string, array<int, class-string|string>>
30
+  */
31
+  protected $middlewareGroups = [
32
+    'web' => [
33
+      \App\Http\Middleware\EncryptCookies::class,
34
+      \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
35
+      \Illuminate\Session\Middleware\StartSession::class,
36
+      // \Illuminate\Session\Middleware\AuthenticateSession::class,
37
+      \Illuminate\View\Middleware\ShareErrorsFromSession::class,
38
+      \App\Http\Middleware\VerifyCsrfToken::class,
39
+      \Illuminate\Routing\Middleware\SubstituteBindings::class,
40
+    ],
41
+
42
+    'api' => [
43
+      // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
44
+      'throttle:api',
45
+      \Illuminate\Routing\Middleware\SubstituteBindings::class,
46
+    ],
47
+  ];
48
+
49
+  /**
50
+  * The application's route middleware.
51
+  *
52
+  * These middleware may be assigned to groups or used individually.
53
+  *
54
+  * @var array<string, class-string|string>
55
+  */
56
+  protected $routeMiddleware = [
57
+    'auth' => \App\Http\Middleware\Authenticate::class,
58
+    'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
59
+    'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
60
+    'can' => \Illuminate\Auth\Middleware\Authorize::class,
61
+    'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
62
+    'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
63
+    'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
64
+    'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
65
+    'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
66
+    'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class,
67
+    'permission' => \Spatie\Permission\Middlewares\PermissionMiddleware::class,
68
+    'role_or_permission' => \Spatie\Permission\Middlewares\RoleOrPermissionMiddleware::class,
69
+  ];
70
+}

+ 21
- 0
app/Http/Middleware/Authenticate.php Voir le fichier

@@ -0,0 +1,21 @@
1
+<?php
2
+
3
+namespace App\Http\Middleware;
4
+
5
+use Illuminate\Auth\Middleware\Authenticate as Middleware;
6
+
7
+class Authenticate extends Middleware
8
+{
9
+    /**
10
+     * Get the path the user should be redirected to when they are not authenticated.
11
+     *
12
+     * @param  \Illuminate\Http\Request  $request
13
+     * @return string|null
14
+     */
15
+    protected function redirectTo($request)
16
+    {
17
+        if (! $request->expectsJson()) {
18
+            return route('login');
19
+        }
20
+    }
21
+}

+ 17
- 0
app/Http/Middleware/EncryptCookies.php Voir le fichier

@@ -0,0 +1,17 @@
1
+<?php
2
+
3
+namespace App\Http\Middleware;
4
+
5
+use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
6
+
7
+class EncryptCookies extends Middleware
8
+{
9
+    /**
10
+     * The names of the cookies that should not be encrypted.
11
+     *
12
+     * @var array<int, string>
13
+     */
14
+    protected $except = [
15
+        //
16
+    ];
17
+}

+ 17
- 0
app/Http/Middleware/PreventRequestsDuringMaintenance.php Voir le fichier

@@ -0,0 +1,17 @@
1
+<?php
2
+
3
+namespace App\Http\Middleware;
4
+
5
+use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
6
+
7
+class PreventRequestsDuringMaintenance extends Middleware
8
+{
9
+    /**
10
+     * The URIs that should be reachable while maintenance mode is enabled.
11
+     *
12
+     * @var array<int, string>
13
+     */
14
+    protected $except = [
15
+        //
16
+    ];
17
+}

+ 32
- 0
app/Http/Middleware/RedirectIfAuthenticated.php Voir le fichier

@@ -0,0 +1,32 @@
1
+<?php
2
+
3
+namespace App\Http\Middleware;
4
+
5
+use App\Providers\RouteServiceProvider;
6
+use Closure;
7
+use Illuminate\Http\Request;
8
+use Illuminate\Support\Facades\Auth;
9
+
10
+class RedirectIfAuthenticated
11
+{
12
+    /**
13
+     * Handle an incoming request.
14
+     *
15
+     * @param  \Illuminate\Http\Request  $request
16
+     * @param  \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse)  $next
17
+     * @param  string|null  ...$guards
18
+     * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
19
+     */
20
+    public function handle(Request $request, Closure $next, ...$guards)
21
+    {
22
+        $guards = empty($guards) ? [null] : $guards;
23
+
24
+        foreach ($guards as $guard) {
25
+            if (Auth::guard($guard)->check()) {
26
+                return redirect(RouteServiceProvider::HOME);
27
+            }
28
+        }
29
+
30
+        return $next($request);
31
+    }
32
+}

+ 19
- 0
app/Http/Middleware/TrimStrings.php Voir le fichier

@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+namespace App\Http\Middleware;
4
+
5
+use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
6
+
7
+class TrimStrings extends Middleware
8
+{
9
+    /**
10
+     * The names of the attributes that should not be trimmed.
11
+     *
12
+     * @var array<int, string>
13
+     */
14
+    protected $except = [
15
+        'current_password',
16
+        'password',
17
+        'password_confirmation',
18
+    ];
19
+}

+ 20
- 0
app/Http/Middleware/TrustHosts.php Voir le fichier

@@ -0,0 +1,20 @@
1
+<?php
2
+
3
+namespace App\Http\Middleware;
4
+
5
+use Illuminate\Http\Middleware\TrustHosts as Middleware;
6
+
7
+class TrustHosts extends Middleware
8
+{
9
+    /**
10
+     * Get the host patterns that should be trusted.
11
+     *
12
+     * @return array<int, string|null>
13
+     */
14
+    public function hosts()
15
+    {
16
+        return [
17
+            $this->allSubdomainsOfApplicationUrl(),
18
+        ];
19
+    }
20
+}

+ 28
- 0
app/Http/Middleware/TrustProxies.php Voir le fichier

@@ -0,0 +1,28 @@
1
+<?php
2
+
3
+namespace App\Http\Middleware;
4
+
5
+use Illuminate\Http\Middleware\TrustProxies as Middleware;
6
+use Illuminate\Http\Request;
7
+
8
+class TrustProxies extends Middleware
9
+{
10
+    /**
11
+     * The trusted proxies for this application.
12
+     *
13
+     * @var array<int, string>|string|null
14
+     */
15
+    protected $proxies;
16
+
17
+    /**
18
+     * The headers that should be used to detect proxies.
19
+     *
20
+     * @var int
21
+     */
22
+    protected $headers =
23
+        Request::HEADER_X_FORWARDED_FOR |
24
+        Request::HEADER_X_FORWARDED_HOST |
25
+        Request::HEADER_X_FORWARDED_PORT |
26
+        Request::HEADER_X_FORWARDED_PROTO |
27
+        Request::HEADER_X_FORWARDED_AWS_ELB;
28
+}

+ 17
- 0
app/Http/Middleware/VerifyCsrfToken.php Voir le fichier

@@ -0,0 +1,17 @@
1
+<?php
2
+
3
+namespace App\Http\Middleware;
4
+
5
+use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
6
+
7
+class VerifyCsrfToken extends Middleware
8
+{
9
+    /**
10
+     * The URIs that should be excluded from CSRF verification.
11
+     *
12
+     * @var array<int, string>
13
+     */
14
+    protected $except = [
15
+        //
16
+    ];
17
+}

+ 93
- 0
app/Http/Requests/Auth/LoginRequest.php Voir le fichier

@@ -0,0 +1,93 @@
1
+<?php
2
+
3
+namespace App\Http\Requests\Auth;
4
+
5
+use Illuminate\Auth\Events\Lockout;
6
+use Illuminate\Foundation\Http\FormRequest;
7
+use Illuminate\Support\Facades\Auth;
8
+use Illuminate\Support\Facades\RateLimiter;
9
+use Illuminate\Support\Str;
10
+use Illuminate\Validation\ValidationException;
11
+
12
+class LoginRequest extends FormRequest
13
+{
14
+    /**
15
+     * Determine if the user is authorized to make this request.
16
+     *
17
+     * @return bool
18
+     */
19
+    public function authorize()
20
+    {
21
+        return true;
22
+    }
23
+
24
+    /**
25
+     * Get the validation rules that apply to the request.
26
+     *
27
+     * @return array
28
+     */
29
+    public function rules()
30
+    {
31
+        return [
32
+            'email' => ['required', 'string', 'email'],
33
+            'password' => ['required', 'string'],
34
+        ];
35
+    }
36
+
37
+    /**
38
+     * Attempt to authenticate the request's credentials.
39
+     *
40
+     * @return void
41
+     *
42
+     * @throws \Illuminate\Validation\ValidationException
43
+     */
44
+    public function authenticate()
45
+    {
46
+        $this->ensureIsNotRateLimited();
47
+
48
+        if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) {
49
+            RateLimiter::hit($this->throttleKey());
50
+
51
+            throw ValidationException::withMessages([
52
+                'email' => trans('auth.failed'),
53
+            ]);
54
+        }
55
+
56
+        RateLimiter::clear($this->throttleKey());
57
+    }
58
+
59
+    /**
60
+     * Ensure the login request is not rate limited.
61
+     *
62
+     * @return void
63
+     *
64
+     * @throws \Illuminate\Validation\ValidationException
65
+     */
66
+    public function ensureIsNotRateLimited()
67
+    {
68
+        if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
69
+            return;
70
+        }
71
+
72
+        event(new Lockout($this));
73
+
74
+        $seconds = RateLimiter::availableIn($this->throttleKey());
75
+
76
+        throw ValidationException::withMessages([
77
+            'email' => trans('auth.throttle', [
78
+                'seconds' => $seconds,
79
+                'minutes' => ceil($seconds / 60),
80
+            ]),
81
+        ]);
82
+    }
83
+
84
+    /**
85
+     * Get the rate limiting throttle key for the request.
86
+     *
87
+     * @return string
88
+     */
89
+    public function throttleKey()
90
+    {
91
+        return Str::lower($this->input('email')).'|'.$this->ip();
92
+    }
93
+}

+ 72
- 0
app/Models/AbstractModels/AbstractConfig.php Voir le fichier

@@ -0,0 +1,72 @@
1
+<?php
2
+/**
3
+ * Model object generated by: Skipper (http://www.skipper18.com)
4
+ * Do not modify this file manually.
5
+ */
6
+
7
+namespace App\Models\AbstractModels;
8
+
9
+use Illuminate\Database\Eloquent\Model;
10
+
11
+abstract class AbstractConfig extends Model
12
+{
13
+    /**  
14
+     * The table associated with the model.
15
+     * 
16
+     * @var string
17
+     */
18
+    protected $table = 'config';
19
+    
20
+    /**  
21
+     * Primary key name.
22
+     * 
23
+     * @var string
24
+     */
25
+    public $primaryKey = 'key';
26
+    
27
+    /**  
28
+     * Primary key type.
29
+     * 
30
+     * @var string
31
+     */
32
+    protected $keyType = 'string';
33
+    
34
+    /**  
35
+     * Primary key is non-autoincrementing.
36
+     * 
37
+     * @var bool
38
+     */
39
+    public $incrementing = false;
40
+    
41
+    /**  
42
+     * The attributes that should be cast to native types.
43
+     * 
44
+     * @var array
45
+     */
46
+    protected $casts = [
47
+        'key' => 'string',
48
+        'group' => 'string',
49
+        'display_name' => 'string',
50
+        'value' => 'string',
51
+        'order' => 'integer',
52
+        'type' => 'string',
53
+        'created_at' => 'datetime',
54
+        'updated_at' => 'datetime'
55
+    ];
56
+    
57
+    /**  
58
+     * The attributes that are mass assignable.
59
+     * 
60
+     * @var array
61
+     */
62
+    protected $fillable = [
63
+        'key',
64
+        'group',
65
+        'display_name',
66
+        'value',
67
+        'order',
68
+        'type',
69
+        'created_at',
70
+        'updated_at'
71
+    ];
72
+}

+ 60
- 0
app/Models/AbstractModels/AbstractUser.php Voir le fichier

@@ -0,0 +1,60 @@
1
+<?php
2
+/**
3
+ * Model object generated by: Skipper (http://www.skipper18.com)
4
+ * Do not modify this file manually.
5
+ */
6
+
7
+namespace App\Models\AbstractModels;
8
+
9
+abstract class AbstractUser extends \Illuminate\Foundation\Auth\User
10
+{
11
+    /**  
12
+     * The table associated with the model.
13
+     * 
14
+     * @var string
15
+     */
16
+    protected $table = 'users';
17
+    
18
+    /**  
19
+     * Primary key type.
20
+     * 
21
+     * @var string
22
+     */
23
+    protected $keyType = 'bigInteger';
24
+    
25
+    /**  
26
+     * The attributes that should be cast to native types.
27
+     * 
28
+     * @var array
29
+     */
30
+    protected $casts = [
31
+        'id' => 'integer',
32
+        'nome' => 'string',
33
+        'cognome' => 'string',
34
+        'email' => 'string',
35
+        'password' => 'string',
36
+        'email_verified_at' => 'datetime',
37
+        'remember_token' => 'string',
38
+        'progetti' => 'string',
39
+        'created_at' => 'datetime',
40
+        'updated_at' => 'datetime'
41
+    ];
42
+    
43
+    /**  
44
+     * The attributes that are mass assignable.
45
+     * 
46
+     * @var array
47
+     */
48
+    protected $fillable = [
49
+        'id',
50
+        'nome',
51
+        'cognome',
52
+        'email',
53
+        'password',
54
+        'email_verified_at',
55
+        'remember_token',
56
+        'progetti',
57
+        'created_at',
58
+        'updated_at'
59
+    ];
60
+}

+ 28
- 0
app/Models/Config.php Voir le fichier

@@ -0,0 +1,28 @@
1
+<?php
2
+namespace App\Models;
3
+use Storage;
4
+
5
+class Config extends \App\Models\AbstractModels\AbstractConfig
6
+{
7
+  const STATI_SEGNALAZIONI_VALIDE = 'stati_segnalazioni_valide';
8
+  const ATTIVITA_ON_SITE = 12;
9
+  const ATTIVITA_REMOTA = 11;
10
+
11
+  public static function getConfig(){
12
+    $config = [];
13
+    $config['Generale'] = [
14
+      ['key' => self::STATI_SEGNALAZIONI_VALIDE, 'value' => null, 'display_name' => 'Stati segnalazioni da mostrare al cliente', 'type' => 'array_status'],
15
+    ];
16
+
17
+    return $config;
18
+  }
19
+
20
+  public static function getValue($key){
21
+    try{
22
+      return Config::find($key)->value;
23
+    }catch(\Exception $e){
24
+      return 0;
25
+    }
26
+  }
27
+
28
+}

+ 90
- 0
app/Models/Issue.php Voir le fichier

@@ -0,0 +1,90 @@
1
+<?php
2
+namespace App\Models;
3
+
4
+use Illuminate\Http\Request;
5
+use Illuminate\Support\Facades\Http;
6
+use Illuminate\Support\Collection;
7
+use Illuminate\Support\Facades\Log;
8
+use Auth;
9
+
10
+class Issue{
11
+
12
+  public function tipologiaRichieste(){
13
+    return [
14
+      'Assistenza sistemistica' => 'Assistenza sistemistica',
15
+      'Assistenza su Firewall' => 'Assistenza su Firewall',
16
+      'Assistenza su connettività e centralini telefonici' => 'Assistenza su connettività e centralini telefonici',
17
+      'Assistenza su servizi internet' => 'Assistenza su servizi internet',
18
+      'Assistenza su servizi Cloud' => 'Assistenza su servizi Cloud'
19
+    ];
20
+  }
21
+
22
+  public static function getCollection(){
23
+    $redmineUser = session('redmine_user');
24
+    $collection = new Collection();
25
+
26
+    $project_ids = json_decode(Auth::user()->progetti);
27
+    $status = json_decode(Config::getValue(Config::STATI_SEGNALAZIONI_VALIDE));
28
+
29
+    // Issue assegnati direttamente all'utente
30
+
31
+    foreach($project_ids as $project_id){
32
+      $issueResponse = Http::get(config('redmine.url').'/issues.json', [
33
+        'key' => $redmineUser->api_key,
34
+        'project_id' => $project_id,
35
+        'status_id' => ($status!=null && count($status)>0)?implode('|', $status):'open',
36
+        // 'limit' => 100,
37
+      ]);
38
+
39
+
40
+      try{
41
+        foreach($issueResponse->object()->issues as $issue){
42
+          $collection->push($issue);
43
+        }
44
+      }catch(\Exception $e){
45
+      }
46
+    }
47
+
48
+
49
+    return $collection;
50
+  }
51
+
52
+  public static function getTempoImpiegato($issue_id, $attivita){
53
+    $redmineUser = session('redmine_user');
54
+    $collection = new Collection();
55
+
56
+    $issueResponse = Http::get(config('redmine.url').'/time_entries.json', [
57
+      'key' => $redmineUser->api_key,
58
+      'issue_id' => $issue_id,
59
+      'cf_2' => 'Si', // Custom fields "fatturare"
60
+      'activity_id' => $attivita
61
+
62
+    ]);
63
+
64
+    try{
65
+      foreach($issueResponse->object()->time_entries as $time){
66
+        $collection->push($time);
67
+      }
68
+    }catch(\Exception $e){
69
+    }
70
+
71
+    return $collection;
72
+  }
73
+
74
+  public static function getStati(){
75
+    $redmineUser = session('redmine_user');
76
+
77
+    // issueStatus
78
+    $response = Http::get(config('redmine.url').'/issue_statuses.json', [
79
+      'key' => $redmineUser->api_key,
80
+    ]);
81
+
82
+    $issueStatus = array();
83
+    foreach($response->object()->issue_statuses as $issue_status){
84
+      $issueStatus[$issue_status->id] = $issue_status->name;
85
+    }
86
+
87
+    return $issueStatus;
88
+  }
89
+
90
+}

+ 6
- 0
app/Models/Permission.php Voir le fichier

@@ -0,0 +1,6 @@
1
+<?php
2
+namespace App\Models;
3
+
4
+class Permission extends \Spatie\Permission\Models\Permission
5
+{
6
+}

+ 6
- 0
app/Models/Role.php Voir le fichier

@@ -0,0 +1,6 @@
1
+<?php
2
+namespace App\Models;
3
+
4
+class Role extends \Spatie\Permission\Models\Role
5
+{
6
+}

+ 33
- 0
app/Models/User.php Voir le fichier

@@ -0,0 +1,33 @@
1
+<?php
2
+namespace App\Models;
3
+
4
+use Illuminate\Contracts\Auth\MustVerifyEmail;
5
+use Illuminate\Database\Eloquent\Factories\HasFactory;
6
+use Spatie\Permission\Traits\HasRoles;
7
+use Illuminate\Notifications\Notifiable;
8
+use Carbon\Carbon;
9
+use Auth;
10
+use Hash;
11
+
12
+class User extends \App\Models\AbstractModels\AbstractUser
13
+{
14
+  use HasFactory, Notifiable, HasRoles;
15
+
16
+  public function getFullNameAttribute(){
17
+    return $this->nome." ".$this->cognome;
18
+  }
19
+
20
+  public function sendPasswordResetNotification($token)
21
+  {
22
+    $url = config('app.url').'/reset-password/'.$token;
23
+    $this->notify(new \App\Notifications\ResetPasswordNotification($url));
24
+  }
25
+
26
+  // public function setPasswordAttribute($value){
27
+  //   if($value == null){
28
+  //     return;
29
+  //   }else{
30
+  //     $this->attributes['password'] = Hash::make($value);
31
+  //   }
32
+  // }
33
+}

+ 64
- 0
app/Notifications/ResetPasswordNotification.php Voir le fichier

@@ -0,0 +1,64 @@
1
+<?php
2
+
3
+namespace App\Notifications;
4
+
5
+use Illuminate\Bus\Queueable;
6
+use Illuminate\Contracts\Queue\ShouldQueue;
7
+use Illuminate\Notifications\Messages\MailMessage;
8
+use Illuminate\Notifications\Notification;
9
+
10
+class ResetPasswordNotification extends Notification
11
+{
12
+  use Queueable;
13
+  public $url = "";
14
+
15
+  /**
16
+  * Create a new notification instance.
17
+  *
18
+  * @return void
19
+  */
20
+  public function __construct($url)
21
+  {
22
+    $this->url = $url;
23
+  }
24
+
25
+  /**
26
+  * Get the notification's delivery channels.
27
+  *
28
+  * @param  mixed  $notifiable
29
+  * @return array
30
+  */
31
+  public function via($notifiable)
32
+  {
33
+    return ['mail'];
34
+  }
35
+
36
+  /**
37
+  * Get the mail representation of the notification.
38
+  *
39
+  * @param  mixed  $notifiable
40
+  * @return \Illuminate\Notifications\Messages\MailMessage
41
+  */
42
+  public function toMail($notifiable)
43
+  {
44
+    return (new MailMessage)
45
+    ->subject('Reset password')
46
+    ->line('Hai ricevuto questa email perché abbiamo ricevuto una richiesta di reimpostazione della password per il tuo account.')
47
+    ->action('Reset Password', $this->url)
48
+    ->line('Questo link per la reimpostazione della password scadrà tra :count minuti.', ['count' => config('auth.passwords.'.config('auth.defaults.passwords').'.expire')])
49
+    ->line('Se non hai richiesto la reimpostazione della password, non sono necessarie ulteriori azioni.');
50
+  }
51
+
52
+  /**
53
+  * Get the array representation of the notification.
54
+  *
55
+  * @param  mixed  $notifiable
56
+  * @return array
57
+  */
58
+  public function toArray($notifiable)
59
+  {
60
+    return [
61
+      //
62
+    ];
63
+  }
64
+}

+ 62
- 0
app/Observers/UserObserver.php Voir le fichier

@@ -0,0 +1,62 @@
1
+<?php
2
+
3
+namespace App\Observers;
4
+
5
+use App\Models\User;
6
+
7
+class UserObserver
8
+{
9
+  /**
10
+  * Handle the User "created" event.
11
+  *
12
+  * @param  \App\Models\User  $user
13
+  * @return void
14
+  */
15
+  public function created(User $user)
16
+  {
17
+    $user->assignRole('user');
18
+  }
19
+
20
+  /**
21
+  * Handle the User "updated" event.
22
+  *
23
+  * @param  \App\Models\User  $user
24
+  * @return void
25
+  */
26
+  public function updated(User $user)
27
+  {
28
+    //
29
+  }
30
+
31
+  /**
32
+  * Handle the User "deleted" event.
33
+  *
34
+  * @param  \App\Models\User  $user
35
+  * @return void
36
+  */
37
+  public function deleting(User $user)
38
+  {
39
+  }
40
+
41
+  /**
42
+  * Handle the User "restored" event.
43
+  *
44
+  * @param  \App\Models\User  $user
45
+  * @return void
46
+  */
47
+  public function restored(User $user)
48
+  {
49
+    //
50
+  }
51
+
52
+  /**
53
+  * Handle the User "force deleted" event.
54
+  *
55
+  * @param  \App\Models\User  $user
56
+  * @return void
57
+  */
58
+  public function forceDeleted(User $user)
59
+  {
60
+    //
61
+  }
62
+}

+ 28
- 0
app/Providers/AppServiceProvider.php Voir le fichier

@@ -0,0 +1,28 @@
1
+<?php
2
+
3
+namespace App\Providers;
4
+
5
+use Illuminate\Support\ServiceProvider;
6
+
7
+class AppServiceProvider extends ServiceProvider
8
+{
9
+    /**
10
+     * Register any application services.
11
+     *
12
+     * @return void
13
+     */
14
+    public function register()
15
+    {
16
+        //
17
+    }
18
+
19
+    /**
20
+     * Bootstrap any application services.
21
+     *
22
+     * @return void
23
+     */
24
+    public function boot()
25
+    {
26
+        \App\Models\User::observe(\App\Observers\UserObserver::class);
27
+    }
28
+}

+ 30
- 0
app/Providers/AuthServiceProvider.php Voir le fichier

@@ -0,0 +1,30 @@
1
+<?php
2
+
3
+namespace App\Providers;
4
+
5
+use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
6
+use Illuminate\Support\Facades\Gate;
7
+
8
+class AuthServiceProvider extends ServiceProvider
9
+{
10
+    /**
11
+     * The policy mappings for the application.
12
+     *
13
+     * @var array<class-string, class-string>
14
+     */
15
+    protected $policies = [
16
+        // 'App\Models\Model' => 'App\Policies\ModelPolicy',
17
+    ];
18
+
19
+    /**
20
+     * Register any authentication / authorization services.
21
+     *
22
+     * @return void
23
+     */
24
+    public function boot()
25
+    {
26
+        $this->registerPolicies();
27
+
28
+        //
29
+    }
30
+}

+ 21
- 0
app/Providers/BroadcastServiceProvider.php Voir le fichier

@@ -0,0 +1,21 @@
1
+<?php
2
+
3
+namespace App\Providers;
4
+
5
+use Illuminate\Support\Facades\Broadcast;
6
+use Illuminate\Support\ServiceProvider;
7
+
8
+class BroadcastServiceProvider extends ServiceProvider
9
+{
10
+    /**
11
+     * Bootstrap any application services.
12
+     *
13
+     * @return void
14
+     */
15
+    public function boot()
16
+    {
17
+        Broadcast::routes();
18
+
19
+        require base_path('routes/channels.php');
20
+    }
21
+}

+ 32
- 0
app/Providers/EventServiceProvider.php Voir le fichier

@@ -0,0 +1,32 @@
1
+<?php
2
+
3
+namespace App\Providers;
4
+
5
+use Illuminate\Auth\Events\Registered;
6
+use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
7
+use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
8
+use Illuminate\Support\Facades\Event;
9
+
10
+class EventServiceProvider extends ServiceProvider
11
+{
12
+    /**
13
+     * The event listener mappings for the application.
14
+     *
15
+     * @var array<class-string, array<int, class-string>>
16
+     */
17
+    protected $listen = [
18
+        Registered::class => [
19
+            SendEmailVerificationNotification::class,
20
+        ],
21
+    ];
22
+
23
+    /**
24
+     * Register any events for your application.
25
+     *
26
+     * @return void
27
+     */
28
+    public function boot()
29
+    {
30
+        //
31
+    }
32
+}

+ 63
- 0
app/Providers/RouteServiceProvider.php Voir le fichier

@@ -0,0 +1,63 @@
1
+<?php
2
+
3
+namespace App\Providers;
4
+
5
+use Illuminate\Cache\RateLimiting\Limit;
6
+use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
7
+use Illuminate\Http\Request;
8
+use Illuminate\Support\Facades\RateLimiter;
9
+use Illuminate\Support\Facades\Route;
10
+
11
+class RouteServiceProvider extends ServiceProvider
12
+{
13
+    /**
14
+     * The path to the "home" route for your application.
15
+     *
16
+     * This is used by Laravel authentication to redirect users after login.
17
+     *
18
+     * @var string
19
+     */
20
+    public const HOME = '/dashboard';
21
+
22
+    /**
23
+     * The controller namespace for the application.
24
+     *
25
+     * When present, controller route declarations will automatically be prefixed with this namespace.
26
+     *
27
+     * @var string|null
28
+     */
29
+    // protected $namespace = 'App\\Http\\Controllers';
30
+
31
+    /**
32
+     * Define your route model bindings, pattern filters, etc.
33
+     *
34
+     * @return void
35
+     */
36
+    public function boot()
37
+    {
38
+        $this->configureRateLimiting();
39
+
40
+        $this->routes(function () {
41
+            Route::prefix('api')
42
+                ->middleware('api')
43
+                ->namespace($this->namespace)
44
+                ->group(base_path('routes/api.php'));
45
+
46
+            Route::middleware('web')
47
+                ->namespace($this->namespace)
48
+                ->group(base_path('routes/web.php'));
49
+        });
50
+    }
51
+
52
+    /**
53
+     * Configure the rate limiters for the application.
54
+     *
55
+     * @return void
56
+     */
57
+    protected function configureRateLimiting()
58
+    {
59
+        RateLimiter::for('api', function (Request $request) {
60
+            return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
61
+        });
62
+    }
63
+}

+ 18
- 0
app/View/Components/AppLayout.php Voir le fichier

@@ -0,0 +1,18 @@
1
+<?php
2
+
3
+namespace App\View\Components;
4
+
5
+use Illuminate\View\Component;
6
+
7
+class AppLayout extends Component
8
+{
9
+    /**
10
+     * Get the view / contents that represents the component.
11
+     *
12
+     * @return \Illuminate\View\View
13
+     */
14
+    public function render()
15
+    {
16
+        return view('layouts.app');
17
+    }
18
+}

+ 18
- 0
app/View/Components/GuestLayout.php Voir le fichier

@@ -0,0 +1,18 @@
1
+<?php
2
+
3
+namespace App\View\Components;
4
+
5
+use Illuminate\View\Component;
6
+
7
+class GuestLayout extends Component
8
+{
9
+    /**
10
+     * Get the view / contents that represents the component.
11
+     *
12
+     * @return \Illuminate\View\View
13
+     */
14
+    public function render()
15
+    {
16
+        return view('layouts.guest');
17
+    }
18
+}

+ 53
- 0
artisan Voir le fichier

@@ -0,0 +1,53 @@
1
+#!/usr/bin/env php
2
+<?php
3
+
4
+define('LARAVEL_START', microtime(true));
5
+
6
+/*
7
+|--------------------------------------------------------------------------
8
+| Register The Auto Loader
9
+|--------------------------------------------------------------------------
10
+|
11
+| Composer provides a convenient, automatically generated class loader
12
+| for our application. We just need to utilize it! We'll require it
13
+| into the script here so that we do not have to worry about the
14
+| loading of any of our classes manually. It's great to relax.
15
+|
16
+*/
17
+
18
+require __DIR__.'/vendor/autoload.php';
19
+
20
+$app = require_once __DIR__.'/bootstrap/app.php';
21
+
22
+/*
23
+|--------------------------------------------------------------------------
24
+| Run The Artisan Application
25
+|--------------------------------------------------------------------------
26
+|
27
+| When we run the console application, the current CLI command will be
28
+| executed in this console and the response sent back to a terminal
29
+| or another output device for the developers. Here goes nothing!
30
+|
31
+*/
32
+
33
+$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
34
+
35
+$status = $kernel->handle(
36
+    $input = new Symfony\Component\Console\Input\ArgvInput,
37
+    new Symfony\Component\Console\Output\ConsoleOutput
38
+);
39
+
40
+/*
41
+|--------------------------------------------------------------------------
42
+| Shutdown The Application
43
+|--------------------------------------------------------------------------
44
+|
45
+| Once Artisan has finished running, we will fire off the shutdown events
46
+| so that any final work may be done by the application before we shut
47
+| down the process. This is the last thing to happen to the request.
48
+|
49
+*/
50
+
51
+$kernel->terminate($input, $status);
52
+
53
+exit($status);

+ 55
- 0
bootstrap/app.php Voir le fichier

@@ -0,0 +1,55 @@
1
+<?php
2
+
3
+/*
4
+|--------------------------------------------------------------------------
5
+| Create The Application
6
+|--------------------------------------------------------------------------
7
+|
8
+| The first thing we will do is create a new Laravel application instance
9
+| which serves as the "glue" for all the components of Laravel, and is
10
+| the IoC container for the system binding all of the various parts.
11
+|
12
+*/
13
+
14
+$app = new Illuminate\Foundation\Application(
15
+    $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
16
+);
17
+
18
+/*
19
+|--------------------------------------------------------------------------
20
+| Bind Important Interfaces
21
+|--------------------------------------------------------------------------
22
+|
23
+| Next, we need to bind some important interfaces into the container so
24
+| we will be able to resolve them when needed. The kernels serve the
25
+| incoming requests to this application from both the web and CLI.
26
+|
27
+*/
28
+
29
+$app->singleton(
30
+    Illuminate\Contracts\Http\Kernel::class,
31
+    App\Http\Kernel::class
32
+);
33
+
34
+$app->singleton(
35
+    Illuminate\Contracts\Console\Kernel::class,
36
+    App\Console\Kernel::class
37
+);
38
+
39
+$app->singleton(
40
+    Illuminate\Contracts\Debug\ExceptionHandler::class,
41
+    App\Exceptions\Handler::class
42
+);
43
+
44
+/*
45
+|--------------------------------------------------------------------------
46
+| Return The Application
47
+|--------------------------------------------------------------------------
48
+|
49
+| This script returns the application instance. The instance is given to
50
+| the calling script so we can separate the building of the instances
51
+| from the actual running of the application and sending responses.
52
+|
53
+*/
54
+
55
+return $app;

+ 2
- 0
bootstrap/cache/.gitignore Voir le fichier

@@ -0,0 +1,2 @@
1
+*
2
+!.gitignore

+ 65
- 0
composer.json Voir le fichier

@@ -0,0 +1,65 @@
1
+{
2
+    "name": "laravel/laravel",
3
+    "type": "project",
4
+    "description": "The Laravel Framework.",
5
+    "keywords": ["framework", "laravel"],
6
+    "license": "MIT",
7
+    "require": {
8
+        "php": "^7.3|^8.0",
9
+        "fruitcake/laravel-cors": "^2.0",
10
+        "guzzlehttp/guzzle": "^7.0.1",
11
+        "laravel/framework": "^8.75",
12
+        "laravel/sanctum": "^2.11",
13
+        "laravel/tinker": "^2.5",
14
+        "spatie/laravel-permission": "^5.5",
15
+        "yajra/laravel-datatables": "^1.5"
16
+    },
17
+    "require-dev": {
18
+        "facade/ignition": "^2.5",
19
+        "fakerphp/faker": "^1.9.1",
20
+        "laravel/breeze": "^1.8",
21
+        "laravel/sail": "^1.0.1",
22
+        "mockery/mockery": "^1.4.4",
23
+        "nunomaduro/collision": "^5.10",
24
+        "phpunit/phpunit": "^9.5.10"
25
+    },
26
+    "autoload": {
27
+        "psr-4": {
28
+            "App\\": "app/",
29
+            "Database\\Factories\\": "database/factories/",
30
+            "Database\\Seeders\\": "database/seeders/"
31
+        }
32
+    },
33
+    "autoload-dev": {
34
+        "psr-4": {
35
+            "Tests\\": "tests/"
36
+        }
37
+    },
38
+    "scripts": {
39
+        "post-autoload-dump": [
40
+            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
41
+            "@php artisan package:discover --ansi"
42
+        ],
43
+        "post-update-cmd": [
44
+            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
45
+        ],
46
+        "post-root-package-install": [
47
+            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
48
+        ],
49
+        "post-create-project-cmd": [
50
+            "@php artisan key:generate --ansi"
51
+        ]
52
+    },
53
+    "extra": {
54
+        "laravel": {
55
+            "dont-discover": []
56
+        }
57
+    },
58
+    "config": {
59
+        "optimize-autoloader": true,
60
+        "preferred-install": "dist",
61
+        "sort-packages": true
62
+    },
63
+    "minimum-stability": "dev",
64
+    "prefer-stable": true
65
+}

+ 9087
- 0
composer.lock
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 238
- 0
config/app.php Voir le fichier

@@ -0,0 +1,238 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Application Name
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | This value is the name of your application. This value is used when the
11
+    | framework needs to place the application's name in a notification or
12
+    | any other location as required by the application or its packages.
13
+    |
14
+    */
15
+
16
+    'name' => env('APP_NAME', 'Laravel'),
17
+    'redmine_url' => env('REDMINE_URL', 'Laravel'),
18
+    'redmine_user' => env('REDMINE_USER', 'Laravel'),
19
+    'redmine_pwd' => env('REDMINE_PWD', 'Laravel'),
20
+
21
+    /*
22
+    |--------------------------------------------------------------------------
23
+    | Application Environment
24
+    |--------------------------------------------------------------------------
25
+    |
26
+    | This value determines the "environment" your application is currently
27
+    | running in. This may determine how you prefer to configure various
28
+    | services the application utilizes. Set this in your ".env" file.
29
+    |
30
+    */
31
+
32
+    'env' => env('APP_ENV', 'production'),
33
+
34
+    /*
35
+    |--------------------------------------------------------------------------
36
+    | Application Debug Mode
37
+    |--------------------------------------------------------------------------
38
+    |
39
+    | When your application is in debug mode, detailed error messages with
40
+    | stack traces will be shown on every error that occurs within your
41
+    | application. If disabled, a simple generic error page is shown.
42
+    |
43
+    */
44
+
45
+    'debug' => (bool) env('APP_DEBUG', false),
46
+
47
+    /*
48
+    |--------------------------------------------------------------------------
49
+    | Application URL
50
+    |--------------------------------------------------------------------------
51
+    |
52
+    | This URL is used by the console to properly generate URLs when using
53
+    | the Artisan command line tool. You should set this to the root of
54
+    | your application so that it is used when running Artisan tasks.
55
+    |
56
+    */
57
+
58
+    'url' => env('APP_URL', 'http://localhost'),
59
+
60
+    'asset_url' => env('ASSET_URL', null),
61
+
62
+    /*
63
+    |--------------------------------------------------------------------------
64
+    | Application Timezone
65
+    |--------------------------------------------------------------------------
66
+    |
67
+    | Here you may specify the default timezone for your application, which
68
+    | will be used by the PHP date and date-time functions. We have gone
69
+    | ahead and set this to a sensible default for you out of the box.
70
+    |
71
+    */
72
+
73
+    'timezone' => 'Europe/Rome',
74
+
75
+    /*
76
+    |--------------------------------------------------------------------------
77
+    | Application Locale Configuration
78
+    |--------------------------------------------------------------------------
79
+    |
80
+    | The application locale determines the default locale that will be used
81
+    | by the translation service provider. You are free to set this value
82
+    | to any of the locales which will be supported by the application.
83
+    |
84
+    */
85
+
86
+    'locale' => 'it',
87
+
88
+    /*
89
+    |--------------------------------------------------------------------------
90
+    | Application Fallback Locale
91
+    |--------------------------------------------------------------------------
92
+    |
93
+    | The fallback locale determines the locale to use when the current one
94
+    | is not available. You may change the value to correspond to any of
95
+    | the language folders that are provided through your application.
96
+    |
97
+    */
98
+
99
+    'fallback_locale' => 'en',
100
+
101
+    /*
102
+    |--------------------------------------------------------------------------
103
+    | Faker Locale
104
+    |--------------------------------------------------------------------------
105
+    |
106
+    | This locale will be used by the Faker PHP library when generating fake
107
+    | data for your database seeds. For example, this will be used to get
108
+    | localized telephone numbers, street address information and more.
109
+    |
110
+    */
111
+
112
+    'faker_locale' => 'en_US',
113
+
114
+    /*
115
+    |--------------------------------------------------------------------------
116
+    | Encryption Key
117
+    |--------------------------------------------------------------------------
118
+    |
119
+    | This key is used by the Illuminate encrypter service and should be set
120
+    | to a random, 32 character string, otherwise these encrypted strings
121
+    | will not be safe. Please do this before deploying an application!
122
+    |
123
+    */
124
+
125
+    'key' => env('APP_KEY'),
126
+
127
+    'cipher' => 'AES-256-CBC',
128
+
129
+    /*
130
+    |--------------------------------------------------------------------------
131
+    | Autoloaded Service Providers
132
+    |--------------------------------------------------------------------------
133
+    |
134
+    | The service providers listed here will be automatically loaded on the
135
+    | request to your application. Feel free to add your own services to
136
+    | this array to grant expanded functionality to your applications.
137
+    |
138
+    */
139
+
140
+    'providers' => [
141
+
142
+        /*
143
+         * Laravel Framework Service Providers...
144
+         */
145
+        Illuminate\Auth\AuthServiceProvider::class,
146
+        Illuminate\Broadcasting\BroadcastServiceProvider::class,
147
+        Illuminate\Bus\BusServiceProvider::class,
148
+        Illuminate\Cache\CacheServiceProvider::class,
149
+        Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
150
+        Illuminate\Cookie\CookieServiceProvider::class,
151
+        Illuminate\Database\DatabaseServiceProvider::class,
152
+        Illuminate\Encryption\EncryptionServiceProvider::class,
153
+        Illuminate\Filesystem\FilesystemServiceProvider::class,
154
+        Illuminate\Foundation\Providers\FoundationServiceProvider::class,
155
+        Illuminate\Hashing\HashServiceProvider::class,
156
+        Illuminate\Mail\MailServiceProvider::class,
157
+        Illuminate\Notifications\NotificationServiceProvider::class,
158
+        Illuminate\Pagination\PaginationServiceProvider::class,
159
+        Illuminate\Pipeline\PipelineServiceProvider::class,
160
+        Illuminate\Queue\QueueServiceProvider::class,
161
+        Illuminate\Redis\RedisServiceProvider::class,
162
+        Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
163
+        Illuminate\Session\SessionServiceProvider::class,
164
+        Illuminate\Translation\TranslationServiceProvider::class,
165
+        Illuminate\Validation\ValidationServiceProvider::class,
166
+        Illuminate\View\ViewServiceProvider::class,
167
+
168
+        /*
169
+         * Package Service Providers...
170
+         */
171
+
172
+        /*
173
+         * Application Service Providers...
174
+         */
175
+        App\Providers\AppServiceProvider::class,
176
+        App\Providers\AuthServiceProvider::class,
177
+        // App\Providers\BroadcastServiceProvider::class,
178
+        App\Providers\EventServiceProvider::class,
179
+        App\Providers\RouteServiceProvider::class,
180
+
181
+    ],
182
+
183
+    /*
184
+    |--------------------------------------------------------------------------
185
+    | Class Aliases
186
+    |--------------------------------------------------------------------------
187
+    |
188
+    | This array of class aliases will be registered when this application
189
+    | is started. However, feel free to register as many as you wish as
190
+    | the aliases are "lazy" loaded so they don't hinder performance.
191
+    |
192
+    */
193
+
194
+    'aliases' => [
195
+
196
+        'App' => Illuminate\Support\Facades\App::class,
197
+        'Arr' => Illuminate\Support\Arr::class,
198
+        'Artisan' => Illuminate\Support\Facades\Artisan::class,
199
+        'Auth' => Illuminate\Support\Facades\Auth::class,
200
+        'Blade' => Illuminate\Support\Facades\Blade::class,
201
+        'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
202
+        'Bus' => Illuminate\Support\Facades\Bus::class,
203
+        'Cache' => Illuminate\Support\Facades\Cache::class,
204
+        'Config' => Illuminate\Support\Facades\Config::class,
205
+        'Cookie' => Illuminate\Support\Facades\Cookie::class,
206
+        'Crypt' => Illuminate\Support\Facades\Crypt::class,
207
+        'Date' => Illuminate\Support\Facades\Date::class,
208
+        'DB' => Illuminate\Support\Facades\DB::class,
209
+        'Eloquent' => Illuminate\Database\Eloquent\Model::class,
210
+        'Event' => Illuminate\Support\Facades\Event::class,
211
+        'File' => Illuminate\Support\Facades\File::class,
212
+        'Gate' => Illuminate\Support\Facades\Gate::class,
213
+        'Hash' => Illuminate\Support\Facades\Hash::class,
214
+        'Http' => Illuminate\Support\Facades\Http::class,
215
+        'Js' => Illuminate\Support\Js::class,
216
+        'Lang' => Illuminate\Support\Facades\Lang::class,
217
+        'Log' => Illuminate\Support\Facades\Log::class,
218
+        'Mail' => Illuminate\Support\Facades\Mail::class,
219
+        'Notification' => Illuminate\Support\Facades\Notification::class,
220
+        'Password' => Illuminate\Support\Facades\Password::class,
221
+        'Queue' => Illuminate\Support\Facades\Queue::class,
222
+        'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
223
+        'Redirect' => Illuminate\Support\Facades\Redirect::class,
224
+        // 'Redis' => Illuminate\Support\Facades\Redis::class,
225
+        'Request' => Illuminate\Support\Facades\Request::class,
226
+        'Response' => Illuminate\Support\Facades\Response::class,
227
+        'Route' => Illuminate\Support\Facades\Route::class,
228
+        'Schema' => Illuminate\Support\Facades\Schema::class,
229
+        'Session' => Illuminate\Support\Facades\Session::class,
230
+        'Storage' => Illuminate\Support\Facades\Storage::class,
231
+        'Str' => Illuminate\Support\Str::class,
232
+        'URL' => Illuminate\Support\Facades\URL::class,
233
+        'Validator' => Illuminate\Support\Facades\Validator::class,
234
+        'View' => Illuminate\Support\Facades\View::class,
235
+
236
+    ],
237
+
238
+];

+ 111
- 0
config/auth.php Voir le fichier

@@ -0,0 +1,111 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Authentication Defaults
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | This option controls the default authentication "guard" and password
11
+    | reset options for your application. You may change these defaults
12
+    | as required, but they're a perfect start for most applications.
13
+    |
14
+    */
15
+
16
+    'defaults' => [
17
+        'guard' => 'web',
18
+        'passwords' => 'users',
19
+    ],
20
+
21
+    /*
22
+    |--------------------------------------------------------------------------
23
+    | Authentication Guards
24
+    |--------------------------------------------------------------------------
25
+    |
26
+    | Next, you may define every authentication guard for your application.
27
+    | Of course, a great default configuration has been defined for you
28
+    | here which uses session storage and the Eloquent user provider.
29
+    |
30
+    | All authentication drivers have a user provider. This defines how the
31
+    | users are actually retrieved out of your database or other storage
32
+    | mechanisms used by this application to persist your user's data.
33
+    |
34
+    | Supported: "session"
35
+    |
36
+    */
37
+
38
+    'guards' => [
39
+        'web' => [
40
+            'driver' => 'session',
41
+            'provider' => 'users',
42
+        ],
43
+    ],
44
+
45
+    /*
46
+    |--------------------------------------------------------------------------
47
+    | User Providers
48
+    |--------------------------------------------------------------------------
49
+    |
50
+    | All authentication drivers have a user provider. This defines how the
51
+    | users are actually retrieved out of your database or other storage
52
+    | mechanisms used by this application to persist your user's data.
53
+    |
54
+    | If you have multiple user tables or models you may configure multiple
55
+    | sources which represent each model / table. These sources may then
56
+    | be assigned to any extra authentication guards you have defined.
57
+    |
58
+    | Supported: "database", "eloquent"
59
+    |
60
+    */
61
+
62
+    'providers' => [
63
+        'users' => [
64
+            'driver' => 'eloquent',
65
+            'model' => App\Models\User::class,
66
+        ],
67
+
68
+        // 'users' => [
69
+        //     'driver' => 'database',
70
+        //     'table' => 'users',
71
+        // ],
72
+    ],
73
+
74
+    /*
75
+    |--------------------------------------------------------------------------
76
+    | Resetting Passwords
77
+    |--------------------------------------------------------------------------
78
+    |
79
+    | You may specify multiple password reset configurations if you have more
80
+    | than one user table or model in the application and you want to have
81
+    | separate password reset settings based on the specific user types.
82
+    |
83
+    | The expire time is the number of minutes that each reset token will be
84
+    | considered valid. This security feature keeps tokens short-lived so
85
+    | they have less time to be guessed. You may change this as needed.
86
+    |
87
+    */
88
+
89
+    'passwords' => [
90
+        'users' => [
91
+            'provider' => 'users',
92
+            'table' => 'password_resets',
93
+            'expire' => 60,
94
+            'throttle' => 60,
95
+        ],
96
+    ],
97
+
98
+    /*
99
+    |--------------------------------------------------------------------------
100
+    | Password Confirmation Timeout
101
+    |--------------------------------------------------------------------------
102
+    |
103
+    | Here you may define the amount of seconds before a password confirmation
104
+    | times out and the user is prompted to re-enter their password via the
105
+    | confirmation screen. By default, the timeout lasts for three hours.
106
+    |
107
+    */
108
+
109
+    'password_timeout' => 10800,
110
+
111
+];

+ 64
- 0
config/broadcasting.php Voir le fichier

@@ -0,0 +1,64 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Default Broadcaster
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | This option controls the default broadcaster that will be used by the
11
+    | framework when an event needs to be broadcast. You may set this to
12
+    | any of the connections defined in the "connections" array below.
13
+    |
14
+    | Supported: "pusher", "ably", "redis", "log", "null"
15
+    |
16
+    */
17
+
18
+    'default' => env('BROADCAST_DRIVER', 'null'),
19
+
20
+    /*
21
+    |--------------------------------------------------------------------------
22
+    | Broadcast Connections
23
+    |--------------------------------------------------------------------------
24
+    |
25
+    | Here you may define all of the broadcast connections that will be used
26
+    | to broadcast events to other systems or over websockets. Samples of
27
+    | each available type of connection are provided inside this array.
28
+    |
29
+    */
30
+
31
+    'connections' => [
32
+
33
+        'pusher' => [
34
+            'driver' => 'pusher',
35
+            'key' => env('PUSHER_APP_KEY'),
36
+            'secret' => env('PUSHER_APP_SECRET'),
37
+            'app_id' => env('PUSHER_APP_ID'),
38
+            'options' => [
39
+                'cluster' => env('PUSHER_APP_CLUSTER'),
40
+                'useTLS' => true,
41
+            ],
42
+        ],
43
+
44
+        'ably' => [
45
+            'driver' => 'ably',
46
+            'key' => env('ABLY_KEY'),
47
+        ],
48
+
49
+        'redis' => [
50
+            'driver' => 'redis',
51
+            'connection' => 'default',
52
+        ],
53
+
54
+        'log' => [
55
+            'driver' => 'log',
56
+        ],
57
+
58
+        'null' => [
59
+            'driver' => 'null',
60
+        ],
61
+
62
+    ],
63
+
64
+];

+ 110
- 0
config/cache.php Voir le fichier

@@ -0,0 +1,110 @@
1
+<?php
2
+
3
+use Illuminate\Support\Str;
4
+
5
+return [
6
+
7
+    /*
8
+    |--------------------------------------------------------------------------
9
+    | Default Cache Store
10
+    |--------------------------------------------------------------------------
11
+    |
12
+    | This option controls the default cache connection that gets used while
13
+    | using this caching library. This connection is used when another is
14
+    | not explicitly specified when executing a given caching function.
15
+    |
16
+    */
17
+
18
+    'default' => env('CACHE_DRIVER', 'file'),
19
+
20
+    /*
21
+    |--------------------------------------------------------------------------
22
+    | Cache Stores
23
+    |--------------------------------------------------------------------------
24
+    |
25
+    | Here you may define all of the cache "stores" for your application as
26
+    | well as their drivers. You may even define multiple stores for the
27
+    | same cache driver to group types of items stored in your caches.
28
+    |
29
+    | Supported drivers: "apc", "array", "database", "file",
30
+    |         "memcached", "redis", "dynamodb", "octane", "null"
31
+    |
32
+    */
33
+
34
+    'stores' => [
35
+
36
+        'apc' => [
37
+            'driver' => 'apc',
38
+        ],
39
+
40
+        'array' => [
41
+            'driver' => 'array',
42
+            'serialize' => false,
43
+        ],
44
+
45
+        'database' => [
46
+            'driver' => 'database',
47
+            'table' => 'cache',
48
+            'connection' => null,
49
+            'lock_connection' => null,
50
+        ],
51
+
52
+        'file' => [
53
+            'driver' => 'file',
54
+            'path' => storage_path('framework/cache/data'),
55
+        ],
56
+
57
+        'memcached' => [
58
+            'driver' => 'memcached',
59
+            'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
60
+            'sasl' => [
61
+                env('MEMCACHED_USERNAME'),
62
+                env('MEMCACHED_PASSWORD'),
63
+            ],
64
+            'options' => [
65
+                // Memcached::OPT_CONNECT_TIMEOUT => 2000,
66
+            ],
67
+            'servers' => [
68
+                [
69
+                    'host' => env('MEMCACHED_HOST', '127.0.0.1'),
70
+                    'port' => env('MEMCACHED_PORT', 11211),
71
+                    'weight' => 100,
72
+                ],
73
+            ],
74
+        ],
75
+
76
+        'redis' => [
77
+            'driver' => 'redis',
78
+            'connection' => 'cache',
79
+            'lock_connection' => 'default',
80
+        ],
81
+
82
+        'dynamodb' => [
83
+            'driver' => 'dynamodb',
84
+            'key' => env('AWS_ACCESS_KEY_ID'),
85
+            'secret' => env('AWS_SECRET_ACCESS_KEY'),
86
+            'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
87
+            'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
88
+            'endpoint' => env('DYNAMODB_ENDPOINT'),
89
+        ],
90
+
91
+        'octane' => [
92
+            'driver' => 'octane',
93
+        ],
94
+
95
+    ],
96
+
97
+    /*
98
+    |--------------------------------------------------------------------------
99
+    | Cache Key Prefix
100
+    |--------------------------------------------------------------------------
101
+    |
102
+    | When utilizing a RAM based store such as APC or Memcached, there might
103
+    | be other applications utilizing the same cache. So, we'll specify a
104
+    | value to get prefixed to all our keys so we can avoid collisions.
105
+    |
106
+    */
107
+
108
+    'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
109
+
110
+];

+ 34
- 0
config/cors.php Voir le fichier

@@ -0,0 +1,34 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Cross-Origin Resource Sharing (CORS) Configuration
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | Here you may configure your settings for cross-origin resource sharing
11
+    | or "CORS". This determines what cross-origin operations may execute
12
+    | in web browsers. You are free to adjust these settings as needed.
13
+    |
14
+    | To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
15
+    |
16
+    */
17
+
18
+    'paths' => ['api/*', 'sanctum/csrf-cookie'],
19
+
20
+    'allowed_methods' => ['*'],
21
+
22
+    'allowed_origins' => ['*'],
23
+
24
+    'allowed_origins_patterns' => [],
25
+
26
+    'allowed_headers' => ['*'],
27
+
28
+    'exposed_headers' => [],
29
+
30
+    'max_age' => 0,
31
+
32
+    'supports_credentials' => false,
33
+
34
+];

+ 147
- 0
config/database.php Voir le fichier

@@ -0,0 +1,147 @@
1
+<?php
2
+
3
+use Illuminate\Support\Str;
4
+
5
+return [
6
+
7
+    /*
8
+    |--------------------------------------------------------------------------
9
+    | Default Database Connection Name
10
+    |--------------------------------------------------------------------------
11
+    |
12
+    | Here you may specify which of the database connections below you wish
13
+    | to use as your default connection for all database work. Of course
14
+    | you may use many connections at once using the Database library.
15
+    |
16
+    */
17
+
18
+    'default' => env('DB_CONNECTION', 'mysql'),
19
+
20
+    /*
21
+    |--------------------------------------------------------------------------
22
+    | Database Connections
23
+    |--------------------------------------------------------------------------
24
+    |
25
+    | Here are each of the database connections setup for your application.
26
+    | Of course, examples of configuring each database platform that is
27
+    | supported by Laravel is shown below to make development simple.
28
+    |
29
+    |
30
+    | All database work in Laravel is done through the PHP PDO facilities
31
+    | so make sure you have the driver for your particular database of
32
+    | choice installed on your machine before you begin development.
33
+    |
34
+    */
35
+
36
+    'connections' => [
37
+
38
+        'sqlite' => [
39
+            'driver' => 'sqlite',
40
+            'url' => env('DATABASE_URL'),
41
+            'database' => env('DB_DATABASE', database_path('database.sqlite')),
42
+            'prefix' => '',
43
+            'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
44
+        ],
45
+
46
+        'mysql' => [
47
+            'driver' => 'mysql',
48
+            'url' => env('DATABASE_URL'),
49
+            'host' => env('DB_HOST', '127.0.0.1'),
50
+            'port' => env('DB_PORT', '3306'),
51
+            'database' => env('DB_DATABASE', 'forge'),
52
+            'username' => env('DB_USERNAME', 'forge'),
53
+            'password' => env('DB_PASSWORD', ''),
54
+            'unix_socket' => env('DB_SOCKET', ''),
55
+            'charset' => 'utf8mb4',
56
+            'collation' => 'utf8mb4_unicode_ci',
57
+            'prefix' => '',
58
+            'prefix_indexes' => true,
59
+            'strict' => false,
60
+            'engine' => null,
61
+            'options' => extension_loaded('pdo_mysql') ? array_filter([
62
+                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
63
+            ]) : [],
64
+        ],
65
+
66
+        'pgsql' => [
67
+            'driver' => 'pgsql',
68
+            'url' => env('DATABASE_URL'),
69
+            'host' => env('DB_HOST', '127.0.0.1'),
70
+            'port' => env('DB_PORT', '5432'),
71
+            'database' => env('DB_DATABASE', 'forge'),
72
+            'username' => env('DB_USERNAME', 'forge'),
73
+            'password' => env('DB_PASSWORD', ''),
74
+            'charset' => 'utf8',
75
+            'prefix' => '',
76
+            'prefix_indexes' => true,
77
+            'schema' => 'public',
78
+            'sslmode' => 'prefer',
79
+        ],
80
+
81
+        'sqlsrv' => [
82
+            'driver' => 'sqlsrv',
83
+            'url' => env('DATABASE_URL'),
84
+            'host' => env('DB_HOST', 'localhost'),
85
+            'port' => env('DB_PORT', '1433'),
86
+            'database' => env('DB_DATABASE', 'forge'),
87
+            'username' => env('DB_USERNAME', 'forge'),
88
+            'password' => env('DB_PASSWORD', ''),
89
+            'charset' => 'utf8',
90
+            'prefix' => '',
91
+            'prefix_indexes' => true,
92
+        ],
93
+
94
+    ],
95
+
96
+    /*
97
+    |--------------------------------------------------------------------------
98
+    | Migration Repository Table
99
+    |--------------------------------------------------------------------------
100
+    |
101
+    | This table keeps track of all the migrations that have already run for
102
+    | your application. Using this information, we can determine which of
103
+    | the migrations on disk haven't actually been run in the database.
104
+    |
105
+    */
106
+
107
+    'migrations' => 'migrations',
108
+
109
+    /*
110
+    |--------------------------------------------------------------------------
111
+    | Redis Databases
112
+    |--------------------------------------------------------------------------
113
+    |
114
+    | Redis is an open source, fast, and advanced key-value store that also
115
+    | provides a richer body of commands than a typical key-value system
116
+    | such as APC or Memcached. Laravel makes it easy to dig right in.
117
+    |
118
+    */
119
+
120
+    'redis' => [
121
+
122
+        'client' => env('REDIS_CLIENT', 'phpredis'),
123
+
124
+        'options' => [
125
+            'cluster' => env('REDIS_CLUSTER', 'redis'),
126
+            'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
127
+        ],
128
+
129
+        'default' => [
130
+            'url' => env('REDIS_URL'),
131
+            'host' => env('REDIS_HOST', '127.0.0.1'),
132
+            'password' => env('REDIS_PASSWORD', null),
133
+            'port' => env('REDIS_PORT', '6379'),
134
+            'database' => env('REDIS_DB', '0'),
135
+        ],
136
+
137
+        'cache' => [
138
+            'url' => env('REDIS_URL'),
139
+            'host' => env('REDIS_HOST', '127.0.0.1'),
140
+            'password' => env('REDIS_PASSWORD', null),
141
+            'port' => env('REDIS_PORT', '6379'),
142
+            'database' => env('REDIS_CACHE_DB', '1'),
143
+        ],
144
+
145
+    ],
146
+
147
+];

+ 73
- 0
config/filesystems.php Voir le fichier

@@ -0,0 +1,73 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Default Filesystem Disk
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | Here you may specify the default filesystem disk that should be used
11
+    | by the framework. The "local" disk, as well as a variety of cloud
12
+    | based disks are available to your application. Just store away!
13
+    |
14
+    */
15
+
16
+    'default' => env('FILESYSTEM_DRIVER', 'local'),
17
+
18
+    /*
19
+    |--------------------------------------------------------------------------
20
+    | Filesystem Disks
21
+    |--------------------------------------------------------------------------
22
+    |
23
+    | Here you may configure as many filesystem "disks" as you wish, and you
24
+    | may even configure multiple disks of the same driver. Defaults have
25
+    | been setup for each driver as an example of the required options.
26
+    |
27
+    | Supported Drivers: "local", "ftp", "sftp", "s3"
28
+    |
29
+    */
30
+
31
+    'disks' => [
32
+
33
+        'local' => [
34
+            'driver' => 'local',
35
+            'root' => storage_path('app'),
36
+        ],
37
+
38
+        'public' => [
39
+            'driver' => 'local',
40
+            'root' => storage_path('app/public'),
41
+            'url' => env('APP_URL').'/storage',
42
+            'visibility' => 'public',
43
+        ],
44
+
45
+        's3' => [
46
+            'driver' => 's3',
47
+            'key' => env('AWS_ACCESS_KEY_ID'),
48
+            'secret' => env('AWS_SECRET_ACCESS_KEY'),
49
+            'region' => env('AWS_DEFAULT_REGION'),
50
+            'bucket' => env('AWS_BUCKET'),
51
+            'url' => env('AWS_URL'),
52
+            'endpoint' => env('AWS_ENDPOINT'),
53
+            'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
54
+        ],
55
+
56
+    ],
57
+
58
+    /*
59
+    |--------------------------------------------------------------------------
60
+    | Symbolic Links
61
+    |--------------------------------------------------------------------------
62
+    |
63
+    | Here you may configure the symbolic links that will be created when the
64
+    | `storage:link` Artisan command is executed. The array keys should be
65
+    | the locations of the links and the values should be their targets.
66
+    |
67
+    */
68
+
69
+    'links' => [
70
+        public_path('storage') => storage_path('app/public'),
71
+    ],
72
+
73
+];

+ 52
- 0
config/hashing.php Voir le fichier

@@ -0,0 +1,52 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Default Hash Driver
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | This option controls the default hash driver that will be used to hash
11
+    | passwords for your application. By default, the bcrypt algorithm is
12
+    | used; however, you remain free to modify this option if you wish.
13
+    |
14
+    | Supported: "bcrypt", "argon", "argon2id"
15
+    |
16
+    */
17
+
18
+    'driver' => 'bcrypt',
19
+
20
+    /*
21
+    |--------------------------------------------------------------------------
22
+    | Bcrypt Options
23
+    |--------------------------------------------------------------------------
24
+    |
25
+    | Here you may specify the configuration options that should be used when
26
+    | passwords are hashed using the Bcrypt algorithm. This will allow you
27
+    | to control the amount of time it takes to hash the given password.
28
+    |
29
+    */
30
+
31
+    'bcrypt' => [
32
+        'rounds' => env('BCRYPT_ROUNDS', 10),
33
+    ],
34
+
35
+    /*
36
+    |--------------------------------------------------------------------------
37
+    | Argon Options
38
+    |--------------------------------------------------------------------------
39
+    |
40
+    | Here you may specify the configuration options that should be used when
41
+    | passwords are hashed using the Argon algorithm. These will allow you
42
+    | to control the amount of time it takes to hash the given password.
43
+    |
44
+    */
45
+
46
+    'argon' => [
47
+        'memory' => 65536,
48
+        'threads' => 1,
49
+        'time' => 4,
50
+    ],
51
+
52
+];

+ 118
- 0
config/logging.php Voir le fichier

@@ -0,0 +1,118 @@
1
+<?php
2
+
3
+use Monolog\Handler\NullHandler;
4
+use Monolog\Handler\StreamHandler;
5
+use Monolog\Handler\SyslogUdpHandler;
6
+
7
+return [
8
+
9
+    /*
10
+    |--------------------------------------------------------------------------
11
+    | Default Log Channel
12
+    |--------------------------------------------------------------------------
13
+    |
14
+    | This option defines the default log channel that gets used when writing
15
+    | messages to the logs. The name specified in this option should match
16
+    | one of the channels defined in the "channels" configuration array.
17
+    |
18
+    */
19
+
20
+    'default' => env('LOG_CHANNEL', 'stack'),
21
+
22
+    /*
23
+    |--------------------------------------------------------------------------
24
+    | Deprecations Log Channel
25
+    |--------------------------------------------------------------------------
26
+    |
27
+    | This option controls the log channel that should be used to log warnings
28
+    | regarding deprecated PHP and library features. This allows you to get
29
+    | your application ready for upcoming major versions of dependencies.
30
+    |
31
+    */
32
+
33
+    'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
34
+
35
+    /*
36
+    |--------------------------------------------------------------------------
37
+    | Log Channels
38
+    |--------------------------------------------------------------------------
39
+    |
40
+    | Here you may configure the log channels for your application. Out of
41
+    | the box, Laravel uses the Monolog PHP logging library. This gives
42
+    | you a variety of powerful log handlers / formatters to utilize.
43
+    |
44
+    | Available Drivers: "single", "daily", "slack", "syslog",
45
+    |                    "errorlog", "monolog",
46
+    |                    "custom", "stack"
47
+    |
48
+    */
49
+
50
+    'channels' => [
51
+        'stack' => [
52
+            'driver' => 'stack',
53
+            'channels' => ['single'],
54
+            'ignore_exceptions' => false,
55
+        ],
56
+
57
+        'single' => [
58
+            'driver' => 'single',
59
+            'path' => storage_path('logs/laravel.log'),
60
+            'level' => env('LOG_LEVEL', 'debug'),
61
+        ],
62
+
63
+        'daily' => [
64
+            'driver' => 'daily',
65
+            'path' => storage_path('logs/laravel.log'),
66
+            'level' => env('LOG_LEVEL', 'debug'),
67
+            'days' => 14,
68
+        ],
69
+
70
+        'slack' => [
71
+            'driver' => 'slack',
72
+            'url' => env('LOG_SLACK_WEBHOOK_URL'),
73
+            'username' => 'Laravel Log',
74
+            'emoji' => ':boom:',
75
+            'level' => env('LOG_LEVEL', 'critical'),
76
+        ],
77
+
78
+        'papertrail' => [
79
+            'driver' => 'monolog',
80
+            'level' => env('LOG_LEVEL', 'debug'),
81
+            'handler' => SyslogUdpHandler::class,
82
+            'handler_with' => [
83
+                'host' => env('PAPERTRAIL_URL'),
84
+                'port' => env('PAPERTRAIL_PORT'),
85
+            ],
86
+        ],
87
+
88
+        'stderr' => [
89
+            'driver' => 'monolog',
90
+            'level' => env('LOG_LEVEL', 'debug'),
91
+            'handler' => StreamHandler::class,
92
+            'formatter' => env('LOG_STDERR_FORMATTER'),
93
+            'with' => [
94
+                'stream' => 'php://stderr',
95
+            ],
96
+        ],
97
+
98
+        'syslog' => [
99
+            'driver' => 'syslog',
100
+            'level' => env('LOG_LEVEL', 'debug'),
101
+        ],
102
+
103
+        'errorlog' => [
104
+            'driver' => 'errorlog',
105
+            'level' => env('LOG_LEVEL', 'debug'),
106
+        ],
107
+
108
+        'null' => [
109
+            'driver' => 'monolog',
110
+            'handler' => NullHandler::class,
111
+        ],
112
+
113
+        'emergency' => [
114
+            'path' => storage_path('logs/laravel.log'),
115
+        ],
116
+    ],
117
+
118
+];

+ 118
- 0
config/mail.php Voir le fichier

@@ -0,0 +1,118 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Default Mailer
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | This option controls the default mailer that is used to send any email
11
+    | messages sent by your application. Alternative mailers may be setup
12
+    | and used as needed; however, this mailer will be used by default.
13
+    |
14
+    */
15
+
16
+    'default' => env('MAIL_MAILER', 'smtp'),
17
+
18
+    /*
19
+    |--------------------------------------------------------------------------
20
+    | Mailer Configurations
21
+    |--------------------------------------------------------------------------
22
+    |
23
+    | Here you may configure all of the mailers used by your application plus
24
+    | their respective settings. Several examples have been configured for
25
+    | you and you are free to add your own as your application requires.
26
+    |
27
+    | Laravel supports a variety of mail "transport" drivers to be used while
28
+    | sending an e-mail. You will specify which one you are using for your
29
+    | mailers below. You are free to add additional mailers as required.
30
+    |
31
+    | Supported: "smtp", "sendmail", "mailgun", "ses",
32
+    |            "postmark", "log", "array", "failover"
33
+    |
34
+    */
35
+
36
+    'mailers' => [
37
+        'smtp' => [
38
+            'transport' => 'smtp',
39
+            'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
40
+            'port' => env('MAIL_PORT', 587),
41
+            'encryption' => env('MAIL_ENCRYPTION', 'tls'),
42
+            'username' => env('MAIL_USERNAME'),
43
+            'password' => env('MAIL_PASSWORD'),
44
+            'timeout' => null,
45
+            'auth_mode' => null,
46
+        ],
47
+
48
+        'ses' => [
49
+            'transport' => 'ses',
50
+        ],
51
+
52
+        'mailgun' => [
53
+            'transport' => 'mailgun',
54
+        ],
55
+
56
+        'postmark' => [
57
+            'transport' => 'postmark',
58
+        ],
59
+
60
+        'sendmail' => [
61
+            'transport' => 'sendmail',
62
+            'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -t -i'),
63
+        ],
64
+
65
+        'log' => [
66
+            'transport' => 'log',
67
+            'channel' => env('MAIL_LOG_CHANNEL'),
68
+        ],
69
+
70
+        'array' => [
71
+            'transport' => 'array',
72
+        ],
73
+
74
+        'failover' => [
75
+            'transport' => 'failover',
76
+            'mailers' => [
77
+                'smtp',
78
+                'log',
79
+            ],
80
+        ],
81
+    ],
82
+
83
+    /*
84
+    |--------------------------------------------------------------------------
85
+    | Global "From" Address
86
+    |--------------------------------------------------------------------------
87
+    |
88
+    | You may wish for all e-mails sent by your application to be sent from
89
+    | the same address. Here, you may specify a name and address that is
90
+    | used globally for all e-mails that are sent by your application.
91
+    |
92
+    */
93
+
94
+    'from' => [
95
+        'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
96
+        'name' => env('MAIL_FROM_NAME', 'Example'),
97
+    ],
98
+
99
+    /*
100
+    |--------------------------------------------------------------------------
101
+    | Markdown Mail Settings
102
+    |--------------------------------------------------------------------------
103
+    |
104
+    | If you are using Markdown based email rendering, you may configure your
105
+    | theme and component paths here, allowing you to customize the design
106
+    | of the emails. Or, you may simply stick with the Laravel defaults!
107
+    |
108
+    */
109
+
110
+    'markdown' => [
111
+        'theme' => 'default',
112
+
113
+        'paths' => [
114
+            resource_path('views/vendor/mail'),
115
+        ],
116
+    ],
117
+
118
+];

+ 161
- 0
config/permission.php Voir le fichier

@@ -0,0 +1,161 @@
1
+<?php
2
+
3
+return [
4
+
5
+    'models' => [
6
+
7
+        /*
8
+         * When using the "HasPermissions" trait from this package, we need to know which
9
+         * Eloquent model should be used to retrieve your permissions. Of course, it
10
+         * is often just the "Permission" model but you may use whatever you like.
11
+         *
12
+         * The model you want to use as a Permission model needs to implement the
13
+         * `Spatie\Permission\Contracts\Permission` contract.
14
+         */
15
+
16
+        'permission' => Spatie\Permission\Models\Permission::class,
17
+
18
+        /*
19
+         * When using the "HasRoles" trait from this package, we need to know which
20
+         * Eloquent model should be used to retrieve your roles. Of course, it
21
+         * is often just the "Role" model but you may use whatever you like.
22
+         *
23
+         * The model you want to use as a Role model needs to implement the
24
+         * `Spatie\Permission\Contracts\Role` contract.
25
+         */
26
+
27
+        'role' => Spatie\Permission\Models\Role::class,
28
+
29
+    ],
30
+
31
+    'table_names' => [
32
+
33
+        /*
34
+         * When using the "HasRoles" trait from this package, we need to know which
35
+         * table should be used to retrieve your roles. We have chosen a basic
36
+         * default value but you may easily change it to any table you like.
37
+         */
38
+
39
+        'roles' => 'roles',
40
+
41
+        /*
42
+         * When using the "HasPermissions" trait from this package, we need to know which
43
+         * table should be used to retrieve your permissions. We have chosen a basic
44
+         * default value but you may easily change it to any table you like.
45
+         */
46
+
47
+        'permissions' => 'permissions',
48
+
49
+        /*
50
+         * When using the "HasPermissions" trait from this package, we need to know which
51
+         * table should be used to retrieve your models permissions. We have chosen a
52
+         * basic default value but you may easily change it to any table you like.
53
+         */
54
+
55
+        'model_has_permissions' => 'model_has_permissions',
56
+
57
+        /*
58
+         * When using the "HasRoles" trait from this package, we need to know which
59
+         * table should be used to retrieve your models roles. We have chosen a
60
+         * basic default value but you may easily change it to any table you like.
61
+         */
62
+
63
+        'model_has_roles' => 'model_has_roles',
64
+
65
+        /*
66
+         * When using the "HasRoles" trait from this package, we need to know which
67
+         * table should be used to retrieve your roles permissions. We have chosen a
68
+         * basic default value but you may easily change it to any table you like.
69
+         */
70
+
71
+        'role_has_permissions' => 'role_has_permissions',
72
+    ],
73
+
74
+    'column_names' => [
75
+        /*
76
+         * Change this if you want to name the related pivots other than defaults
77
+         */
78
+        'role_pivot_key' => null, //default 'role_id',
79
+        'permission_pivot_key' => null, //default 'permission_id',
80
+
81
+        /*
82
+         * Change this if you want to name the related model primary key other than
83
+         * `model_id`.
84
+         *
85
+         * For example, this would be nice if your primary keys are all UUIDs. In
86
+         * that case, name this `model_uuid`.
87
+         */
88
+
89
+        'model_morph_key' => 'model_id',
90
+
91
+        /*
92
+         * Change this if you want to use the teams feature and your related model's
93
+         * foreign key is other than `team_id`.
94
+         */
95
+
96
+        'team_foreign_key' => 'team_id',
97
+    ],
98
+
99
+    /*
100
+     * When set to true, the method for checking permissions will be registered on the gate.
101
+     * Set this to false, if you want to implement custom logic for checking permissions.
102
+     */
103
+
104
+    'register_permission_check_method' => true,
105
+
106
+    /*
107
+     * When set to true the package implements teams using the 'team_foreign_key'. If you want
108
+     * the migrations to register the 'team_foreign_key', you must set this to true
109
+     * before doing the migration. If you already did the migration then you must make a new
110
+     * migration to also add 'team_foreign_key' to 'roles', 'model_has_roles', and
111
+     * 'model_has_permissions'(view the latest version of package's migration file)
112
+     */
113
+
114
+    'teams' => false,
115
+
116
+    /*
117
+     * When set to true, the required permission names are added to the exception
118
+     * message. This could be considered an information leak in some contexts, so
119
+     * the default setting is false here for optimum safety.
120
+     */
121
+
122
+    'display_permission_in_exception' => false,
123
+
124
+    /*
125
+     * When set to true, the required role names are added to the exception
126
+     * message. This could be considered an information leak in some contexts, so
127
+     * the default setting is false here for optimum safety.
128
+     */
129
+
130
+    'display_role_in_exception' => false,
131
+
132
+    /*
133
+     * By default wildcard permission lookups are disabled.
134
+     */
135
+
136
+    'enable_wildcard_permission' => false,
137
+
138
+    'cache' => [
139
+
140
+        /*
141
+         * By default all permissions are cached for 24 hours to speed up performance.
142
+         * When permissions or roles are updated the cache is flushed automatically.
143
+         */
144
+
145
+        'expiration_time' => \DateInterval::createFromDateString('24 hours'),
146
+
147
+        /*
148
+         * The cache key used to store all permissions.
149
+         */
150
+
151
+        'key' => 'spatie.permission.cache',
152
+
153
+        /*
154
+         * You may optionally indicate a specific cache driver to use for permission and
155
+         * role caching using any of the `store` drivers listed in the cache.php config
156
+         * file. Using 'default' here means to use the `default` set in cache.php.
157
+         */
158
+
159
+        'store' => 'default',
160
+    ],
161
+];

+ 93
- 0
config/queue.php Voir le fichier

@@ -0,0 +1,93 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Default Queue Connection Name
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | Laravel's queue API supports an assortment of back-ends via a single
11
+    | API, giving you convenient access to each back-end using the same
12
+    | syntax for every one. Here you may define a default connection.
13
+    |
14
+    */
15
+
16
+    'default' => env('QUEUE_CONNECTION', 'sync'),
17
+
18
+    /*
19
+    |--------------------------------------------------------------------------
20
+    | Queue Connections
21
+    |--------------------------------------------------------------------------
22
+    |
23
+    | Here you may configure the connection information for each server that
24
+    | is used by your application. A default configuration has been added
25
+    | for each back-end shipped with Laravel. You are free to add more.
26
+    |
27
+    | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
28
+    |
29
+    */
30
+
31
+    'connections' => [
32
+
33
+        'sync' => [
34
+            'driver' => 'sync',
35
+        ],
36
+
37
+        'database' => [
38
+            'driver' => 'database',
39
+            'table' => 'jobs',
40
+            'queue' => 'default',
41
+            'retry_after' => 90,
42
+            'after_commit' => false,
43
+        ],
44
+
45
+        'beanstalkd' => [
46
+            'driver' => 'beanstalkd',
47
+            'host' => 'localhost',
48
+            'queue' => 'default',
49
+            'retry_after' => 90,
50
+            'block_for' => 0,
51
+            'after_commit' => false,
52
+        ],
53
+
54
+        'sqs' => [
55
+            'driver' => 'sqs',
56
+            'key' => env('AWS_ACCESS_KEY_ID'),
57
+            'secret' => env('AWS_SECRET_ACCESS_KEY'),
58
+            'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
59
+            'queue' => env('SQS_QUEUE', 'default'),
60
+            'suffix' => env('SQS_SUFFIX'),
61
+            'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
62
+            'after_commit' => false,
63
+        ],
64
+
65
+        'redis' => [
66
+            'driver' => 'redis',
67
+            'connection' => 'default',
68
+            'queue' => env('REDIS_QUEUE', 'default'),
69
+            'retry_after' => 90,
70
+            'block_for' => null,
71
+            'after_commit' => false,
72
+        ],
73
+
74
+    ],
75
+
76
+    /*
77
+    |--------------------------------------------------------------------------
78
+    | Failed Queue Jobs
79
+    |--------------------------------------------------------------------------
80
+    |
81
+    | These options configure the behavior of failed queue job logging so you
82
+    | can control which database and table are used to store the jobs that
83
+    | have failed. You may change them to any database / table you wish.
84
+    |
85
+    */
86
+
87
+    'failed' => [
88
+        'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
89
+        'database' => env('DB_CONNECTION', 'mysql'),
90
+        'table' => 'failed_jobs',
91
+    ],
92
+
93
+];

+ 9
- 0
config/redmine.php Voir le fichier

@@ -0,0 +1,9 @@
1
+<?php
2
+
3
+return [
4
+  'url' => env('REDMINE_URL', 'Laravel'),
5
+  'user' => env('REDMINE_USER', 'Laravel'),
6
+  'password' => env('REDMINE_PWD', 'Laravel')
7
+]
8
+
9
+  ?>

+ 65
- 0
config/sanctum.php Voir le fichier

@@ -0,0 +1,65 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Stateful Domains
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | Requests from the following domains / hosts will receive stateful API
11
+    | authentication cookies. Typically, these should include your local
12
+    | and production domains which access your API via a frontend SPA.
13
+    |
14
+    */
15
+
16
+    'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
17
+        '%s%s',
18
+        'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
19
+        env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : ''
20
+    ))),
21
+
22
+    /*
23
+    |--------------------------------------------------------------------------
24
+    | Sanctum Guards
25
+    |--------------------------------------------------------------------------
26
+    |
27
+    | This array contains the authentication guards that will be checked when
28
+    | Sanctum is trying to authenticate a request. If none of these guards
29
+    | are able to authenticate the request, Sanctum will use the bearer
30
+    | token that's present on an incoming request for authentication.
31
+    |
32
+    */
33
+
34
+    'guard' => ['web'],
35
+
36
+    /*
37
+    |--------------------------------------------------------------------------
38
+    | Expiration Minutes
39
+    |--------------------------------------------------------------------------
40
+    |
41
+    | This value controls the number of minutes until an issued token will be
42
+    | considered expired. If this value is null, personal access tokens do
43
+    | not expire. This won't tweak the lifetime of first-party sessions.
44
+    |
45
+    */
46
+
47
+    'expiration' => null,
48
+
49
+    /*
50
+    |--------------------------------------------------------------------------
51
+    | Sanctum Middleware
52
+    |--------------------------------------------------------------------------
53
+    |
54
+    | When authenticating your first-party SPA with Sanctum you may need to
55
+    | customize some of the middleware Sanctum uses while processing the
56
+    | request. You may change the middleware listed below as required.
57
+    |
58
+    */
59
+
60
+    'middleware' => [
61
+        'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
62
+        'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
63
+    ],
64
+
65
+];

+ 33
- 0
config/services.php Voir le fichier

@@ -0,0 +1,33 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Third Party Services
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | This file is for storing the credentials for third party services such
11
+    | as Mailgun, Postmark, AWS and more. This file provides the de facto
12
+    | location for this type of information, allowing packages to have
13
+    | a conventional file to locate the various service credentials.
14
+    |
15
+    */
16
+
17
+    'mailgun' => [
18
+        'domain' => env('MAILGUN_DOMAIN'),
19
+        'secret' => env('MAILGUN_SECRET'),
20
+        'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
21
+    ],
22
+
23
+    'postmark' => [
24
+        'token' => env('POSTMARK_TOKEN'),
25
+    ],
26
+
27
+    'ses' => [
28
+        'key' => env('AWS_ACCESS_KEY_ID'),
29
+        'secret' => env('AWS_SECRET_ACCESS_KEY'),
30
+        'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
31
+    ],
32
+
33
+];

+ 201
- 0
config/session.php Voir le fichier

@@ -0,0 +1,201 @@
1
+<?php
2
+
3
+use Illuminate\Support\Str;
4
+
5
+return [
6
+
7
+    /*
8
+    |--------------------------------------------------------------------------
9
+    | Default Session Driver
10
+    |--------------------------------------------------------------------------
11
+    |
12
+    | This option controls the default session "driver" that will be used on
13
+    | requests. By default, we will use the lightweight native driver but
14
+    | you may specify any of the other wonderful drivers provided here.
15
+    |
16
+    | Supported: "file", "cookie", "database", "apc",
17
+    |            "memcached", "redis", "dynamodb", "array"
18
+    |
19
+    */
20
+
21
+    'driver' => env('SESSION_DRIVER', 'file'),
22
+
23
+    /*
24
+    |--------------------------------------------------------------------------
25
+    | Session Lifetime
26
+    |--------------------------------------------------------------------------
27
+    |
28
+    | Here you may specify the number of minutes that you wish the session
29
+    | to be allowed to remain idle before it expires. If you want them
30
+    | to immediately expire on the browser closing, set that option.
31
+    |
32
+    */
33
+
34
+    'lifetime' => env('SESSION_LIFETIME', 120),
35
+
36
+    'expire_on_close' => false,
37
+
38
+    /*
39
+    |--------------------------------------------------------------------------
40
+    | Session Encryption
41
+    |--------------------------------------------------------------------------
42
+    |
43
+    | This option allows you to easily specify that all of your session data
44
+    | should be encrypted before it is stored. All encryption will be run
45
+    | automatically by Laravel and you can use the Session like normal.
46
+    |
47
+    */
48
+
49
+    'encrypt' => false,
50
+
51
+    /*
52
+    |--------------------------------------------------------------------------
53
+    | Session File Location
54
+    |--------------------------------------------------------------------------
55
+    |
56
+    | When using the native session driver, we need a location where session
57
+    | files may be stored. A default has been set for you but a different
58
+    | location may be specified. This is only needed for file sessions.
59
+    |
60
+    */
61
+
62
+    'files' => storage_path('framework/sessions'),
63
+
64
+    /*
65
+    |--------------------------------------------------------------------------
66
+    | Session Database Connection
67
+    |--------------------------------------------------------------------------
68
+    |
69
+    | When using the "database" or "redis" session drivers, you may specify a
70
+    | connection that should be used to manage these sessions. This should
71
+    | correspond to a connection in your database configuration options.
72
+    |
73
+    */
74
+
75
+    'connection' => env('SESSION_CONNECTION', null),
76
+
77
+    /*
78
+    |--------------------------------------------------------------------------
79
+    | Session Database Table
80
+    |--------------------------------------------------------------------------
81
+    |
82
+    | When using the "database" session driver, you may specify the table we
83
+    | should use to manage the sessions. Of course, a sensible default is
84
+    | provided for you; however, you are free to change this as needed.
85
+    |
86
+    */
87
+
88
+    'table' => 'sessions',
89
+
90
+    /*
91
+    |--------------------------------------------------------------------------
92
+    | Session Cache Store
93
+    |--------------------------------------------------------------------------
94
+    |
95
+    | While using one of the framework's cache driven session backends you may
96
+    | list a cache store that should be used for these sessions. This value
97
+    | must match with one of the application's configured cache "stores".
98
+    |
99
+    | Affects: "apc", "dynamodb", "memcached", "redis"
100
+    |
101
+    */
102
+
103
+    'store' => env('SESSION_STORE', null),
104
+
105
+    /*
106
+    |--------------------------------------------------------------------------
107
+    | Session Sweeping Lottery
108
+    |--------------------------------------------------------------------------
109
+    |
110
+    | Some session drivers must manually sweep their storage location to get
111
+    | rid of old sessions from storage. Here are the chances that it will
112
+    | happen on a given request. By default, the odds are 2 out of 100.
113
+    |
114
+    */
115
+
116
+    'lottery' => [2, 100],
117
+
118
+    /*
119
+    |--------------------------------------------------------------------------
120
+    | Session Cookie Name
121
+    |--------------------------------------------------------------------------
122
+    |
123
+    | Here you may change the name of the cookie used to identify a session
124
+    | instance by ID. The name specified here will get used every time a
125
+    | new session cookie is created by the framework for every driver.
126
+    |
127
+    */
128
+
129
+    'cookie' => env(
130
+        'SESSION_COOKIE',
131
+        Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
132
+    ),
133
+
134
+    /*
135
+    |--------------------------------------------------------------------------
136
+    | Session Cookie Path
137
+    |--------------------------------------------------------------------------
138
+    |
139
+    | The session cookie path determines the path for which the cookie will
140
+    | be regarded as available. Typically, this will be the root path of
141
+    | your application but you are free to change this when necessary.
142
+    |
143
+    */
144
+
145
+    'path' => '/',
146
+
147
+    /*
148
+    |--------------------------------------------------------------------------
149
+    | Session Cookie Domain
150
+    |--------------------------------------------------------------------------
151
+    |
152
+    | Here you may change the domain of the cookie used to identify a session
153
+    | in your application. This will determine which domains the cookie is
154
+    | available to in your application. A sensible default has been set.
155
+    |
156
+    */
157
+
158
+    'domain' => env('SESSION_DOMAIN', null),
159
+
160
+    /*
161
+    |--------------------------------------------------------------------------
162
+    | HTTPS Only Cookies
163
+    |--------------------------------------------------------------------------
164
+    |
165
+    | By setting this option to true, session cookies will only be sent back
166
+    | to the server if the browser has a HTTPS connection. This will keep
167
+    | the cookie from being sent to you when it can't be done securely.
168
+    |
169
+    */
170
+
171
+    'secure' => env('SESSION_SECURE_COOKIE'),
172
+
173
+    /*
174
+    |--------------------------------------------------------------------------
175
+    | HTTP Access Only
176
+    |--------------------------------------------------------------------------
177
+    |
178
+    | Setting this value to true will prevent JavaScript from accessing the
179
+    | value of the cookie and the cookie will only be accessible through
180
+    | the HTTP protocol. You are free to modify this option if needed.
181
+    |
182
+    */
183
+
184
+    'http_only' => true,
185
+
186
+    /*
187
+    |--------------------------------------------------------------------------
188
+    | Same-Site Cookies
189
+    |--------------------------------------------------------------------------
190
+    |
191
+    | This option determines how your cookies behave when cross-site requests
192
+    | take place, and can be used to mitigate CSRF attacks. By default, we
193
+    | will set this value to "lax" since this is a secure default value.
194
+    |
195
+    | Supported: "lax", "strict", "none", null
196
+    |
197
+    */
198
+
199
+    'same_site' => 'lax',
200
+
201
+];

+ 36
- 0
config/view.php Voir le fichier

@@ -0,0 +1,36 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | View Storage Paths
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | Most templating systems load templates from disk. Here you may specify
11
+    | an array of paths that should be checked for your views. Of course
12
+    | the usual Laravel view path has already been registered for you.
13
+    |
14
+    */
15
+
16
+    'paths' => [
17
+        resource_path('views'),
18
+    ],
19
+
20
+    /*
21
+    |--------------------------------------------------------------------------
22
+    | Compiled View Path
23
+    |--------------------------------------------------------------------------
24
+    |
25
+    | This option determines where all the compiled Blade templates will be
26
+    | stored for your application. Typically, this is within the storage
27
+    | directory. However, as usual, you are free to change this value.
28
+    |
29
+    */
30
+
31
+    'compiled' => env(
32
+        'VIEW_COMPILED_PATH',
33
+        realpath(storage_path('framework/views'))
34
+    ),
35
+
36
+];

+ 1
- 0
database/.gitignore Voir le fichier

@@ -0,0 +1 @@
1
+*.sqlite*

+ 39
- 0
database/factories/UserFactory.php Voir le fichier

@@ -0,0 +1,39 @@
1
+<?php
2
+
3
+namespace Database\Factories;
4
+
5
+use Illuminate\Database\Eloquent\Factories\Factory;
6
+use Illuminate\Support\Str;
7
+
8
+class UserFactory extends Factory
9
+{
10
+    /**
11
+     * Define the model's default state.
12
+     *
13
+     * @return array
14
+     */
15
+    public function definition()
16
+    {
17
+        return [
18
+            'name' => $this->faker->name(),
19
+            'email' => $this->faker->unique()->safeEmail(),
20
+            'email_verified_at' => now(),
21
+            'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
22
+            'remember_token' => Str::random(10),
23
+        ];
24
+    }
25
+
26
+    /**
27
+     * Indicate that the model's email address should be unverified.
28
+     *
29
+     * @return \Illuminate\Database\Eloquent\Factories\Factory
30
+     */
31
+    public function unverified()
32
+    {
33
+        return $this->state(function (array $attributes) {
34
+            return [
35
+                'email_verified_at' => null,
36
+            ];
37
+        });
38
+    }
39
+}

+ 32
- 0
database/migrations/2014_10_12_100000_create_password_resets_table.php Voir le fichier

@@ -0,0 +1,32 @@
1
+<?php
2
+
3
+use Illuminate\Database\Migrations\Migration;
4
+use Illuminate\Database\Schema\Blueprint;
5
+use Illuminate\Support\Facades\Schema;
6
+
7
+class CreatePasswordResetsTable extends Migration
8
+{
9
+    /**
10
+     * Run the migrations.
11
+     *
12
+     * @return void
13
+     */
14
+    public function up()
15
+    {
16
+        Schema::create('password_resets', function (Blueprint $table) {
17
+            $table->string('email')->index();
18
+            $table->string('token');
19
+            $table->timestamp('created_at')->nullable();
20
+        });
21
+    }
22
+
23
+    /**
24
+     * Reverse the migrations.
25
+     *
26
+     * @return void
27
+     */
28
+    public function down()
29
+    {
30
+        Schema::dropIfExists('password_resets');
31
+    }
32
+}

+ 36
- 0
database/migrations/2019_08_19_000000_create_failed_jobs_table.php Voir le fichier

@@ -0,0 +1,36 @@
1
+<?php
2
+
3
+use Illuminate\Database\Migrations\Migration;
4
+use Illuminate\Database\Schema\Blueprint;
5
+use Illuminate\Support\Facades\Schema;
6
+
7
+class CreateFailedJobsTable extends Migration
8
+{
9
+    /**
10
+     * Run the migrations.
11
+     *
12
+     * @return void
13
+     */
14
+    public function up()
15
+    {
16
+        Schema::create('failed_jobs', function (Blueprint $table) {
17
+            $table->id();
18
+            $table->string('uuid')->unique();
19
+            $table->text('connection');
20
+            $table->text('queue');
21
+            $table->longText('payload');
22
+            $table->longText('exception');
23
+            $table->timestamp('failed_at')->useCurrent();
24
+        });
25
+    }
26
+
27
+    /**
28
+     * Reverse the migrations.
29
+     *
30
+     * @return void
31
+     */
32
+    public function down()
33
+    {
34
+        Schema::dropIfExists('failed_jobs');
35
+    }
36
+}

+ 36
- 0
database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php Voir le fichier

@@ -0,0 +1,36 @@
1
+<?php
2
+
3
+use Illuminate\Database\Migrations\Migration;
4
+use Illuminate\Database\Schema\Blueprint;
5
+use Illuminate\Support\Facades\Schema;
6
+
7
+class CreatePersonalAccessTokensTable extends Migration
8
+{
9
+    /**
10
+     * Run the migrations.
11
+     *
12
+     * @return void
13
+     */
14
+    public function up()
15
+    {
16
+        Schema::create('personal_access_tokens', function (Blueprint $table) {
17
+            $table->id();
18
+            $table->morphs('tokenable');
19
+            $table->string('name');
20
+            $table->string('token', 64)->unique();
21
+            $table->text('abilities')->nullable();
22
+            $table->timestamp('last_used_at')->nullable();
23
+            $table->timestamps();
24
+        });
25
+    }
26
+
27
+    /**
28
+     * Reverse the migrations.
29
+     *
30
+     * @return void
31
+     */
32
+    public function down()
33
+    {
34
+        Schema::dropIfExists('personal_access_tokens');
35
+    }
36
+}

+ 144
- 0
database/migrations/2022_03_18_134442_create_permission_tables.php Voir le fichier

@@ -0,0 +1,144 @@
1
+<?php
2
+
3
+use Illuminate\Support\Facades\Schema;
4
+use Illuminate\Database\Schema\Blueprint;
5
+use Illuminate\Database\Migrations\Migration;
6
+use Spatie\Permission\PermissionRegistrar;
7
+
8
+class CreatePermissionTables extends Migration
9
+{
10
+    /**
11
+     * Run the migrations.
12
+     *
13
+     * @return void
14
+     */
15
+    public function up()
16
+    {
17
+        $tableNames = config('permission.table_names');
18
+        $columnNames = config('permission.column_names');
19
+        $teams = config('permission.teams');
20
+
21
+        if (empty($tableNames)) {
22
+            throw new \Exception('Error: config/permission.php not loaded. Run [php artisan config:clear] and try again.');
23
+        }
24
+        if ($teams && empty($columnNames['team_foreign_key'] ?? null)) {
25
+            throw new \Exception('Error: team_foreign_key on config/permission.php not loaded. Run [php artisan config:clear] and try again.');
26
+        }
27
+
28
+        Schema::create($tableNames['permissions'], function (Blueprint $table) {
29
+            $table->bigIncrements('id');
30
+            $table->string('name');       // For MySQL 8.0 use string('name', 125);
31
+            $table->string('display_name');
32
+            $table->string('group')->nullable();
33
+            $table->string('guard_name'); // For MySQL 8.0 use string('guard_name', 125);
34
+            $table->timestamps();
35
+
36
+            $table->unique(['name', 'guard_name']);
37
+        });
38
+
39
+        Schema::create($tableNames['roles'], function (Blueprint $table) use ($teams, $columnNames) {
40
+            $table->bigIncrements('id');
41
+            if ($teams || config('permission.testing')) { // permission.testing is a fix for sqlite testing
42
+                $table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable();
43
+                $table->index($columnNames['team_foreign_key'], 'roles_team_foreign_key_index');
44
+            }
45
+            $table->string('name');       // For MySQL 8.0 use string('name', 125);
46
+            $table->string('display_name');
47
+            $table->string('guard_name'); // For MySQL 8.0 use string('guard_name', 125);
48
+            $table->timestamps();
49
+            if ($teams || config('permission.testing')) {
50
+                $table->unique([$columnNames['team_foreign_key'], 'name', 'guard_name']);
51
+            } else {
52
+                $table->unique(['name', 'guard_name']);
53
+            }
54
+        });
55
+
56
+        Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames, $teams) {
57
+            $table->unsignedBigInteger(PermissionRegistrar::$pivotPermission);
58
+
59
+            $table->string('model_type');
60
+            $table->unsignedBigInteger($columnNames['model_morph_key']);
61
+            $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_model_id_model_type_index');
62
+
63
+            $table->foreign(PermissionRegistrar::$pivotPermission)
64
+                ->references('id')
65
+                ->on($tableNames['permissions'])
66
+                ->onDelete('cascade');
67
+            if ($teams) {
68
+                $table->unsignedBigInteger($columnNames['team_foreign_key']);
69
+                $table->index($columnNames['team_foreign_key'], 'model_has_permissions_team_foreign_key_index');
70
+
71
+                $table->primary([$columnNames['team_foreign_key'], PermissionRegistrar::$pivotPermission, $columnNames['model_morph_key'], 'model_type'],
72
+                    'model_has_permissions_permission_model_type_primary');
73
+            } else {
74
+                $table->primary([PermissionRegistrar::$pivotPermission, $columnNames['model_morph_key'], 'model_type'],
75
+                    'model_has_permissions_permission_model_type_primary');
76
+            }
77
+
78
+        });
79
+
80
+        Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames, $teams) {
81
+            $table->unsignedBigInteger(PermissionRegistrar::$pivotRole);
82
+
83
+            $table->string('model_type');
84
+            $table->unsignedBigInteger($columnNames['model_morph_key']);
85
+            $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_roles_model_id_model_type_index');
86
+
87
+            $table->foreign(PermissionRegistrar::$pivotRole)
88
+                ->references('id')
89
+                ->on($tableNames['roles'])
90
+                ->onDelete('cascade');
91
+            if ($teams) {
92
+                $table->unsignedBigInteger($columnNames['team_foreign_key']);
93
+                $table->index($columnNames['team_foreign_key'], 'model_has_roles_team_foreign_key_index');
94
+
95
+                $table->primary([$columnNames['team_foreign_key'], PermissionRegistrar::$pivotRole, $columnNames['model_morph_key'], 'model_type'],
96
+                    'model_has_roles_role_model_type_primary');
97
+            } else {
98
+                $table->primary([PermissionRegistrar::$pivotRole, $columnNames['model_morph_key'], 'model_type'],
99
+                    'model_has_roles_role_model_type_primary');
100
+            }
101
+        });
102
+
103
+        Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) {
104
+            $table->unsignedBigInteger(PermissionRegistrar::$pivotPermission);
105
+            $table->unsignedBigInteger(PermissionRegistrar::$pivotRole);
106
+
107
+            $table->foreign(PermissionRegistrar::$pivotPermission)
108
+                ->references('id')
109
+                ->on($tableNames['permissions'])
110
+                ->onDelete('cascade');
111
+
112
+            $table->foreign(PermissionRegistrar::$pivotRole)
113
+                ->references('id')
114
+                ->on($tableNames['roles'])
115
+                ->onDelete('cascade');
116
+
117
+            $table->primary([PermissionRegistrar::$pivotPermission, PermissionRegistrar::$pivotRole], 'role_has_permissions_permission_id_role_id_primary');
118
+        });
119
+
120
+        app('cache')
121
+            ->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null)
122
+            ->forget(config('permission.cache.key'));
123
+    }
124
+
125
+    /**
126
+     * Reverse the migrations.
127
+     *
128
+     * @return void
129
+     */
130
+    public function down()
131
+    {
132
+        $tableNames = config('permission.table_names');
133
+
134
+        if (empty($tableNames)) {
135
+            throw new \Exception('Error: config/permission.php not found and defaults could not be merged. Please publish the package configuration before proceeding, or drop the tables manually.');
136
+        }
137
+
138
+        Schema::drop($tableNames['role_has_permissions']);
139
+        Schema::drop($tableNames['model_has_roles']);
140
+        Schema::drop($tableNames['model_has_permissions']);
141
+        Schema::drop($tableNames['roles']);
142
+        Schema::drop($tableNames['permissions']);
143
+    }
144
+}

+ 54
- 0
database/migrations/2022_03_18_143813_skipper_migrations_2022031814381384.php Voir le fichier

@@ -0,0 +1,54 @@
1
+<?php
2
+/* 
3
+ * Migrations generated by: Skipper (http://www.skipper18.com)
4
+ * Migration id: 20640eb6-d377-431c-acd9-ee62c3411147
5
+ * Migration datetime: 2022-03-18 14:38:13.845660
6
+ */ 
7
+
8
+use Illuminate\Support\Facades\Schema;
9
+use Illuminate\Database\Schema\Blueprint;
10
+use Illuminate\Database\Migrations\Migration;
11
+
12
+class SkipperMigrations2022031814381384 extends Migration
13
+{
14
+    /**
15
+     * Run the migrations.
16
+     *
17
+     * @return void
18
+     */
19
+    public function up()
20
+    {
21
+        Schema::create('users', function (Blueprint $table) {
22
+            $table->bigInteger('id')->autoIncrement()->unsigned();
23
+            $table->string('nome')->nullable(true);
24
+            $table->string('cognome')->nullable(true);
25
+            $table->string('email')->nullable(true)->unique();
26
+            $table->string('password')->nullable(true);
27
+            $table->timestamp('email_verified_at')->nullable(true);
28
+            $table->string('remember_token')->nullable(true);
29
+            $table->timestamp('created_at')->nullable(true);
30
+            $table->timestamp('updated_at')->nullable(true);
31
+        });
32
+        Schema::create('config', function (Blueprint $table) {
33
+            $table->string('key');
34
+            $table->string('group')->nullable(true);
35
+            $table->string('display_name')->nullable(true);
36
+            $table->longText('value')->nullable(true);
37
+            $table->integer('order')->nullable(true);
38
+            $table->string('type')->nullable(true);
39
+            $table->timestamp('created_at')->nullable(true);
40
+            $table->timestamp('updated_at')->nullable(true);
41
+            $table->primary(['key']);
42
+        });
43
+    }
44
+    /**
45
+     * Reverse the migrations.
46
+     *
47
+     * @return void
48
+     */
49
+    public function down()
50
+    {
51
+        Schema::dropIfExists('config');
52
+        Schema::dropIfExists('users');
53
+    }
54
+}

+ 36
- 0
database/migrations/2022_03_18_162345_skipper_migrations_2022031816234578.php Voir le fichier

@@ -0,0 +1,36 @@
1
+<?php
2
+/* 
3
+ * Migrations generated by: Skipper (http://www.skipper18.com)
4
+ * Migration id: 64eca5de-6016-4960-98e3-6fdacb0e06e7
5
+ * Migration datetime: 2022-03-18 16:23:45.782882
6
+ */ 
7
+
8
+use Illuminate\Support\Facades\Schema;
9
+use Illuminate\Database\Schema\Blueprint;
10
+use Illuminate\Database\Migrations\Migration;
11
+
12
+class SkipperMigrations2022031816234578 extends Migration
13
+{
14
+    /**
15
+     * Run the migrations.
16
+     *
17
+     * @return void
18
+     */
19
+    public function up()
20
+    {
21
+        Schema::table('users', function (Blueprint $table) {
22
+            $table->string('progetti')->nullable(true)->after('remember_token');
23
+        });
24
+    }
25
+    /**
26
+     * Reverse the migrations.
27
+     *
28
+     * @return void
29
+     */
30
+    public function down()
31
+    {
32
+        Schema::table('users', function (Blueprint $table) {
33
+            $table->dropColumn('progetti');
34
+        });
35
+    }
36
+}

+ 34
- 0
database/seeders/AdminSeeder.php Voir le fichier

@@ -0,0 +1,34 @@
1
+<?php
2
+
3
+namespace Database\Seeders;
4
+
5
+use Illuminate\Database\Seeder;
6
+use Spatie\Permission\Models\Role;
7
+use Spatie\Permission\Models\Permission;
8
+use Carbon\Carbon;
9
+use Hash;
10
+
11
+class AdminSeeder extends Seeder
12
+{
13
+  /**
14
+  * Run the database seeds.
15
+  *
16
+  * @return void
17
+  */
18
+  public function run()
19
+  {
20
+    $user = \App\Models\User::where('email', 'info@elephantech.it')->first();
21
+    if($user == null){
22
+      $user = \App\Models\User::create([
23
+        'nome' => 'Admin',
24
+        'cognome' => 'Admin',
25
+        'email' => 'info@elephantech.it',
26
+        'password' => Hash::make('admin2022'),
27
+        'email_verified_at' => Carbon::now()]);
28
+        $user->save();
29
+
30
+        $role = Role::create(['name' => 'administrator']);
31
+        $user->assignRole('administrator');
32
+      }
33
+    }
34
+  }

+ 31
- 0
database/seeders/ConfigSeeder.php Voir le fichier

@@ -0,0 +1,31 @@
1
+<?php
2
+namespace Database\Seeders;
3
+
4
+use Illuminate\Database\Seeder;
5
+use App\Models\Config;
6
+
7
+class ConfigSeeder extends Seeder
8
+{
9
+  /**
10
+  * Run the database seeds.
11
+  *
12
+  * @return void
13
+  */
14
+  public function run()
15
+  {
16
+    foreach(Config::getConfig() as $key => $group){
17
+      $order = 1;
18
+      foreach($group as $key2 => $c){
19
+        $config = Config::find($c['key']);
20
+        if($config == null){
21
+          $config = new Config;
22
+          $config->fill($c);
23
+          $config->order = $order;
24
+          $config->group = $key;
25
+          $config->save();
26
+          $order++;
27
+        }
28
+      }
29
+    }
30
+  }
31
+}

+ 20
- 0
database/seeders/DatabaseSeeder.php Voir le fichier

@@ -0,0 +1,20 @@
1
+<?php
2
+
3
+namespace Database\Seeders;
4
+
5
+use Illuminate\Database\Seeder;
6
+
7
+class DatabaseSeeder extends Seeder
8
+{
9
+  /**
10
+  * Seed the application's database.
11
+  *
12
+  * @return void
13
+  */
14
+  public function run()
15
+  {
16
+    $this->call(AdminSeeder::class);
17
+    $this->call(PermissionSeeder::class);
18
+    $this->call(ConfigSeeder::class);
19
+  }
20
+}

+ 48
- 0
database/seeders/PermissionSeeder.php Voir le fichier

@@ -0,0 +1,48 @@
1
+<?php
2
+
3
+namespace Database\Seeders;
4
+
5
+use Illuminate\Database\Seeder;
6
+use App\Models\Role;
7
+use App\Models\User;
8
+use App\Models\Permission;
9
+
10
+class PermissionSeeder extends Seeder
11
+{
12
+    /**
13
+     * Run the database seeds.
14
+     *
15
+     * @return void
16
+     */
17
+    public function run()
18
+    {
19
+      //Creo il ruolo admin
20
+      $role = Role::firstOrCreate(['name' => 'amministratore', 'display_name' => 'Amministratore']);
21
+      Role::firstOrCreate(['name' => 'user', 'display_name' => 'Utente']);
22
+
23
+      // Assegno admin all'utente info@elephantech.it
24
+      $user = User::where('email', 'info@elephantech.it')->first();
25
+      if($user != null){
26
+        $user->assignRole($role);
27
+      }
28
+
29
+      $dir = base_path('app/Http/Controllers');
30
+      $files = scandir($dir);
31
+
32
+      $controllers = array();
33
+      foreach($files as $file) {
34
+        if ($file == '.' || $file == '..' || !preg_match('/\.php/', $file) || !preg_match('/^(?!.*(Has).*$)(......)/xs', $file)) continue;
35
+        $c = preg_replace('/\Controller.php$/', '', $file);
36
+        if($c != '') $controllers[] = $c;
37
+        $class = '\App\Http\Controllers\\'.$c.'Controller';
38
+        if(!isset($class::$permissions)) continue;
39
+
40
+        foreach($class::$permissions as $key => $value){
41
+          $permission = Permission::firstOrCreate(['name' => $key, 'display_name' => $value, 'group' => $class::$permission_group, 'guard_name' => 'web']);
42
+          $permission->assignRole($role);
43
+          $permission->save();
44
+        }
45
+
46
+      }
47
+    }
48
+}

+ 23
- 0
package.json Voir le fichier

@@ -0,0 +1,23 @@
1
+{
2
+    "private": true,
3
+    "scripts": {
4
+        "dev": "npm run development",
5
+        "development": "mix",
6
+        "watch": "mix watch",
7
+        "watch-poll": "mix watch -- --watch-options-poll=1000",
8
+        "hot": "mix watch --hot",
9
+        "prod": "npm run production",
10
+        "production": "mix --production"
11
+    },
12
+    "devDependencies": {
13
+        "@tailwindcss/forms": "^0.4.0",
14
+        "alpinejs": "^3.4.2",
15
+        "autoprefixer": "^10.4.2",
16
+        "axios": "^0.21",
17
+        "laravel-mix": "^6.0.6",
18
+        "lodash": "^4.17.19",
19
+        "postcss": "^8.4.6",
20
+        "postcss-import": "^14.0.2",
21
+        "tailwindcss": "^3.0.18"
22
+    }
23
+}

+ 31
- 0
phpunit.xml Voir le fichier

@@ -0,0 +1,31 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+         xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
4
+         bootstrap="vendor/autoload.php"
5
+         colors="true"
6
+>
7
+    <testsuites>
8
+        <testsuite name="Unit">
9
+            <directory suffix="Test.php">./tests/Unit</directory>
10
+        </testsuite>
11
+        <testsuite name="Feature">
12
+            <directory suffix="Test.php">./tests/Feature</directory>
13
+        </testsuite>
14
+    </testsuites>
15
+    <coverage processUncoveredFiles="true">
16
+        <include>
17
+            <directory suffix=".php">./app</directory>
18
+        </include>
19
+    </coverage>
20
+    <php>
21
+        <server name="APP_ENV" value="testing"/>
22
+        <server name="BCRYPT_ROUNDS" value="4"/>
23
+        <server name="CACHE_DRIVER" value="array"/>
24
+        <!-- <server name="DB_CONNECTION" value="sqlite"/> -->
25
+        <!-- <server name="DB_DATABASE" value=":memory:"/> -->
26
+        <server name="MAIL_MAILER" value="array"/>
27
+        <server name="QUEUE_CONNECTION" value="sync"/>
28
+        <server name="SESSION_DRIVER" value="array"/>
29
+        <server name="TELESCOPE_ENABLED" value="false"/>
30
+    </php>
31
+</phpunit>

+ 21
- 0
public/.htaccess Voir le fichier

@@ -0,0 +1,21 @@
1
+<IfModule mod_rewrite.c>
2
+    <IfModule mod_negotiation.c>
3
+        Options -MultiViews -Indexes
4
+    </IfModule>
5
+
6
+    RewriteEngine On
7
+
8
+    # Handle Authorization Header
9
+    RewriteCond %{HTTP:Authorization} .
10
+    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
11
+
12
+    # Redirect Trailing Slashes If Not A Folder...
13
+    RewriteCond %{REQUEST_FILENAME} !-d
14
+    RewriteCond %{REQUEST_URI} (.+)/$
15
+    RewriteRule ^ %1 [L,R=301]
16
+
17
+    # Send Requests To Front Controller...
18
+    RewriteCond %{REQUEST_FILENAME} !-d
19
+    RewriteCond %{REQUEST_FILENAME} !-f
20
+    RewriteRule ^ index.php [L]
21
+</IfModule>

BIN
public/assets/contract.png Voir le fichier


BIN
public/assets/logo_bgw.png Voir le fichier


BIN
public/assets/logo_rm.png Voir le fichier


BIN
public/assets/new_issue.png Voir le fichier


BIN
public/assets/report.png Voir le fichier


+ 8008
- 0
public/assets/sql/comune.sql
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 251
- 0
public/assets/sql/nazione.sql Voir le fichier

@@ -0,0 +1,251 @@
1
+INSERT INTO `nazione` (`id`, `nome`, `sigla`, `created_at`, `updated_at`) VALUES
2
+(1, 'Afghanistan', 'AF', NULL, NULL),
3
+(2, 'Albania', 'AL', NULL, NULL),
4
+(3, 'Algeria', 'DZ', NULL, NULL),
5
+(4, 'Andorra', 'AD', NULL, NULL),
6
+(5, 'Angola', 'AO', NULL, NULL),
7
+(6, 'Anguilla', 'AI', NULL, NULL),
8
+(7, 'Antartide', 'AQ', NULL, NULL),
9
+(8, 'Antigua e Barbuda', 'AG', NULL, NULL),
10
+(9, 'Arabia Saudita', 'SA', NULL, NULL),
11
+(10, 'Argentina', 'AR', NULL, NULL),
12
+(11, 'Armenia', 'AM', NULL, NULL),
13
+(12, 'Aruba', 'AW', NULL, NULL),
14
+(13, 'Australia', 'AU', NULL, NULL),
15
+(14, 'Austria', 'AT', NULL, NULL),
16
+(15, 'Azerbaigian', 'AZ', NULL, NULL),
17
+(16, 'Bahamas', 'BS', NULL, NULL),
18
+(17, 'Bahrein', 'BH', NULL, NULL),
19
+(18, 'Bangladesh', 'BD', NULL, NULL),
20
+(19, 'Barbados', 'BB', NULL, NULL),
21
+(20, 'Belgio', 'BE', NULL, NULL),
22
+(21, 'Belize', 'BZ', NULL, NULL),
23
+(22, 'Benin', 'BJ', NULL, NULL),
24
+(23, 'Bermuda', 'BM', NULL, NULL),
25
+(24, 'Bhutan', 'BT', NULL, NULL),
26
+(25, 'Bielorussia', 'BY', NULL, NULL),
27
+(26, 'Birmania', 'MM', NULL, NULL),
28
+(27, 'Bolivia', 'BO', NULL, NULL),
29
+(28, 'Bosnia ed Erzegovina', 'BA', NULL, NULL),
30
+(29, 'Botswana', 'BW', NULL, NULL),
31
+(30, 'Brasile', 'BR', NULL, NULL),
32
+(31, 'Brunei', 'BN', NULL, NULL),
33
+(32, 'Bulgaria', 'BG', NULL, NULL),
34
+(33, 'Burkina Faso', 'BF', NULL, NULL),
35
+(34, 'Burundi', 'BI', NULL, NULL),
36
+(35, 'Cambogia', 'KH', NULL, NULL),
37
+(36, 'Camerun', 'CM', NULL, NULL),
38
+(37, 'Canada', 'CA', NULL, NULL),
39
+(38, 'Capo Verde', 'CV', NULL, NULL),
40
+(39, 'Ciad', 'TD', NULL, NULL),
41
+(40, 'Cile', 'CL', NULL, NULL),
42
+(41, 'Cina', 'CN', NULL, NULL),
43
+(42, 'Cipro', 'CY', NULL, NULL),
44
+(43, 'Citt', 'VA', NULL, NULL),
45
+(44, 'Colombia', 'CO', NULL, NULL),
46
+(45, 'Comore', 'KM', NULL, NULL),
47
+(46, 'Corea del Nord', 'KP', NULL, NULL),
48
+(47, 'Corea del Sud', 'KR', NULL, NULL),
49
+(48, 'Costa d\'Avorio', 'CI', NULL, NULL),
50
+(49, 'Costa Rica', 'CR', NULL, NULL),
51
+(50, 'Croazia', 'HR', NULL, NULL),
52
+(51, 'Cuba', 'CU', NULL, NULL),
53
+(52, 'Cura', 'CW', NULL, NULL),
54
+(53, 'Danimarca', 'DK', NULL, NULL),
55
+(54, 'Dominica', 'DM', NULL, NULL),
56
+(55, 'Ecuador', 'EC', NULL, NULL),
57
+(56, 'Egitto', 'EG', NULL, NULL),
58
+(57, 'El Salvador', 'SV', NULL, NULL),
59
+(58, 'Emirati Arabi Uniti', 'AE', NULL, NULL),
60
+(59, 'Eritrea', 'ER', NULL, NULL),
61
+(60, 'Estonia', 'EE', NULL, NULL),
62
+(61, 'Etiopia', 'ET', NULL, NULL),
63
+(62, 'Figi', 'FJ', NULL, NULL),
64
+(63, 'Filippine', 'PH', NULL, NULL),
65
+(64, 'Finlandia', 'FI', NULL, NULL),
66
+(65, 'Francia', 'FR', NULL, NULL),
67
+(66, 'Gabon', 'GA', NULL, NULL),
68
+(67, 'Gambia', 'GM', NULL, NULL),
69
+(68, 'Georgia', 'GE', NULL, NULL),
70
+(69, 'Georgia del Sud e isole Sandwich meridionali', 'GS', NULL, NULL),
71
+(70, 'Germania', 'DE', NULL, NULL),
72
+(71, 'Ghana', 'GH', NULL, NULL),
73
+(72, 'Giamaica', 'JM', NULL, NULL),
74
+(73, 'Giappone', 'JP', NULL, NULL),
75
+(74, 'Gibilterra', 'GI', NULL, NULL),
76
+(75, 'Gibuti', 'DJ', NULL, NULL),
77
+(76, 'Giordania', 'JO', NULL, NULL),
78
+(77, 'Grecia', 'GR', NULL, NULL),
79
+(78, 'Grenada', 'GD', NULL, NULL),
80
+(79, 'Groenlandia', 'GL', NULL, NULL),
81
+(80, 'Guadalupa', 'GP', NULL, NULL),
82
+(81, 'Guam', 'GU', NULL, NULL),
83
+(82, 'Guatemala', 'GT', NULL, NULL),
84
+(83, 'Guernsey', 'GG', NULL, NULL),
85
+(84, 'Guinea', 'GN', NULL, NULL),
86
+(85, 'Guinea-Bissau', 'GW', NULL, NULL),
87
+(86, 'Guinea Equatoriale', 'GQ', NULL, NULL),
88
+(87, 'Guyana', 'GY', NULL, NULL),
89
+(88, 'Guyana francese', 'GF', NULL, NULL),
90
+(89, 'Haiti', 'HT', NULL, NULL),
91
+(90, 'Honduras', 'HN', NULL, NULL),
92
+(91, 'Hong Kong', 'HK', NULL, NULL),
93
+(92, 'India', 'IN', NULL, NULL),
94
+(93, 'Indonesia', 'ID', NULL, NULL),
95
+(94, 'Iran', 'IR', NULL, NULL),
96
+(95, 'Iraq', 'IQ', NULL, NULL),
97
+(96, 'Irlanda', 'IE', NULL, NULL),
98
+(97, 'Islanda', 'IS', NULL, NULL),
99
+(98, 'Isola Bouvet', 'BV', NULL, NULL),
100
+(99, 'Isola di Man', 'IM', NULL, NULL),
101
+(100, 'Isola di Natale', 'CX', NULL, NULL),
102
+(101, 'Isola Norfolk', 'NF', NULL, NULL),
103
+(102, 'Isole ', 'AX', NULL, NULL),
104
+(103, 'Isole BES', 'BQ', NULL, NULL),
105
+(104, 'Isole Cayman', 'KY', NULL, NULL),
106
+(105, 'Isole Cocos (Keeling)', 'CC', NULL, NULL),
107
+(106, 'Isole Cook', 'CK', NULL, NULL),
108
+(107, 'F', 'FO', NULL, NULL),
109
+(108, 'Isole Falkland', 'FK', NULL, NULL),
110
+(109, 'Isole Heard e McDonald', 'HM', NULL, NULL),
111
+(110, 'Isole Marianne Settentrionali', 'MP', NULL, NULL),
112
+(111, 'Isole Marshall', 'MH', NULL, NULL),
113
+(112, 'Isole minori esterne degli Stati Uniti', 'UM', NULL, NULL),
114
+(113, 'Isole Pitcairn', 'PN', NULL, NULL),
115
+(114, 'Isole Salomone', 'SB', NULL, NULL),
116
+(115, 'Isole Vergini britanniche', 'VG', NULL, NULL),
117
+(116, 'Isole Vergini americane', 'VI', NULL, NULL),
118
+(117, 'Israele', 'IL', NULL, NULL),
119
+(118, 'Italia', 'IT', NULL, NULL),
120
+(119, 'Jersey', 'JE', NULL, NULL),
121
+(120, 'Kazakistan', 'KZ', NULL, NULL),
122
+(121, 'Kenya', 'KE', NULL, NULL),
123
+(122, 'Kirghizistan', 'KG', NULL, NULL),
124
+(123, 'Kiribati', 'KI', NULL, NULL),
125
+(124, 'Kuwait', 'KW', NULL, NULL),
126
+(125, 'Laos', 'LA', NULL, NULL),
127
+(126, 'Lesotho', 'LS', NULL, NULL),
128
+(127, 'Lettonia', 'LV', NULL, NULL),
129
+(128, 'Libano', 'LB', NULL, NULL),
130
+(129, 'Liberia', 'LR', NULL, NULL),
131
+(130, 'Libia', 'LY', NULL, NULL),
132
+(131, 'Liechtenstein', 'LI', NULL, NULL),
133
+(132, 'Lituania', 'LT', NULL, NULL),
134
+(133, 'Lussemburgo', 'LU', NULL, NULL),
135
+(134, 'Macao', 'MO', NULL, NULL),
136
+(135, 'Macedonia', 'MK', NULL, NULL),
137
+(136, 'Madagascar', 'MG', NULL, NULL),
138
+(137, 'Malawi', 'MW', NULL, NULL),
139
+(138, 'Malesia', 'MY', NULL, NULL),
140
+(139, 'Maldive', 'MV', NULL, NULL),
141
+(140, 'Mali', 'ML', NULL, NULL),
142
+(141, 'Malta', 'MT', NULL, NULL),
143
+(142, 'Marocco', 'MA', NULL, NULL),
144
+(143, 'Martinica', 'MQ', NULL, NULL),
145
+(144, 'Mauritania', 'MR', NULL, NULL),
146
+(145, 'Mauritius', 'MU', NULL, NULL),
147
+(146, 'Mayotte', 'YT', NULL, NULL),
148
+(147, 'Messico', 'MX', NULL, NULL),
149
+(148, 'Micronesia', 'FM', NULL, NULL),
150
+(149, 'Moldavia', 'MD', NULL, NULL),
151
+(150, 'Mongolia', 'MN', NULL, NULL),
152
+(151, 'Montenegro', 'ME', NULL, NULL),
153
+(152, 'Montserrat', 'MS', NULL, NULL),
154
+(153, 'Mozambico', 'MZ', NULL, NULL),
155
+(154, 'Namibia', 'NA', NULL, NULL),
156
+(155, 'Nauru', 'NR', NULL, NULL),
157
+(156, 'Nepal', 'NP', NULL, NULL),
158
+(157, 'Nicaragua', 'NI', NULL, NULL),
159
+(158, 'Niger', 'NE', NULL, NULL),
160
+(159, 'Nigeria', 'NG', NULL, NULL),
161
+(160, 'Niue', 'NU', NULL, NULL),
162
+(161, 'Norvegia', 'NO', NULL, NULL),
163
+(162, 'Nuova Caledonia', 'NC', NULL, NULL),
164
+(163, 'Nuova Zelanda', 'NZ', NULL, NULL),
165
+(164, 'Oman', 'OM', NULL, NULL),
166
+(165, 'Paesi Bassi', 'NL', NULL, NULL),
167
+(166, 'Pakistan', 'PK', NULL, NULL),
168
+(167, 'Palau', 'PW', NULL, NULL),
169
+(168, 'Palestina', 'PS', NULL, NULL),
170
+(169, 'Panam', 'PA', NULL, NULL),
171
+(170, 'Papua Nuova Guinea', 'PG', NULL, NULL),
172
+(171, 'Paraguay', 'PY', NULL, NULL),
173
+(172, 'Per', 'PE', NULL, NULL),
174
+(173, 'Polinesia Francese', 'PF', NULL, NULL),
175
+(174, 'Polonia', 'PL', NULL, NULL),
176
+(175, 'Porto Rico', 'PR', NULL, NULL),
177
+(176, 'Portogallo', 'PT', NULL, NULL),
178
+(177, 'Monaco', 'MC', NULL, NULL),
179
+(178, 'Qatar', 'QA', NULL, NULL),
180
+(179, 'Regno Unito', 'GB', NULL, NULL),
181
+(180, 'RD del Congo', 'CD', NULL, NULL),
182
+(181, 'Rep. Ceca', 'CZ', NULL, NULL),
183
+(182, 'Rep. Centrafricana', 'CF', NULL, NULL),
184
+(183, 'Rep. del Congo', 'CG', NULL, NULL),
185
+(184, 'Rep. Dominicana', 'DO', NULL, NULL),
186
+(185, 'Riunione', 'RE', NULL, NULL),
187
+(186, 'Romania', 'RO', NULL, NULL),
188
+(187, 'Ruanda', 'RW', NULL, NULL),
189
+(188, 'Russia', 'RU', NULL, NULL),
190
+(189, 'Sahara Occidentale', 'EH', NULL, NULL),
191
+(190, 'Saint Kitts e Nevis', 'KN', NULL, NULL),
192
+(191, 'Santa Lucia', 'LC', NULL, NULL),
193
+(192, 'Sant\'Elena, Ascensione e Tristan da Cunha', 'SH', NULL, NULL),
194
+(193, 'Saint Vincent e Grenadine', 'VC', NULL, NULL),
195
+(194, 'Saint-Barth', 'BL', NULL, NULL),
196
+(195, 'Saint-Martin', 'MF', NULL, NULL),
197
+(196, 'Saint-Pierre e Miquelon', 'PM', NULL, NULL),
198
+(197, 'Samoa', 'WS', NULL, NULL),
199
+(198, 'Samoa Americane', 'AS', NULL, NULL),
200
+(199, 'San Marino', 'SM', NULL, NULL),
201
+(200, 'S', 'ST', NULL, NULL),
202
+(201, 'Senegal', 'SN', NULL, NULL),
203
+(202, 'Serbia', 'RS', NULL, NULL),
204
+(203, 'Seychelles', 'SC', NULL, NULL),
205
+(204, 'Sierra Leone', 'SL', NULL, NULL),
206
+(205, 'Singapore', 'SG', NULL, NULL),
207
+(206, 'Sint Maarten', 'SX', NULL, NULL),
208
+(207, 'Siria', 'SY', NULL, NULL),
209
+(208, 'Slovacchia', 'SK', NULL, NULL),
210
+(209, 'Slovenia', 'SI', NULL, NULL),
211
+(210, 'Somalia', 'SO', NULL, NULL),
212
+(211, 'Spagna', 'ES', NULL, NULL),
213
+(212, 'Sri Lanka', 'LK', NULL, NULL),
214
+(213, 'Stati Uniti', 'US', NULL, NULL),
215
+(214, 'Sudafrica', 'ZA', NULL, NULL),
216
+(215, 'Sudan', 'SD', NULL, NULL),
217
+(216, 'Sudan del Sud', 'SS', NULL, NULL),
218
+(217, 'Suriname', 'SR', NULL, NULL),
219
+(218, 'Svalbard e Jan Mayen', 'SJ', NULL, NULL),
220
+(219, 'Svezia', 'SE', NULL, NULL),
221
+(220, 'Svizzera', 'CH', NULL, NULL),
222
+(221, 'Swaziland', 'SZ', NULL, NULL),
223
+(222, 'Taiwan', 'TW', NULL, NULL),
224
+(223, 'Tagikistan', 'TJ', NULL, NULL),
225
+(224, 'Tanzania', 'TZ', NULL, NULL),
226
+(225, 'Terre australi e antartiche francesi', 'TF', NULL, NULL),
227
+(226, 'Territorio britannico dell\'oceano Indiano', 'IO', NULL, NULL),
228
+(227, 'Thailandia', 'TH', NULL, NULL),
229
+(228, 'Timor Est', 'TL', NULL, NULL),
230
+(229, 'Togo', 'TG', NULL, NULL),
231
+(230, 'Tokelau', 'TK', NULL, NULL),
232
+(231, 'Tonga', 'TO', NULL, NULL),
233
+(232, 'Trinidad e Tobago', 'TT', NULL, NULL),
234
+(233, 'Tunisia', 'TN', NULL, NULL),
235
+(234, 'Turchia', 'TR', NULL, NULL),
236
+(235, 'Turkmenistan', 'TM', NULL, NULL),
237
+(236, 'Turks e Caicos', 'TC', NULL, NULL),
238
+(237, 'Tuvalu', 'TV', NULL, NULL),
239
+(238, 'Ucraina', 'UA', NULL, NULL),
240
+(239, 'Uganda', 'UG', NULL, NULL),
241
+(240, 'Ungheria', 'HU', NULL, NULL),
242
+(241, 'Uruguay', 'UY', NULL, NULL),
243
+(242, 'Uzbekistan', 'UZ', NULL, NULL),
244
+(243, 'Vanuatu', 'VU', NULL, NULL),
245
+(244, 'Venezuela', 'VE', NULL, NULL),
246
+(245, 'Vietnam', 'VN', NULL, NULL),
247
+(246, 'Wallis e Futuna', 'WF', NULL, NULL),
248
+(247, 'Yemen', 'YE', NULL, NULL),
249
+(248, 'Zambia', 'ZM', NULL, NULL),
250
+(249, 'Zimbabwe', 'ZW', NULL, NULL);
251
+

+ 112
- 0
public/assets/sql/provincia.sql Voir le fichier

@@ -0,0 +1,112 @@
1
+INSERT INTO `provincia` (`id`, `nome`, `sigla`) VALUES
2
+(1, 'Torino', 'TO'),
3
+(2, 'Vercelli', 'VC'),
4
+(3, 'Novara', 'NO'),
5
+(4, 'Cuneo', 'CN'),
6
+(5, 'Asti', 'AT'),
7
+(6, 'Alessandria', 'AL'),
8
+(7, 'Valle d\'Aosta/Vallée d\'Aoste', 'AO'),
9
+(8, 'Imperia', 'IM'),
10
+(9, 'Savona', 'SV'),
11
+(10, 'Genova', 'GE'),
12
+(11, 'La Spezia', 'SP'),
13
+(12, 'Varese', 'VA'),
14
+(13, 'Como', 'CO'),
15
+(14, 'Sondrio', 'SO'),
16
+(15, 'Milano', 'MI'),
17
+(16, 'Bergamo', 'BG'),
18
+(17, 'Brescia', 'BS'),
19
+(18, 'Pavia', 'PV'),
20
+(19, 'Cremona', 'CR'),
21
+(20, 'Mantova', 'MN'),
22
+(21, 'Bolzano/Bozen', 'BZ'),
23
+(22, 'Trento', 'TN'),
24
+(23, 'Verona', 'VR'),
25
+(24, 'Vicenza', 'VI'),
26
+(25, 'Belluno', 'BL'),
27
+(26, 'Treviso', 'TV'),
28
+(27, 'Venezia', 'VE'),
29
+(28, 'Padova', 'PD'),
30
+(29, 'Rovigo', 'RO'),
31
+(30, 'Udine', 'UD'),
32
+(31, 'Gorizia', 'GO'),
33
+(32, 'Trieste', 'TS'),
34
+(33, 'Piacenza', 'PC'),
35
+(34, 'Parma', 'PR'),
36
+(35, 'Reggio nell\'Emilia', 'RE'),
37
+(36, 'Modena', 'MO'),
38
+(37, 'Bologna', 'BO'),
39
+(38, 'Ferrara', 'FE'),
40
+(39, 'Ravenna', 'RA'),
41
+(40, 'Forlì-Cesena', 'FC'),
42
+(41, 'Pesaro e Urbino', 'PU'),
43
+(42, 'Ancona', 'AN'),
44
+(43, 'Macerata', 'MC'),
45
+(44, 'Ascoli Piceno', 'AP'),
46
+(45, 'Massa-Carrara', 'MS'),
47
+(46, 'Lucca', 'LU'),
48
+(47, 'Pistoia', 'PT'),
49
+(48, 'Firenze', 'FI'),
50
+(49, 'Livorno', 'LI'),
51
+(50, 'Pisa', 'PI'),
52
+(51, 'Arezzo', 'AR'),
53
+(52, 'Siena', 'SI'),
54
+(53, 'Grosseto', 'GR'),
55
+(54, 'Perugia', 'PG'),
56
+(55, 'Terni', 'TR'),
57
+(56, 'Viterbo', 'VT'),
58
+(57, 'Rieti', 'RI'),
59
+(58, 'Roma', 'RM'),
60
+(59, 'Latina', 'LT'),
61
+(60, 'Frosinone', 'FR'),
62
+(61, 'Caserta', 'CE'),
63
+(62, 'Benevento', 'BN'),
64
+(63, 'Napoli', 'NA'),
65
+(64, 'Avellino', 'AV'),
66
+(65, 'Salerno', 'SA'),
67
+(66, 'L\'Aquila', 'AQ'),
68
+(67, 'Teramo', 'TE'),
69
+(68, 'Pescara', 'PE'),
70
+(69, 'Chieti', 'CH'),
71
+(70, 'Campobasso', 'CB'),
72
+(71, 'Foggia', 'FG'),
73
+(72, 'Bari', 'BA'),
74
+(73, 'Taranto', 'TA'),
75
+(74, 'Brindisi', 'BR'),
76
+(75, 'Lecce', 'LE'),
77
+(76, 'Potenza', 'PZ'),
78
+(77, 'Matera', 'MT'),
79
+(78, 'Cosenza', 'CS'),
80
+(79, 'Catanzaro', 'CZ'),
81
+(80, 'Reggio di Calabria', 'RC'),
82
+(81, 'Trapani', 'TP'),
83
+(82, 'Palermo', 'PA'),
84
+(83, 'Messina', 'ME'),
85
+(84, 'Agrigento', 'AG'),
86
+(85, 'Caltanissetta', 'CL'),
87
+(86, 'Enna', 'EN'),
88
+(87, 'Catania', 'CT'),
89
+(88, 'Ragusa', 'RG'),
90
+(89, 'Siracusa', 'SR'),
91
+(90, 'Sassari', 'SS'),
92
+(91, 'Nuoro', 'NU'),
93
+(92, 'Cagliari', 'CA'),
94
+(93, 'Pordenone', 'PN'),
95
+(94, 'Isernia', 'IS'),
96
+(95, 'Oristano', 'OR'),
97
+(96, 'Biella', 'BI'),
98
+(97, 'Lecco', 'LC'),
99
+(98, 'Lodi', 'LO'),
100
+(99, 'Rimini', 'RN'),
101
+(100, 'Prato', 'PO'),
102
+(101, 'Crotone', 'KR'),
103
+(102, 'Vibo Valentia', 'VV'),
104
+(103, 'Verbano-Cusio-Ossola', 'VB'),
105
+(104, 'Olbia-Tempio', 'OT'),
106
+(105, 'Ogliastra', 'OG'),
107
+(106, 'Medio Campidano', 'VS'),
108
+(107, 'Carbonia-Iglesias', 'CI'),
109
+(108, 'Monza e della Brianza', 'MB'),
110
+(109, 'Fermo', 'FM'),
111
+(110, 'Barletta-Andria-Trani', 'BT'),
112
+(111, 'Germany', 'DE');

+ 0
- 0
public/css/app.css Voir le fichier


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff

Chargement…
Annuler
Enregistrer