Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
流明5.4,可邮寄Laravel_Laravel_Laravel 5.4_Lumen_Laravel Artisan - Fatal编程技术网

流明5.4,可邮寄Laravel

流明5.4,可邮寄Laravel,laravel,laravel-5.4,lumen,laravel-artisan,Laravel,Laravel 5.4,Lumen,Laravel Artisan,天真的问题:有没有一种方法可以使用Artisan在Lumen框架内创建一个可邮件类,如下所示:php Artisan make:mail OrderShipped(示例取自文档) 下面是composer.json { "name": "laravel/lumen", "description": "The Laravel Lumen Framework.", "keywords": ["framework", "laravel", "lumen"], "license": "MIT", "typ

天真的问题:有没有一种方法可以使用Artisan在Lumen框架内创建一个可邮件类,如下所示:
php Artisan make:mail OrderShipped
(示例取自文档)

下面是composer.json

{
"name": "laravel/lumen",
"description": "The Laravel Lumen Framework.",
"keywords": ["framework", "laravel", "lumen"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=5.6.4",
    "laravel/lumen-framework": "5.4.*",
    "vlucas/phpdotenv": "~2.2",
    "firebase/php-jwt": "^4.0",
    "guzzlehttp/guzzle": "^6.3",
    "illuminate/mail": "5.4",
    "phanan/cascading-config": "~2.0"
},
"require-dev": {
    "fzaninotto/faker": "~1.4",
    "phpunit/phpunit": "~5.0",
    "mockery/mockery": "~0.9"
},
"autoload": {
    "psr-4": {
        "App\\": "app/"
    }
},
"autoload-dev": {
    "classmap": [
        "tests/",
        "database/"
    ]
},
"scripts": {
    "post-root-package-install": [
        "php -r \"copy('.env.example', '.env');\""
    ]
},
"minimum-stability": "dev",
"prefer-stable": true
}
这就是bootstrap/app.php的修改方式(添加了所有这些):

这就是
php artisan
给我的:

Laravel Framework Lumen (5.4.7) (Laravel Components 5.4.*)

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
      --env[=ENV]       The environment the command should run under
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  help                Displays help for a command
  list                Lists commands
  migrate             Run the database migrations
 auth
  auth:clear-resets   Flush expired password reset tokens
 cache
  cache:clear         Flush the application cache
  cache:forget        Remove an item from the cache
  cache:table         Create a migration for the cache database table
 db
  db:seed             Seed the database with records
 make
  make:migration      Create a new migration file
  make:seeder         Create a new seeder class
 migrate
  migrate:install     Create the migration repository
  migrate:refresh     Reset and re-run all migrations
  migrate:reset       Rollback all database migrations
  migrate:rollback    Rollback the last database migration
  migrate:status      Show the status of each migration
 queue
  queue:failed        List all of the failed queue jobs
  queue:failed-table  Create a migration for the failed queue jobs database table
  queue:flush         Flush all of the failed queue jobs
  queue:forget        Delete a failed queue job
  queue:listen        Listen to a given queue
  queue:restart       Restart queue worker daemons after their current job
  queue:retry         Retry a failed queue job
  queue:table         Create a migration for the queue jobs database table
  queue:work          Start processing jobs on the queue as a daemon
 schedule
  schedule:run        Run the scheduled commands
我使用的是OS X El Capitan、Apache2和PHP5.6.31

那么,我如何(如果有的话)使用artisan制作邮件呢?如果没有成熟的Laravel,这是无法实现的,那么是否有一个模板来创建可邮件类?它们是否可用

参考文献:

  • (没有制造:邮件?)

是的,有些软件包正好允许这样做。例如:

如自述文件中所述,要安装Composer软件包:

composer require flipbox/lumen-generator
然后添加
bootstrap/app.php
文件:

$app->register(Flipbox\LumenGenerator\LumenGeneratorServiceProvider::class);
然后,如果在命令行上运行
php-artisan
,将获得新命令:

 Available commands:
  clear-compiled      Remove the compiled class file
  help                Displays help for a command
  list                Lists commands
  migrate             Run the database migrations
  optimize            Optimize the framework for better performance
  serve               Serve the application on the PHP development server
  tinker              Interact with your application
 key
  key:generate        Set the application key
 make
  make:command        Create a new Artisan command
  make:controller     Create a new controller class
  make:event          Create a new event class
  make:job            Create a new job class
  make:listener       Create a new event listener class
  make:mail           Create a new email class
  make:middleware     Create a new middleware class
  make:migration      Create a new migration file
  make:model          Create a new Eloquent model class
  make:policy         Create a new policy class
  make:provider       Create a new service provider class
  make:seeder         Create a new seeder class
  make:test           Create a new test class
 Available commands:
  clear-compiled      Remove the compiled class file
  help                Displays help for a command
  list                Lists commands
  migrate             Run the database migrations
  optimize            Optimize the framework for better performance
  serve               Serve the application on the PHP development server
  tinker              Interact with your application
 key
  key:generate        Set the application key
 make
  make:command        Create a new Artisan command
  make:controller     Create a new controller class
  make:event          Create a new event class
  make:job            Create a new job class
  make:listener       Create a new event listener class
  make:mail           Create a new email class
  make:middleware     Create a new middleware class
  make:migration      Create a new migration file
  make:model          Create a new Eloquent model class
  make:policy         Create a new policy class
  make:provider       Create a new service provider class
  make:seeder         Create a new seeder class
  make:test           Create a new test class