New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.5] Added option to make new model a pivot model #21549

Merged
merged 2 commits into from Oct 6, 2017
Jump to file or symbol
Failed to load files and symbols.
+16 −0
Diff settings

Always

Just for now

@@ -112,6 +112,10 @@ protected function createController()
*/
protected function getStub()
{
if ($this->option('pivot')) {
return __DIR__.'/stubs/pivot.model.stub';
}
return __DIR__.'/stubs/model.stub';
}
@@ -144,6 +148,8 @@ protected function getOptions()
['migration', 'm', InputOption::VALUE_NONE, 'Create a new migration file for the model.'],
['pivot', 'p', InputOption::VALUE_NONE, 'Indicates if the generated model should be a custom intermediate table model.'],
['resource', 'r', InputOption::VALUE_NONE, 'Indicates if the generated controller should be a resource controller.'],
];
}
@@ -0,0 +1,10 @@
<?php
namespace DummyNamespace;
use Illuminate\Database\Eloquent\Relations\Pivot;
class DummyClass extends Pivot
{
//
}
ProTip! Use n and p to navigate between commits in a pull request.