siwwy :3 #3
					 4 changed files with 745 additions and 509 deletions
				
			
		Add UA to guestbook
				commit
				
					
					
						fdeb7f1c48
					
				
			
		| 
						 | 
					@ -13,7 +13,8 @@
 | 
				
			||||||
        "laravel/tinker": "^2.8",
 | 
					        "laravel/tinker": "^2.8",
 | 
				
			||||||
        "scrivo/highlight.php": "v9.18.1.10",
 | 
					        "scrivo/highlight.php": "v9.18.1.10",
 | 
				
			||||||
        "sentry/sentry-laravel": "^4.1",
 | 
					        "sentry/sentry-laravel": "^4.1",
 | 
				
			||||||
        "spatie/laravel-honeypot": "^4.3"
 | 
					        "spatie/laravel-honeypot": "^4.3",
 | 
				
			||||||
 | 
					        "ua-parser/uap-php": "^3.9.14"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "require-dev": {
 | 
					    "require-dev": {
 | 
				
			||||||
        "fakerphp/faker": "^1.9.1",
 | 
					        "fakerphp/faker": "^1.9.1",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										1220
									
								
								composer.lock
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										1220
									
								
								composer.lock
									
										
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							| 
						 | 
					@ -286,13 +286,24 @@ table.gb-entry-form tr td span.text-danger {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
table.gb-entry-form tr td textarea,
 | 
					table.gb-entry-form tr td textarea,
 | 
				
			||||||
table.gb-entry-form tr td input {
 | 
					table.gb-entry-form tr td input,
 | 
				
			||||||
 | 
					table.gb-entry-form tr td button{
 | 
				
			||||||
    margin-bottom: 5px;
 | 
					    margin-bottom: 5px;
 | 
				
			||||||
    margin-left: 10px;
 | 
					    margin-left: 10px;
 | 
				
			||||||
    background-color: var(--background);
 | 
					    background-color: var(--background);
 | 
				
			||||||
    border: var(--foreground) solid 1px;
 | 
					    border: var(--foreground) solid 1px;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					table.gb-entry-form tr td button {
 | 
				
			||||||
 | 
					    color: var(--foreground);
 | 
				
			||||||
 | 
					    background-color: var(--background-secondary);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					table.gb-entry-form tr td button:hover {
 | 
				
			||||||
 | 
					    color: var(--background);
 | 
				
			||||||
 | 
					    background-color: var(--foreground);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
table.gb-entry-form-container {
 | 
					table.gb-entry-form-container {
 | 
				
			||||||
    width: 100%;
 | 
					    width: 100%;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -327,6 +338,10 @@ table.gb-entry hr {
 | 
				
			||||||
    border-bottom: none;
 | 
					    border-bottom: none;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					table.gb-entry address {
 | 
				
			||||||
 | 
					    font-size: 0.8pc;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
table.gb-admin {
 | 
					table.gb-admin {
 | 
				
			||||||
    margin-bottom: 5px;
 | 
					    margin-bottom: 5px;
 | 
				
			||||||
    width: 500px;
 | 
					    width: 500px;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,6 +2,8 @@
 | 
				
			||||||
@section('title', 'Guestbook')
 | 
					@section('title', 'Guestbook')
 | 
				
			||||||
@section('content')
 | 
					@section('content')
 | 
				
			||||||
    @php
 | 
					    @php
 | 
				
			||||||
 | 
					        use UAParser\Parser;
 | 
				
			||||||
 | 
					        $parser = Parser::create();
 | 
				
			||||||
        $db_alive = true;
 | 
					        $db_alive = true;
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            DB::connection()->getPdo();
 | 
					            DB::connection()->getPdo();
 | 
				
			||||||
| 
						 | 
					@ -66,13 +68,16 @@
 | 
				
			||||||
    <hr>
 | 
					    <hr>
 | 
				
			||||||
    @php
 | 
					    @php
 | 
				
			||||||
        $entries = DB::select('
 | 
					        $entries = DB::select('
 | 
				
			||||||
            SELECT name, timestamp, message
 | 
					            SELECT name, timestamp, message, agent
 | 
				
			||||||
            FROM guestbook__entries
 | 
					            FROM guestbook__entries
 | 
				
			||||||
            ORDER BY id DESC
 | 
					            ORDER BY id DESC
 | 
				
			||||||
        ');
 | 
					        ');
 | 
				
			||||||
    @endphp
 | 
					    @endphp
 | 
				
			||||||
    <h2>Entries <small>({{ count($entries) }} total)</small></h2>
 | 
					    <h2>Entries <small>({{ count($entries) }} total)</small></h2>
 | 
				
			||||||
    @foreach ($entries as $entry)
 | 
					    @foreach ($entries as $entry)
 | 
				
			||||||
 | 
					        @php
 | 
				
			||||||
 | 
					            $user_agent = $parser->parse($entry->agent);
 | 
				
			||||||
 | 
					        @endphp
 | 
				
			||||||
        <table class="gb-entry" role="presentation">
 | 
					        <table class="gb-entry" role="presentation">
 | 
				
			||||||
            <tr>
 | 
					            <tr>
 | 
				
			||||||
                <td>
 | 
					                <td>
 | 
				
			||||||
| 
						 | 
					@ -81,6 +86,13 @@
 | 
				
			||||||
                    at <strong>{{ gmdate('h:i:s A (e)', $entry->timestamp) }}</strong>
 | 
					                    at <strong>{{ gmdate('h:i:s A (e)', $entry->timestamp) }}</strong>
 | 
				
			||||||
                    <hr>
 | 
					                    <hr>
 | 
				
			||||||
                    {{ $entry->message }}
 | 
					                    {{ $entry->message }}
 | 
				
			||||||
 | 
					                    <hr>
 | 
				
			||||||
 | 
					                    @if($entry->agent === "Agent Unavailable")
 | 
				
			||||||
 | 
					                        <address>Agent unavailable</address>
 | 
				
			||||||
 | 
					                    @else
 | 
				
			||||||
 | 
					                        <address>Posted using <strong>{{ $user_agent->ua->toString() }}</strong>
 | 
				
			||||||
 | 
					                            on <strong>{{ $user_agent->os->toString() }}</strong></address>
 | 
				
			||||||
 | 
					                    @endif
 | 
				
			||||||
                </td>
 | 
					                </td>
 | 
				
			||||||
            </tr>
 | 
					            </tr>
 | 
				
			||||||
        </table>
 | 
					        </table>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue