laravel icon indicating copy to clipboard operation
laravel copied to clipboard

Add ability to not generate relationship methods

Open zeleniy opened this issue 5 months ago • 0 comments

I am trying to introduce the tool into existing project which already has a lot of models distributed by different subfolders of app_path('Models'). New tables models for which i would like to generate has foreign keys with those tables. And as a consequence all such methods generated in base model points to incorrect classes:

namespace App\Models\MyFolder\Base;

class MyNewTableModel extends Model
{
        ...
	public function oldTable(): BelongsTo
	{
		return $this->belongsTo(OldTable::class);
	}
}

But old table was created manually some times ago and it's outside of MyFolder/Base folder, for instance, in app_path('Models') . \DIRECTORY_SEPARATOR . 'Orders' directory.

zeleniy avatar Oct 03 '24 17:10 zeleniy