Skip to content

Commit 456e8f9

Browse files
committed
initialize package
1 parent 5b612c3 commit 456e8f9

15 files changed

+281
-51
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github: Abdul Haseeb Khan
1+
github: code-creeper

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Please review [our security policy](../../security/policy) on how to report secu
7676

7777
## Credits
7878

79-
- [Abdul Haseeb Khan](https://github.com/code-creeper)
79+
- [Code Creeper](https://github.com/code-creeper)
8080
- [All Contributors](../../contributors)
8181

8282
## License

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
},
4040
"autoload": {
4141
"psr-4": {
42-
"CodeCreeper\\Chunkify\\": "src/",
43-
"CodeCreeper\\Chunkify\\Database\\Factories\\": "database/factories/"
42+
"CodeCreeper\\Chunkify\\": "src/"
4443
}
4544
},
4645
"autoload-dev": {

config/chunkify.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
<?php
22

3-
// config for CodeCreeper/Chunkify
43
return [
4+
'chunk_disk' => env('CHUNKIFY_CHUNK_DISK', 'public'),
5+
'file_disk' => env('CHUNKIFY_FILE_DISK', 'public'),
56

7+
'files_model' => CodeCreeper\Chunkify\Models\ChunkifyFile::class,
8+
'chunks_model' => CodeCreeper\Chunkify\Models\ChunkifyChunk::class,
9+
10+
'path_prefix' => env('CHUNKIFY_PATH_PREFIX', 'chunkify'),
11+
12+
'path_generator' => \CodeCreeper\Chunkify\ChunkifyPathGenerator::class,
13+
14+
'request' => [
15+
'chunk_reference' => 'chunk_reference',
16+
'chunk_extension' => 'chunk_extension',
17+
'chunk_index' => 'chunk_index',
18+
'chunk_total_count' => 'chunk_total_count',
19+
'chunk_data' => 'chunk_data',
20+
]
621
];

database/factories/ModelFactory.php

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
public function up(): void
10+
{
11+
Schema::create('chunkify_files', function (Blueprint $table) {
12+
$table->id();
13+
$table->string('reference')->unique();
14+
$table->string('extension')->nullable();
15+
$table->string('name')->nullable();
16+
$table->string('disk');
17+
$table->unsignedSmallInteger('expected_chunks_count');
18+
$table->unsignedSmallInteger('uploaded_chunks_count');
19+
$table->boolean('completed')->default(false);
20+
$table->timestamps();
21+
22+
$table->index(['reference']);
23+
$table->index(['reference', 'completed']);
24+
});
25+
26+
Schema::create('chunkify_chunks', function (Blueprint $table) {
27+
$table->id();
28+
$table->foreignId('chunkify_file_id')
29+
->constrained()
30+
->cascadeOnUpdate()
31+
->cascadeOnDelete();
32+
$table->string('name');
33+
$table->unsignedMediumInteger('index');
34+
$table->string('disk');
35+
$table->timestamps();
36+
37+
$table->unique(['chunkify_file_id', 'index']);
38+
39+
$table->index(['chunkify_file_id']);
40+
$table->index(['chunkify_file_id', 'index']);
41+
});
42+
}
43+
44+
public function down(): void
45+
{
46+
Schema::dropIfExists('chunkify_chunks');
47+
Schema::dropIfExists('chunkify_files');
48+
}
49+
};

database/migrations/create_chunkify_table.php.stub

Lines changed: 0 additions & 19 deletions
This file was deleted.

phpstan.neon.dist

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ includes:
44
parameters:
55
level: 5
66
paths:
7-
- src
87
- config
98
- database
9+
- routes
10+
- src
11+
- tests
1012
tmpDir: build/phpstan
1113
checkOctaneCompatibility: true
1214
checkModelProperties: true

routes/web.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
use CodeCreeper\Chunkify\Controllers\ChunkifyController;
4+
use Illuminate\Support\Facades\Route;
5+
6+
Route::prefix('/chunkify')->group(function () {
7+
Route::post('/chunkify', ChunkifyController::class)->name('chunkify');
8+
});

src/Chunkify.php

100755100644
File mode changed.

0 commit comments

Comments
 (0)