laravel-5.7

Why the php artisan: schedule run command does not execute the artisan commands?

僤鯓⒐⒋嵵緔 提交于 2019-12-11 09:02:26
问题 I run the php artisan : schedule run command and it shows the messages saying that the commands are running. However, nothing happens (the events the commands trigger), it did not work, what can it be? Kernel.php <?php namespace App\Console; use App\Console\Commands\CheckPayments; use App\Console\Commands\CheckSubscriptions; use App\Console\Commands\DeleteOperationalLogs; use App\Console\Commands\GenerateInvoices; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console

How do I remove /storage from the URL for public images in my Laravel project?

試著忘記壹切 提交于 2019-12-11 05:37:56
问题 What I am trying to achieve is to remove the /storage from the URL, so that in the end it is www.example.com/images/x.jpg and not the default www.example.com/storage/x.jpg . I have tried removing /storage from the url in config/filesystems.php like this: // Original 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), 'url' => env('APP_URL') . '/storage', 'visibility' => 'public', ], // Modified 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), 'url'

Interface 'Symfony\Contracts\Translation\LocaleAwareInterface' not found - When update laravel composer

心已入冬 提交于 2019-12-11 04:27:48
问题 I Update my Laravel Project Composer, I got Following Error. " Interface 'Symfony\Contracts\Translation\LocaleAwareInterface' not found " how to resolve it. My Laravel Project Version is: 5.7 回答1: do a sudo chown -R $USER ~/.composer/ then composer update it should update the symfony/contracts package to the updated version. 来源: https://stackoverflow.com/questions/53668503/interface-symfony-contracts-translation-localeawareinterface-not-found-when

stream_socket_sendto(): Connection refused. Laravel 5.7 dump server

穿精又带淫゛_ 提交于 2019-12-11 00:14:52
问题 I'm using Laravel. When I dd($request->all()) that the data inside it involves file (.mp3 file). It returns the error: [2019-03-16 15:44:12] local.ERROR: stream_socket_sendto(): Connection refused {"exception":"[object] (RuntimeException(code: 0): stream_socket_sendto(): Connection refused at /vendor/symfony/var-dumper/Server/Connection.php:63 Can this be a problem with php-fpm ? If I run php artisan serve, this does not happen, and if I run php artisan dump server it does not happen either.

Laravel 5.7 - Verification email is not sent

佐手、 提交于 2019-12-10 18:14:45
问题 I've upgraded my laravel instance from version 5.6 to version 5.7. Now I try to use the built-in email verification from laravel. My problem is that I don't get an email after successful registration when I use the "resend" function the email arrives. What is the problem? 回答1: I had this exactly same problem. That is default code from Laravel. In order to send the email after successful registration you can do this workaround: at App\Http\Controllers\Auth\RegisterController change this:

Issue while trying to pass json of translation key-value from laravel blade to vue.js

北战南征 提交于 2019-12-10 15:32:42
问题 This is my translation file return [ "Key1" => "Message 1", "Key2" => "Message 2", "Key3" => "Message 3", "Key4" => "Message 4", "Key5" => "Message 5", "Key6" => "Message 6", "Key7" => "Message 7", "Key8" => "Message 8", ]; This is the code in Laravel Blade <profile v-bind:ErrorMessages= "{ Messages: '{!! json_encode(Lang::get('Profile')) !!}' }"> </profile> In the above component, I am trying to pass the complete translation file from laravel blade to Vue.js But, the above code print all

Laravel 5.7 - Override all() method in Request validation Class to validate route parameters?

◇◆丶佛笑我妖孽 提交于 2019-12-07 13:35:11
问题 I want to validate the route parameters in the Request validation class. I know this question has been asked many times before but According to this question I override all() method and I receive this error: Class App\Http\Requests\DestroyUserRequest does not exist I'm using Laravel 5.7. Route: Route::delete('/user/{userId}/delete', 'UserController@destroy')->name('user.destroy'); Controller: <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests

can save when create new data, but can't calculated data by category

梦想与她 提交于 2019-12-07 11:32:28
Model can save when create new data, but can't calculated data by category public static function findOrCreate($plan_id, $data) { $fromDate = Carbon::now()->subDay()->startOfWeek(); $nowDate = Carbon::now()->today(); $spent_time = static::where('plan_id', $plan_id)->first(); if (is_null($spent_time)) { return static::create($data); }else{ $new_spent_time = SpentTime::first(); $task_category = $new_spent_time->task_category; $new_spent_time->spent_time = $new_spent_time::where('task_category',$task_category) ->sum('daily_spent_time', $new_spent_time->daily_spent_time , $fromDate); $new_spent

Laravel 5.7 (Service Container and Service Provider)

我怕爱的太早我们不能终老 提交于 2019-12-06 13:50:19
问题 Need to understand laravel service container and service provider through example .. Thanks in advance 回答1: Service container is where your services are registered. Service providers provide services by adding them to the container. By reference of Laracast . Watch out to get understand. Service container : https://laracasts.com/series/laravel-from-scratch-2017/episodes/24 Service providers : https://laracasts.com/series/laravel-from-scratch-2017/episodes/25 回答2: Hello and welcome to

Laravel No Existing Directory at “storage/logs”

拜拜、爱过 提交于 2019-12-06 04:43:19
问题 I want to run a Laravel 5.7 application with Docker. My containers start OK but when I try to run the app in the browser I get an error. There is no existing directory at "/Users/user/projects/laravel/application/storage/logs" and its not buildable: Permission denied I changed permissions for the whole project with... sudo chmod -R 777 /Users/user/projects/laravel/application However, nothing changed. How else can this issue be solved? Here is docker-compose.xml file version: '3' services: