-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:chaostreff-flensburg/simple-borrow
- Loading branch information
Showing
15 changed files
with
209 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
namespace App\Mail; | ||
|
||
use App\Models\Item; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Mail\Mailable; | ||
use Illuminate\Mail\Mailables\Content; | ||
use Illuminate\Mail\Mailables\Envelope; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ItemSuggested extends Mailable | ||
{ | ||
use Queueable, SerializesModels; | ||
|
||
/** | ||
* Create a new message instance. | ||
*/ | ||
public function __construct( | ||
public Item $item | ||
) { | ||
} | ||
|
||
/** | ||
* Get the message envelope. | ||
*/ | ||
public function envelope(): Envelope | ||
{ | ||
return new Envelope( | ||
subject: 'Item Suggested', | ||
); | ||
} | ||
|
||
/** | ||
* Get the message content definition. | ||
*/ | ||
public function content(): Content | ||
{ | ||
return new Content( | ||
view: 'emails.item-suggested', | ||
); | ||
} | ||
|
||
/** | ||
* Get the attachments for the message. | ||
* | ||
* @return array<int, \Illuminate\Mail\Mailables\Attachment> | ||
*/ | ||
public function attachments(): array | ||
{ | ||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
database/migrations/2024_03_22_200023_add_approved_field_to_items.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\DB; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::table('items', function (Blueprint $table) { | ||
$table->boolean('approved')->default(false); | ||
}); | ||
|
||
DB::table('items')->update(['approved' => true]); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::table('items', function (Blueprint $table) { | ||
$table->dropColumn('approved'); | ||
}); | ||
} | ||
}; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
New item suggested! | ||
|
||
Titel: {{ $item->name }} | ||
Beschreibung: {{ $item->description }} | ||
|
||
<a href="{{ config('app.url') . '/admin/items/' . $item->id . '/edit' }}">{{ __('Direct link') }}</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<x-layout> | ||
<article class="prose min-w-full"> | ||
<h1>{{ __('Suggest a new item') }}</h1> | ||
<form method="post" action="{{ route('item.storeSuggestion') }}" enctype="multipart/form-data"> | ||
@csrf | ||
@method('POST') | ||
<div class="form-control mb-8"> | ||
<label class="label" for="name"> | ||
<span class="label-text">{{ __('Name') }}*</span> | ||
</label> | ||
<input type="text" name="name" id="name" class="input input-bordered" placeholder="Säge" required> | ||
@error('name') | ||
<p class="text-red-500">{{ $message }}</p> | ||
@enderror | ||
</div> | ||
<div class="form-control mb-8"> | ||
<label class="label" for="description"> | ||
<span class="label-text">{{ __('Description') }}*</span> | ||
</label> | ||
<textarea name="description" id="description" class="textarea textarea-bordered h-24" placeholder="Eine Säge für Holz…" required></textarea> | ||
@error('description') | ||
<p class="text-red-500">{{ $message }}</p> | ||
@enderror | ||
</div> | ||
<div class="form-control mb-8"> | ||
<label class="label" for="image"> | ||
<span class="label-text">{{ __('Image') }}*</span> | ||
</label> | ||
<input type="file" name="image" id="image" class="file-input file-input-bordered" ept="image/png, image/jpeg" required> | ||
@error('image') | ||
<p class="text-red-500">{{ $message }}</p> | ||
@enderror | ||
</div> | ||
<div class="form-control mb-8"> | ||
<label class="label" for="manual"> | ||
<span class="label-text">{{ __('Manual Link') }}</span> | ||
</label> | ||
<input type="text" name="manual" id="manual" class="input input-bordered" placeholder="https://example.com/manual.pdf"> | ||
@error('manual') | ||
<p class="text-red-500">{{ $message }}</p> | ||
@enderror | ||
</div> | ||
<input class="btn btn-success" type="submit"> | ||
</form> | ||
</article> | ||
</x-layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters