phoenixg

phoenixg

Member Since 3 Years Ago

Experience Points 1,620
Experience Level 1

3,380 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 9
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

21 Feb
1 month ago

phoenixg started a new conversation How To Integrate Nova With Swoole?

When I'm using swooletw/laravel-swoole pacakge, something just broken, not working very well, is there a best solution here?

14 Feb
1 month ago

phoenixg left a reply on Database Cannot Select Correct After Upgrading Nova To V1.3.1 From V1.3.0

Solved after upgrade from v1.3.1 to v1.3.2.

01 Feb
1 month ago

phoenixg started a new conversation What's The Best Solution For Laravel Implementing Swoole?

Laravel with swoole

20 Dec
3 months ago

phoenixg started a new conversation Nova Avatar Field Not Display Correct URL

# In resource
Avatar::make('avatar') ->thumbnail(new NovaUserAvatar($this))->exceptOnForms() 

# In NovaUserAvatar:
    public function __invoke()
    {
        return 'https://static.dingtalk.com/media/image-avatar.jpg';
    }

Why it renders out: http://nova.local/storage/https://static.dingtalk.com/media/image-avatar..jpg

How to remove the prepended http://nova.local/storage/?

05 Dec
3 months ago

phoenixg started a new conversation How To Overwrite Laravel Telescope View Layout?

I want to use my own telescope layout which extends the default one under vendor/laravel/telescope/resources/views/layout.blade.php

26 Nov
3 months ago

phoenixg started a new conversation Do I Have To Run `queue:work` When I'm Using Horizon?

Do I have to run queue:work when I'm using horizon?

20 Nov
4 months ago

phoenixg started a new conversation How To Change My Nova Action To Queue When I Write Code Not A Model Loop?


public function handle(ActionFields $fields, Collection $models)
    {
        set_time_limit(0);

        $runList = [];
        foreach ($models as $model) {
            if (isset($runList[$model->date->toDateString()])) {
                $runList[$model->date->toDateString()][] = $model->app_id;
            } else {
                $runList[$model->date->toDateString()] = [$model->app_id];
            }

            $runList[$model->date->toDateString()] = array_unique($runList[$model->date->toDateString()]);
        }

        foreach ($runList as $date => $appIdList) {
            foreach ($appIdList as $appId) {
                Artisan::call('cmd-ticharge2hour:run', [
                    'date' => $date,
                    'app_id' => $appId,
                ]);
            }
        }

        return Action::message('Finished');
    }

25 Oct
4 months ago

phoenixg started a new conversation Telescope Composer Install Error

I've installed telescope using --dev, but when I run composer install --no-dev, it occurred error:

[[email protected] pingpp-nova]# composer install --no-dev
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Installing dependencies from lock file
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
PHP Fatal error:  Class 'Laravel\Telescope\TelescopeApplicationServiceProvider' not found in /data/ppp/phx-nova/app/Providers/TelescopeServiceProvider.php on line 10

In Container.php line 779:

  Class auth does not exist

How to solve this?

15 Oct
5 months ago

phoenixg left a reply on How To Change Nova Action Select Name To My Own Word?

I defined a $name property and it works too.

phoenixg started a new conversation Where Can I Write A Method Which Execute Every Nova Resource Has Responsed To The Frontend?

like I'm going to implement a logging method after each Nova request.

07 Oct
5 months ago

phoenixg left a reply on General Error: 1205 Lock Wait Timeout Exceeded In Nova Action

@Tray2 How do I should use NOWAIT SKIPPED LOCKED in my situation?

06 Oct
5 months ago

phoenixg started a new conversation General Error: 1205 Lock Wait Timeout Exceeded In Nova Action

Where is my error stack

[2018-10-07 10:41:07] local.ERROR: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction (SQL: update `nova_action_events` set `status` = finished, `updated_at` = 2018-10-07 10:40:16 where `batch_id` = 8bf5d7ab-45b1-4c48-aff8-5ae54080701b and `status` not in (finished, failed)) {"userId":"07166164102539","email":"[email protected]","exception":"[object] (Illuminate\Database\QueryException(code: HY000): SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction (SQL: update `nova_action_events` set `status` = finished, `updated_at` = 2018-10-07 10:40:16 where `batch_id` = 8bf5d7ab-45b1-4c48-aff8-5ae54080701b and `status` not in (finished, failed)) at /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664, Doctrine\DBAL\Driver\PDOException(code: HY000): SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction at /Users/phx/mine/projects/php/my-nova/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:144, PDOException(code: HY000): SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction at /Users/phx/mine/projects/php/my-nova/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:142)
[stacktrace]
#0 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('update `nova_ac...', Array, Object(Closure))
#1 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Database/Connection.php(490): Illuminate\Database\Connection->run('update `nova_ac...', Array, Object(Closure))
#2 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Database/Connection.php(423): Illuminate\Database\Connection->affectingStatement('update `nova_ac...', Array)
#3 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2572): Illuminate\Database\Connection->update('update `nova_ac...', Array)
#4 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(815): Illuminate\Database\Query\Builder->update(Array)
#5 /Users/phx/mine/projects/php/my-nova/nova/src/Actions/ActionEvent.php(283): Illuminate\Database\Eloquent\Builder->update(Array)
#6 /Users/phx/mine/projects/php/my-nova/nova/src/Actions/DispatchAction.php(36): Laravel\Nova\Actions\ActionEvent::markBatchAsFinished('8bf5d7ab-45b1-4...')
#7 /Users/phx/mine/projects/php/my-nova/nova/src/Actions/Transaction.php(27): Laravel\Nova\Actions\DispatchAction::Laravel\Nova\Actions\{closure}('8bf5d7ab-45b1-4...')
#8 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Support/helpers.php(1023): Laravel\Nova\Actions\Transaction::Laravel\Nova\Actions\{closure}(Array)
#9 /Users/phx/mine/projects/php/my-nova/nova/src/Actions/Transaction.php(31): tap(Array, Object(Closure))
#10 /Users/phx/mine/projects/php/my-nova/nova/src/Actions/DispatchAction.php(37): Laravel\Nova\Actions\Transaction::run(Object(Closure), Object(Closure))
#11 /Users/phx/mine/projects/php/my-nova/nova/src/Actions/Action.php(170): Laravel\Nova\Actions\DispatchAction::forModels(Object(Laravel\Nova\Http\Requests\ActionRequest), Object(App\Nova\Actions\RerunCheckTiChargeVsHour), 'handle', Object(Laravel\Nova\Actions\ActionModelCollection))
#12 /Users/phx/mine/projects/php/my-nova/nova/src/Http/Requests/ActionRequest.php(81): Laravel\Nova\Actions\Action->Laravel\Nova\Actions\{closure}(Object(Laravel\Nova\Actions\ActionModelCollection))
#13 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(39): Laravel\Nova\Http\Requests\ActionRequest->Laravel\Nova\Http\Requests\{closure}(Object(Pingpp\Framework\Collection), 1)
#14 /Users/phx/mine/projects/php/my-nova/nova/src/Http/Requests/ActionRequest.php(82): Illuminate\Database\Eloquent\Builder->chunk(200, Object(Closure))
#15 /Users/phx/mine/projects/php/my-nova/nova/src/Actions/Action.php(172): Laravel\Nova\Http\Requests\ActionRequest->chunks(200, Object(Closure))
#16 /Users/phx/mine/projects/php/my-nova/nova/src/Http/Controllers/ActionController.php(38): Laravel\Nova\Actions\Action->handleRequest(Object(Laravel\Nova\Http\Requests\ActionRequest))
#17 [internal function]: Laravel\Nova\Http\Controllers\ActionController->store(Object(Laravel\Nova\Http\Requests\ActionRequest), 'data-check-by-h...')
#18 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#19 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('store', Array)
#20 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Route.php(212): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Laravel\Nova\Http\Controllers\ActionController), 'store')
#21 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Route.php(169): Illuminate\Routing\Route->runController()
#22 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Router.php(679): Illuminate\Routing\Route->run()
#23 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#24 /Users/phx/mine/projects/php/my-nova/nova/src/Http/Middleware/Authorize.php(18): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#25 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Laravel\Nova\Http\Middleware\Authorize->handle(Object(Illuminate\Http\Request), Object(Closure))
#26 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#27 /Users/phx/mine/projects/php/my-nova/nova/src/Http/Middleware/BootTools.php(20): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#28 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Laravel\Nova\Http\Middleware\BootTools->handle(Object(Illuminate\Http\Request), Object(Closure))
#29 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#30 /Users/phx/mine/projects/php/my-nova/nova/src/Http/Middleware/DispatchServingNovaEvent.php(20): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#31 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Laravel\Nova\Http\Middleware\DispatchServingNovaEvent->handle(Object(Illuminate\Http\Request), Object(Closure))
#32 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#33 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(43): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#34 /Users/phx/mine/projects/php/my-nova/nova/src/Http/Middleware/Authenticate.php(31): Illuminate\Auth\Middleware\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure))
#35 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Laravel\Nova\Http\Middleware\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure))
#36 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#37 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#38 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#39 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#40 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(75): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#41 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#42 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#43 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#44 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#45 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#46 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(63): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#47 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#48 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#49 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#50 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#51 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#52 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(66): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#53 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#54 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#55 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#56 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Router.php(681): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#57 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Router.php(656): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#58 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Router.php(622): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#59 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Router.php(611): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#60 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#61 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#62 /Users/phx/mine/projects/php/my-nova/nova/src/Http/Middleware/ServeNova.php(26): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#63 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Laravel\Nova\Http\Middleware\ServeNova->handle(Object(Illuminate\Http\Request), Object(Closure))
#64 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#65 /Users/phx/mine/projects/php/my-nova/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#66 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#67 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#68 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(31): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#69 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#70 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#71 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(31): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#72 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#73 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#74 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#75 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#76 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#77 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(62): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#78 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(151): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#79 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#80 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#81 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#82 /Users/phx/mine/projects/php/my-nova/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#83 /Users/phx/mine/projects/php/my-nova/public/index.php(55): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#84 {main}
"} 

Here is my Action

<?php

namespace App\Nova\Actions;

use App\Traits\EloquentBootstrap;
use Artisan;
use Illuminate\Bus\Queueable;
use Laravel\Nova\Actions\Action;
use Illuminate\Support\Collection;
use Laravel\Nova\Fields\ActionFields;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Laravel\Nova\Fields\Text;

class RerunTheScript extends Action
{
    use InteractsWithQueue, Queueable, SerializesModels;

    use EloquentBootstrap;

    public $name = 'Rerun the script';

    public function handle(ActionFields $fields, Collection $models)
    {

        $this->bootEloquent();
        return Action::message('success');
    }

}

Here is my trait:

namespace App\Traits;
use App\Utils\Encryption\Encryption;
use Illuminate\Container\Container;
use Illuminate\Events\Dispatcher;
use Illuminate\Database\Capsule\Manager as Capsule;

trait EloquentBootstrap
{
    public function bootEloquent()
    {
        $capsule = new Capsule;

        $capsule->setAsGlobal();

        $capsule->setEventDispatcher(new Dispatcher(new Container));

        foreach (config('database.connections') as $connection => &$db) {
            $capsule->addConnection($db, $connection);
            Capsule::connection($connection)->enableQueryLog();
        }

        $capsule->bootEloquent();
    }
}

If I remove the trait, that's OK, but I have to use the manually eloquent booter, because my Eloquent models are a standalone composer project.

How to solve that?

phoenixg started a new conversation How To Change Nova Action Select Name To My Own Word?

How to change Nova Action select name to my own word?

05 Oct
5 months ago

phoenixg left a reply on How To Deploy Nova?

@samo So am I supposed to add /public/vendor/nova and /resources/lang/vendor/nova and /resources/views/vendor/nova/partials to .gitignore file?

29 Sep
5 months ago

phoenixg started a new conversation How To Deploy Nova?

After I run composer install --no-dev and yarn run productionunder the Laravel project root directory, what else should I run to deploy nova? Seem's there are some other NPM things to install.

28 Sep
5 months ago

phoenixg left a reply on How To Add A Where Clause For A Resource By Default?

@burlresearch It works. But I feel it too complicated, and overwriting default all() makes is always need to run withoutGlobalScope to avoid.

27 Sep
5 months ago

phoenixg started a new conversation How To Add A Where Clause For A Resource By Default?

When open a resource I want to modify the query by adding a where clause or something by default.

25 Sep
5 months ago

phoenixg started a new conversation How Can I Overwrite Nova's LoginController Using My Own?

I want to login by socialite

20 Sep
6 months ago

phoenixg started a new conversation How To Apply Default Nova Order By Field When Open A Nova Resource?

And, I also want to know how to sort by clicking a field default using desc first, not asc first.

phoenixg started a new conversation How To Always Apply A Default Nova Filter When Open A Resource?

I can't find it one the document.

19 Sep
6 months ago

phoenixg started a new conversation What's The Difference Between Nova:base-resource, Nova:resource, Nova:resource-tool And Nova:tool?

If I want to build a page with a nav bar and a table content which retrieve data from 3rd API, which one should I choose?

phoenixg left a reply on How Can I Overwrite Laravel Nova's Layout View?

@bernhardh But if the origin blade file changed, I would re-publish that?

18 Sep
6 months ago

phoenixg started a new conversation How To Render Simply A Table In Nova By Response From API Not A Resource From Db?

I would like to fetch a json response and render as a table

17 Sep
6 months ago

phoenixg started a new conversation How Can I Overwrite Laravel Nova's Layout View?

I found it's all under /nova folder, but when I upgrade, I would not know how many file has been changed. So I cann't modify files under that folder.

11 Sep
1 year ago

phoenixg started a new conversation How To Write Sub-query Inner Join With Chunk Using Laravel Eloquent Syntax? Ask Question

I have this SQL now:

SELECT `trans_id`,
       `trans_subject`,
       `trans_paid_time`,
       `trans_amount`
FROM `transaction`
WHERE `trans_app_id` = 'app_123'
  AND `trans_paid_time` >= '2017-08-01 00:00:00'
  LIMIT 5000 OFFSET 55000;

My code currently is:

Transaction::where('trans_app_id', 'app_123')
    ->where('trans_paid_time', '>=', '2017-08-01 00:00:00')
    ->select(['trans_id', 'trans_subject', 'trans_paid_time'])
    ->chunk(5000, function ($transactions)  {
        $transactions->each(function ($transaction) use ($instance) {
            // do something with $transaction
        });
    });

But I'm planning to turn this SQL into below SQL:

SELECT `trans_id`,`trans_subject`,`trans_paid_time`, `trans_amount`
FROM transaction
INNER JOIN
  (SELECT trans_id
   FROM transaction
   WHERE`trans_app_id` = 'app_123'
     AND `trans_paid_time` >= '2017-08-01 00:00:00'
   ORDER BY trans_paid_time 
   LIMIT 125000, 5000) AS lim 
 using(trans_id);

How should I convert my Eloquent code?