Skip to content

Instantly share code, notes, and snippets.

@p810
Last active October 21, 2020 15:36
Show Gist options
  • Save p810/ec6babda1d74153dc84bf83bb027fe2e to your computer and use it in GitHub Desktop.
Save p810/ec6babda1d74153dc84bf83bb027fe2e to your computer and use it in GitHub Desktop.
Visual Studio Code user snippet for Laravel 8 factory classes
{
"Create Laravel 8 factory": {
"prefix": "factory",
"body": [
"namespace Database\\Factories\\\\$1;\n",
"use Illuminate\\Database\\Eloquent\\Factories\\Factory;",
"use $1\\\\$2;\n",
"class $2Factory extends Factory",
"{",
"\tprotected \\$model = $2::class;\n",
"\tpublic function definition()",
"\t{",
"\t\treturn [$0];",
"\t}",
"}"
],
"description": "Create a Laravel 8 factory class"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment