added factories and squashed bug project_folder
This commit is contained in:
parent
8d71103518
commit
2c1d70e0a6
|
|
@ -56,10 +56,8 @@ public function content(): Content
|
||||||
public function attachments(): array
|
public function attachments(): array
|
||||||
{
|
{
|
||||||
return $this->mailing->attachments()->get()->map(function (ProjectMailingAttachment $attachment) {
|
return $this->mailing->attachments()->get()->map(function (ProjectMailingAttachment $attachment) {
|
||||||
// $projectPath = $attachment->mailing->project->path;
|
|
||||||
|
|
||||||
return Attachment::fromStorage(
|
return Attachment::fromStorage(
|
||||||
path: "chemba/".$attachment->path
|
path: $attachment->mailing->project->download_path.$attachment->path
|
||||||
)
|
)
|
||||||
->as($attachment->name)
|
->as($attachment->name)
|
||||||
->withMime('application/pdf');
|
->withMime('application/pdf');
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public function addAttachment($name, UploadedFile $file)
|
||||||
|
|
||||||
public function project()
|
public function project()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Project::class);
|
return $this->belongsTo(Project::class, 'project_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function recipients()
|
public function recipients()
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,6 @@ class ProjectMailingAttachment extends Model
|
||||||
|
|
||||||
public function mailing()
|
public function mailing()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(ProjectMailing::class);
|
return $this->belongsTo(ProjectMailing::class, 'project_mailing_id', 'id');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
23
laravel_app/database/factories/ProjectBoundingBoxFactory.php
Normal file
23
laravel_app/database/factories/ProjectBoundingBoxFactory.php
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\ProjectBoundingBox>
|
||||||
|
*/
|
||||||
|
class ProjectBoundingBoxFactory extends Factory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
23
laravel_app/database/factories/ProjectDownloadFactory.php
Normal file
23
laravel_app/database/factories/ProjectDownloadFactory.php
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\ProjectDownload>
|
||||||
|
*/
|
||||||
|
class ProjectDownloadFactory extends Factory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\ProjectEmailRecipient>
|
||||||
|
*/
|
||||||
|
class ProjectEmailRecipientFactory extends Factory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,17 +3,22 @@
|
||||||
namespace Database\Factories;
|
namespace Database\Factories;
|
||||||
|
|
||||||
use App\Models\Project;
|
use App\Models\Project;
|
||||||
use App\Models\Team;
|
|
||||||
use App\Models\User;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Laravel\Jetstream\Features;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
|
||||||
*/
|
*/
|
||||||
class ProjectFactory extends Factory
|
class ProjectFactory extends Factory
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the factory's corresponding model.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $model = Project::class;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the model's default state.
|
* Define the model's default state.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\ProjectMailingAttachment>
|
||||||
|
*/
|
||||||
|
class ProjectMailingAttachmentFactory extends Factory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
24
laravel_app/database/factories/ProjectMailingFactory.php
Normal file
24
laravel_app/database/factories/ProjectMailingFactory.php
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\ProjectMailing>
|
||||||
|
*/
|
||||||
|
class ProjectMailingFactory extends Factory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'subject' => $this->faker->sentence,
|
||||||
|
'message' => $this->faker->paragraph,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
23
laravel_app/database/factories/ProjectMosaicFactory.php
Normal file
23
laravel_app/database/factories/ProjectMosaicFactory.php
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\ProjectMosaic>
|
||||||
|
*/
|
||||||
|
class ProjectMosaicFactory extends Factory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
23
laravel_app/database/factories/ProjectReportFactory.php
Normal file
23
laravel_app/database/factories/ProjectReportFactory.php
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\ProjectReport>
|
||||||
|
*/
|
||||||
|
class ProjectReportFactory extends Factory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue