Sistemazione dei routing e delle view
This commit is contained in:
commit
d655193999
@ -13,9 +13,14 @@ class CondominioController extends Controller
|
||||
public function testPdf(){
|
||||
$data=DB::table('categories')->get();
|
||||
$pdf = PDF::setOptions(['dpi' => 150, 'defaultFont' => 'Helvetica'])->loadView('conti.categorie.list', ['categorie' => $data->toArray()]);
|
||||
//return $pdf->download('invoice.pdf');
|
||||
//return $pdf->download('invoice.pdf');
|
||||
/*$pdf = App::make('dompdf.wrapper');
|
||||
$pdf->loadHTML('<h1>Test</h1>');*/
|
||||
return $pdf->stream();
|
||||
}
|
||||
|
||||
public function err403()
|
||||
{
|
||||
abort(403);
|
||||
}
|
||||
}
|
||||
|
@ -63,5 +63,6 @@ class Kernel extends HttpKernel
|
||||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
|
||||
];
|
||||
}
|
||||
|
@ -4,7 +4,8 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
@ -15,7 +16,7 @@ use Junges\ACL\Concerns\HasGroups;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens, HasFactory, Notifiable, AuthenticateswithLdap, HasGroups;
|
||||
use HasApiTokens, HasFactory, Notifiable, AuthenticateswithLdap, HasGroups, SoftDeletes;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
@ -46,23 +47,23 @@ class User extends Authenticatable
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
|
||||
|
||||
public function getLdapDomainColumn()
|
||||
{
|
||||
return 'domain';
|
||||
}
|
||||
|
||||
|
||||
public function getLdapGuidColumn()
|
||||
{
|
||||
return 'guid';
|
||||
}
|
||||
|
||||
|
||||
public static function addGroup($gruppo)
|
||||
{
|
||||
$user= new User();
|
||||
$user->assignGroup($gruppo);
|
||||
}
|
||||
|
||||
|
||||
public static function getUserById($id)
|
||||
{
|
||||
return DB::table('users')->where('id','=',$id)->get();
|
||||
@ -71,4 +72,7 @@ class User extends Authenticatable
|
||||
{
|
||||
return DB::table('users')->orderBy('name')->get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -8,4 +8,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class condominio extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ class RouteServiceProvider extends ServiceProvider
|
||||
Route::middleware('web')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/web.php'));
|
||||
|
||||
|
||||
Route::prefix('admin')
|
||||
->middleware(['web','auth'])
|
||||
->namespace($this->namespace)
|
||||
|
36
database/migrations/2023_05_30_111044_column_users_roles.php
Normal file
36
database/migrations/2023_05_30_111044_column_users_roles.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ColumnUsersRoles extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
//
|
||||
$table->softDeletes();
|
||||
$table->string('user_role',25)->default('user')->nullable(false);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
//
|
||||
$table->dropColumn('user_role');
|
||||
$table->dropSoftDeletes();
|
||||
});
|
||||
}
|
||||
}
|
79
public/css/style.css
vendored
Normal file
79
public/css/style.css
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
html { box-sizing: border-box; }
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after { box-sizing: inherit; }
|
||||
|
||||
body * {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
font: normal 100%/1.15 "Merriweather", serif;
|
||||
background: #fff url("/images/texture.jpg") repeat 0 0;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* https://www.vecteezy.com/vector-art/87721-wood-fence-vectors */
|
||||
.wrapper {
|
||||
position: relative;
|
||||
max-width: 1298px;
|
||||
height: auto;
|
||||
margin: 2em auto 0 auto;
|
||||
background: transparent url("/images/fence.png") no-repeat center top 24em;
|
||||
}
|
||||
|
||||
/* https://www.vecteezy.com/vector-art/237238-dog-family-colored-doodle-drawing */
|
||||
.box {
|
||||
max-width: 70%;
|
||||
min-height: 600px;
|
||||
margin: 0 auto;
|
||||
padding: 1em 1em;
|
||||
text-align: center;
|
||||
background: transparent url("/images/dogs.jpg") no-repeat top 10em center;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0 0 1rem 0;
|
||||
font-size: 8em;
|
||||
text-shadow: 0 0 6px #8b4d1a;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 0.5em;
|
||||
font-size: 1.75em;
|
||||
color: #ea8a1a;
|
||||
}
|
||||
|
||||
p:first-of-type {
|
||||
margin-top: 16em;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
p > a {
|
||||
border-bottom: 1px dashed #837256;
|
||||
font-style: italic;
|
||||
text-decoration: none;
|
||||
color: #837256;
|
||||
}
|
||||
|
||||
p > a:hover { text-shadow: 0 0 3px #8b4d1a; }
|
||||
|
||||
p img { vertical-align: bottom; }
|
||||
|
||||
@media screen and (max-width: 600px) {
|
||||
.wrapper {
|
||||
background-size: 300px 114px;
|
||||
background-position: center top 22em;
|
||||
}
|
||||
|
||||
.box {
|
||||
max-width: 100%;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
background-size: 320px 185px;
|
||||
}
|
||||
|
||||
p:first-of-type { margin-top: 12em; }
|
||||
}
|
BIN
public/images/dogs.jpg
Normal file
BIN
public/images/dogs.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 90 KiB |
BIN
public/images/fence.png
Normal file
BIN
public/images/fence.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
BIN
public/images/texture.jpg
Normal file
BIN
public/images/texture.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.0 KiB |
@ -54,7 +54,7 @@
|
||||
{
|
||||
@endphp
|
||||
|
||||
<td><a href="movimenti/report/movimenti_categoria?cat={{$categoria->id}}&month={{$index+1}}">{{ $matrice[$cat][$index] }}</a></td>
|
||||
<td><a href="/admin/movimenti/report/movimenti_categoria?cat={{$categoria->id}}&month={{$index+1}}">{{ $matrice[$cat][$index] }}</a></td>
|
||||
@php
|
||||
$index++;
|
||||
}
|
||||
|
24
resources/views/errors/403.blade.php
Normal file
24
resources/views/errors/403.blade.php
Normal file
@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" >
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Vietato - 403 - Forbidden</title>
|
||||
<meta name=viewport content="width=device-width, initial-scale=1" />
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Merriweather:400,400i" />
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<!-- partial:index.partial.html -->
|
||||
<div class="wrapper">
|
||||
<div class="box">
|
||||
<h1>403</h1>
|
||||
<p>Spiacente, non è possibile andare oltre questo punto!</p>
|
||||
<p><a href="/">Prego torna indietro da qui.</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- partial -->
|
||||
|
||||
</body>
|
||||
</html>
|
@ -15,6 +15,7 @@ use App\Http\Controllers\AutoController;
|
||||
use App\Http\Controllers\AnagraficaController;
|
||||
use App\Http\Controllers\Utenti;
|
||||
use App\Http\Controllers\ProgettiController;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
@ -31,9 +32,7 @@ Route::get('/', [MovimentiController::class,'dashboard']);
|
||||
Route::get('logout', function(){ Auth::logout(); return redirect('login'); })->name('logout');
|
||||
|
||||
// MOVIMENTI
|
||||
// Route::get('movimentis', [MovimentiController::class,'newMovimenti'])->name('movimentis');
|
||||
Route::post('movimenti/spesa',[MovimentiController::class,'insMovimentiSpesa']);
|
||||
// Route::get('movimentie', [MovimentiController::class,'newMovimenti'])->name('movimentie');
|
||||
Route::post('movimenti/entrata',[MovimentiController::class,'insMovimentiEntrata']);
|
||||
Route::get('movimenti',[MovimentiController::class,'listMovimenti'])->name('movimenti');
|
||||
Route::get('movimenti/export',[MovimentiController::class,'exportMovimenti'])->name('export');
|
||||
@ -108,7 +107,7 @@ Route::get('/', [MovimentiController::class,'dashboard']);
|
||||
Route::get('contatti/addOther', [AnagraficaController::class, 'insOtherContact']);
|
||||
Route::post('contatti/addOther', [AnagraficaController::class, 'saveOtherContact']);
|
||||
|
||||
// Gruppi e permessi
|
||||
// GRUPPI E PERMESSI
|
||||
Route::get('group/new', [Utenti::class, 'nuovoGruppo']);
|
||||
Route::post('group/new', [Utenti::class, 'saveNuovoGruppo']);
|
||||
Route::get('permesso/new', [Utenti::class, 'nuovoPermesso']);
|
||||
@ -116,7 +115,7 @@ Route::get('/', [MovimentiController::class,'dashboard']);
|
||||
Route::get('permesso/assign', [Utenti::class, 'vw_assignToGroup']);
|
||||
Route::post('permesso/assign', [Utenti::class, 'assignPermissionToGroup']);
|
||||
|
||||
// Progetti
|
||||
// PROGETTI
|
||||
Route::get('progetti', [ProgettiController::class, 'listaProgetto'])->name('progetti');
|
||||
Route::post('progetti/new', [ProgettiController::class, 'salvaProgetto']);
|
||||
Route::get('progetti/new', [ProgettiController::class, 'nuovoProgetto'])->name('nuovoProgetto');
|
||||
@ -128,9 +127,10 @@ Route::get('/', [MovimentiController::class,'dashboard']);
|
||||
Route::post('progetti/rigaupdate', [RigaProgettoController::class, 'updateRiga']);
|
||||
Route::get('progetti/coordinatori', [ProgettiController::class, 'getCoordinatori']);
|
||||
|
||||
/// TEST routes
|
||||
/// TEST ROUTES
|
||||
Route::get('test/fullcalendar', [FullCalenderController::class, 'index']);
|
||||
Route::post('test/fullcalendar', [FullCalenderController::class, 'ajax']);
|
||||
Route::get('test/condominio',[CondominioController::class,'testPdf']);
|
||||
Route::get('test/err403',[CondominioController::class,'err403']);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user