-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c984da2
commit 2979823
Showing
12 changed files
with
199 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace App\Http\Requests; | ||
|
||
use App\Traits\ApiRequest; | ||
use Illuminate\Foundation\Http\FormRequest; | ||
|
||
class CopyInventory extends FormRequest | ||
{ | ||
use ApiRequest; | ||
|
||
/** | ||
* Determine if the user is authorized to make this request. | ||
* | ||
* @return bool | ||
*/ | ||
public function authorize() | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* Get the validation rules that apply to the request. | ||
* | ||
* @return array | ||
*/ | ||
public function rules() | ||
{ | ||
return $this->clean([ | ||
'copy_from' => 'required:exists:entities,id' | ||
]); | ||
} | ||
} |
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
28 changes: 28 additions & 0 deletions
28
database/migrations/2024_05_02_162659_update_inventories_add_image_uuid.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,28 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::table('inventories', function (Blueprint $table) { | ||
$table->uuid('image_uuid')->nullable(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::table('inventories', function (Blueprint $table) { | ||
$table->dropColumn('image_uuid'); | ||
}); | ||
} | ||
}; |
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,12 @@ | ||
<?php /** @var \App\Models\Inventory $inventory */?> | ||
{{ csrf_field() }} | ||
<x-grid> | ||
@include('cruds.fields.entity', [ | ||
'name' => 'copy_from', | ||
'required' => true, | ||
'label' => __('bookmarks.fields.entity'), | ||
]) | ||
</x-grid> | ||
|
||
|
||
|
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,22 @@ | ||
@extends('layouts.' . (request()->ajax() ? 'ajax' : 'app'), [ | ||
'title' => __('entities/inventories.create.title', ['name' => $entity->name]), | ||
'description' => '', | ||
'breadcrumbs' => [ | ||
Breadcrumb::entity($entity)->list(), | ||
Breadcrumb::show(), | ||
['url' => route('entities.inventory', [$campaign, $entity->id]), 'label' => __('crud.tabs.inventory')], | ||
] | ||
]) | ||
|
||
@section('content') | ||
{!! Form::open(['route' => ['entities.inventory.copy-from', $campaign, $entity->id], 'method'=>'POST', 'data-shortcut' => 1, 'data-maintenance' => 1, 'class' => 'ajax-subform']) !!} | ||
@include('partials.forms.form', [ | ||
'title' => __('entities/inventories.create.title', ['name' => $entity->name]), | ||
'content' => 'entities.pages.inventory._copy', | ||
'submit' => __('entities/inventories.actions.copy_inventory'), | ||
'dialog' => true, | ||
]) | ||
|
||
{!! Form::hidden('entity_id', $entity->id) !!} | ||
{!! Form::close() !!} | ||
@endsection |
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