You've already forked isop-mirror
refactor: rename InternshipStatus model to InternshipStatusData
This commit is contained in:
@@ -5,7 +5,7 @@ namespace App\Http\Controllers;
|
||||
use App\Models\Company;
|
||||
use App\Models\User;
|
||||
use App\Models\Internship;
|
||||
use App\Models\InternshipStatus;
|
||||
use App\Models\InternshipStatusData;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
@@ -186,7 +186,7 @@ class CompanyController extends Controller
|
||||
|
||||
// mazanie statusov
|
||||
$internships->each(function ($internship) {
|
||||
InternshipStatus::whereInternshipId($internship->id)->delete();
|
||||
InternshipStatusData::whereInternshipId($internship->id)->delete();
|
||||
});
|
||||
|
||||
// mazanie praxov
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\Internship;
|
||||
use App\Models\InternshipStatus;
|
||||
use App\Models\InternshipStatusData;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Mpdf\Mpdf;
|
||||
@@ -185,7 +185,7 @@ class InternshipController extends Controller
|
||||
'agreement' => null
|
||||
]);
|
||||
|
||||
InternshipStatus::create([
|
||||
InternshipStatusData::create([
|
||||
'internship_id' => $Internship->id,
|
||||
'status' => 'SUBMITTED',
|
||||
'changed' => now(),
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Mail\InternshipStatusUpdated;
|
||||
use App\Models\Internship;
|
||||
use App\Models\InternshipStatus;
|
||||
use App\Models\InternshipStatusData;
|
||||
use Illuminate\Http\Request;
|
||||
use Mail;
|
||||
|
||||
@@ -13,7 +13,7 @@ class InternshipStatusDataController extends Controller
|
||||
public function get(int $id)
|
||||
{
|
||||
$user = auth()->user();
|
||||
$internship_statuses = InternshipStatus::whereInternshipId($id)->orderByDesc('changed')->get();
|
||||
$internship_statuses = InternshipStatusData::whereInternshipId($id)->orderByDesc('changed')->get();
|
||||
|
||||
if (!$internship_statuses) {
|
||||
return response()->json([
|
||||
@@ -77,7 +77,7 @@ class InternshipStatusDataController extends Controller
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(InternshipStatus $internshipStatus)
|
||||
public function show(InternshipStatusData $internshipStatus)
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -85,7 +85,7 @@ class InternshipStatusDataController extends Controller
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(InternshipStatus $internshipStatus)
|
||||
public function edit(InternshipStatusData $internshipStatus)
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -116,7 +116,7 @@ class InternshipStatusDataController extends Controller
|
||||
'note' => ['required', 'string', 'min:1']
|
||||
]);
|
||||
|
||||
InternshipStatus::create([
|
||||
InternshipStatusData::create([
|
||||
'internship_id' => $id,
|
||||
'status' => $request->status,
|
||||
'note' => $request->note,
|
||||
@@ -132,7 +132,7 @@ class InternshipStatusDataController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(InternshipStatus $internshipStatus)
|
||||
public function destroy(InternshipStatusData $internshipStatus)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace App\Http\Controllers;
|
||||
use App\Models\Internship;
|
||||
use App\Models\StudentData;
|
||||
use App\Models\User;
|
||||
use App\Models\InternshipStatus;
|
||||
use App\Models\InternshipStatusData;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
@@ -208,7 +208,7 @@ class StudentDataController extends Controller
|
||||
|
||||
// mazanie statusov
|
||||
$internships->each(function ($internship) {
|
||||
InternshipStatus::whereInternshipId($internship->id)->delete();
|
||||
InternshipStatusData::whereInternshipId($internship->id)->delete();
|
||||
});
|
||||
|
||||
// mazanie praxov
|
||||
|
||||
@@ -63,7 +63,7 @@ class Internship extends Model
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->hasOne(InternshipStatus::class, 'internship_id')->latestOfMany();
|
||||
return $this->hasOne(InternshipStatusData::class, 'internship_id')->latestOfMany();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class InternshipStatus extends Model
|
||||
class InternshipStatusData extends Model
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\InternshipStatusFactory> */
|
||||
use HasFactory;
|
||||
@@ -5,7 +5,7 @@ namespace Database\Factories;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\InternshipStatus>
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\InternshipStatusData>
|
||||
*/
|
||||
class InternshipStatusFactory extends Factory
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Database\Seeders;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\Internship;
|
||||
use App\Models\InternshipStatus;
|
||||
use App\Models\InternshipStatusData;
|
||||
use App\Models\StudentData;
|
||||
use App\Models\User;
|
||||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
@@ -57,7 +57,7 @@ class DatabaseSeeder extends Seeder
|
||||
'company_id' => Company::inRandomOrder()->value('id'),
|
||||
]);
|
||||
|
||||
InternshipStatus::factory()->create([
|
||||
InternshipStatusData::factory()->create([
|
||||
'internship_id' => $internship->id,
|
||||
'status' => "SUBMITTED",
|
||||
'note' => 'made by seeder',
|
||||
|
||||
Reference in New Issue
Block a user