artisan

Laravel php artisan serve to mimic HTTPS

夙愿已清 提交于 2019-12-01 17:27:59
I have been searching around to see if there is a way I can mock SSL for local development using Laravel's artisan to serve HTTPS with no luck. Is this possible and if so, how? I understand this is a very general question, but I am not seeing anything on this in searches. Laravel uses the in-built PHP5.4 development server php -S ( http://php.net/manual/en/features.commandline.webserver.php ) for it's artisan serve command (see Illuminate\Foundation\Console\ServeCommand ). This only supports plain HTTP, so no, this isn't possible. Your best bet would be to use a Vagrant box set up to work with

Using artisan serve after changing the public folder name

允我心安 提交于 2019-12-01 03:50:19
问题 As with a lot of hosts our public folder is called public_html . This is on shared hosting so can't be changed. I've changed the public folder to public_html to reflect this, but when I do artisan serve stops working. Every time I try to start it I get: [ErrorException] chdir(): No such file or directory (errno 2) If I rename the folder back to public then artisan serve starts working again. I've tried following this post on laracasts, and the user in the post reports artisan works for them,

Artisan::call() outside the Laravel framework

无人久伴 提交于 2019-11-30 21:38:15
I want to create a cron job for Laravel 5.2 My shared host (on OVH), only allows me to point to the full path of a file, and I am not able to use the recommended Cron entry from Laravel's docs, ie : * * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1 Therefore, I have to call the Artisan command from a .php file, outside of the Laravel framework. Here is what my public/cron.php file looks like so far: <?php require __DIR__.'/../bootstrap/autoload.php'; use Illuminate\Support\Facades\Artisan; Artisan::call('refresh'); refresh being my command for regenerating thumbnails inside my app.

Chain commands in Laravel Artisan Scheduler?

久未见 提交于 2019-11-30 17:57:43
Suppose I have three commands I want to schedule: 'commandA', 'commandB', and 'commandC' But I don't want to run 'commandB' until 'commandA' is complete and I don't want to run 'commandC' until 'commandB' is complete. I know I can schedule each to run every five minutes: $schedule->command('commandA')->everyFiveMinutes(); $schedule->command('commandB')->everyFiveMinutes(); $schedule->command('commandC')->everyFiveMinutes(); But is it possible to chain them one after the other? Use then(Closure $callback) to chain commands: $schedule->command('commandA')->everyFiveMinutes()->then(function() {

Chain commands in Laravel Artisan Scheduler?

丶灬走出姿态 提交于 2019-11-30 16:50:20
问题 Suppose I have three commands I want to schedule: 'commandA', 'commandB', and 'commandC' But I don't want to run 'commandB' until 'commandA' is complete and I don't want to run 'commandC' until 'commandB' is complete. I know I can schedule each to run every five minutes: $schedule->command('commandA')->everyFiveMinutes(); $schedule->command('commandB')->everyFiveMinutes(); $schedule->command('commandC')->everyFiveMinutes(); But is it possible to chain them one after the other? 回答1: Use then

PHP Artisan Tinker crashing from any command

旧巷老猫 提交于 2019-11-30 04:27:33
I haven't had this problem before, but my php artisan tinker crashes from issuing any command - and leaves no logs whatsoever on what is causing the crash. project4 $ php artisan tinker Psy Shell v0.9.9 (PHP 7.3.0 — cli) by Justin Hileman >>> use \App\Jobs\testJob; project4 $ or even the simplest command: project4 $ php artisan tinker Psy Shell v0.9.9 (PHP 7.3.0 — cli) by Justin Hileman >>> print("Hello World!"); project4 $ I almost wonder if it isn't connecting to PHP correctly, but I can't find any logs anywhere. Laravel has no trace of the commands. I ran brew update , but no difference.

Vendor:Publish - Nothing to publish for tag [] - Only on production server

孤街浪徒 提交于 2019-11-30 03:06:09
I am using a third party library and locally, I installed everything using the steps that they provided. I ran composer require on the package and ran an update. This installed into the vendor folder. I then added the path into the provider in config/app and also as an aliases.. I ran php artisan vendor:publish --provider="Spatie\LaravelAnalytics\LaravelAnalyticsServiceProvider" the config file created successfully and I had no problems. I then uploaded to the production environment and kept on getting Class 'LaravelAnalytics' not found and I can't seem to figure out the problem.. I ran php

Laravel 5.4 create model, controller and migration in single artisan command

半城伤御伤魂 提交于 2019-11-29 18:40:43
I can create a model and resource controller (binded to model) with the following command php artisan make:controller TodoController --resource --model=Todo I want to also create a migration with the above command, is it possible? You can do it if you start from the model php artisan make:model Todo -mcr if you run php artisan make:model --help you can see all the available options -m, --migration Create a new migration file for the model. -c, --controller Create a new controller for the model. -r, --resource Indicates if the generated controller should be a resource controller Update As

Laravel Artisan CLI safely stop daemon queue workers

谁说我不能喝 提交于 2019-11-29 16:50:47
问题 In order to process large numbers of jobs, I run a variable number of queue workers depending on howmuch work there is to complete. I don't want to run more workers than are necessary to complete the work that needs to be done in a time period that we deem appropriate. At the moment, I start 5 daemon queue workers for testing purposes, however in production this number could be between 25 & 100 workers, possibly more. I understand that when deploying, I have to stop the queue workers by first

Whats the point of running Laravel with the command 'php artisan serve'?

*爱你&永不变心* 提交于 2019-11-29 12:10:29
问题 I dont seem to understand why we need to run a Laravel app with php artisan serve vs just running it with Apache or nginx . I know that under development, we use artisan to fire up the site and after deployment to a server, you use the webserver to load up the site. Whats the use of running the app in artisan in the first place? 回答1: The serve command is just a shortcut for the PHP Built-in Webserver, something PHP has out of the box, so the point of using it is to start testing your