Skip to content

Commit

Permalink
Upgrade (#38)
Browse files Browse the repository at this point in the history
* updated requirements

* tweaks

* updated env

* disabled contact form
  • Loading branch information
angusgoody authored Dec 21, 2023
1 parent 595ed47 commit 86ff300
Show file tree
Hide file tree
Showing 10 changed files with 2,733 additions and 2,245 deletions.
7 changes: 4 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ RECAPTCHA_SECRET_KEY=1234
ADMIN_NAME=Admin
ADMIN_EMAIL=[email protected]
ADMIN_PASSWORD=password123
LEGACY_MODE=true

LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=portfolio
DB_USERNAME=root
DB_PASSWORD=
DB_USERNAME=sail
DB_PASSWORD=password

BROADCAST_DRIVER=log
CACHE_DRIVER=file
Expand Down
9 changes: 7 additions & 2 deletions app/Http/Controllers/ContactController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public function show()
*/
public function send(Request $request){

// If legacy mode is enabled just return an error
if (config('app.legacy')) {
return redirect()->back()->with('error', 'Form is disabled');
}

// Normal validation
$request->validate([
'name' => 'required',
Expand Down Expand Up @@ -53,8 +58,8 @@ public function send(Request $request){
}else{
return redirect()->back()->with('error', 'Captcha failed');
}





}
}
2 changes: 1 addition & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Kernel extends HttpKernel
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Fruitcake\Cors\HandleCors::class,
\Illuminate\Http\Middleware\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
Expand Down
11 changes: 5 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"fruitcake/laravel-cors": "^2.0",
"php": "^8.1",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^9.0",
"laravel/framework": "^10.10",
"laravel/tinker": "^2.5",
"livewire/livewire": "^2.10"
},
"require-dev": {
"spatie/laravel-ignition": "^1.0",
"spatie/laravel-ignition": "^2.0",
"fakerphp/faker": "^1.9.1",
"laravel/breeze": "^1.1",
"laravel/sail": "^1.0.1",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.3.3"
"phpunit/phpunit": "^10.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 86ff300

Please sign in to comment.