zelaza

Experience

1,130

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 1 Lesson Completed
  • 0 Favorites

3rd December, 2017

zelaza left a reply on Clearing A Beanstalkd Queue On Forge • 10 months ago

I have the same question. Any answers?

30th July, 2017

zelaza left a reply on Best Practice For Updating Forge Servers? • 1 year ago

Thanks, Gorby. I have the same setup - Dev and Production servers. So I think I'll follow your advice - upgrade the Dev server, test it, if all looks good then upgrade the Production server...

29th July, 2017

zelaza started a new conversation Best Practice For Updating Forge Servers? • 1 year ago

Hi. I have several Laravel apps running on Forge servers. I'm a coder, not a sys admin.

I understand Forge takes care of security updates for me, but not "other" package updates. When I ssh into my servers I see:

109 packages can be updated.
0 updates are security updates.

What is the best practice for updating/upgrading all those other packages? Should I / can I just upgrade them all the time? If I do so is it possible that will break my apps? What are the best apt-get commands to do the updates/upgrades?

Thanks/

zelaza left a reply on Environment Variables On Queued Jobs? • 1 year ago

Does anyone have any thoughts on this? Seems pretty important - your config and env variables do weird, unexplainable things when accessed from inside queued jobs...?

Any help?

zelaza left a reply on Config('value') Is Not Working On Cron(laravel Scheduler) • 1 year ago

This looks like the same problem I posted a question about recently - config and environment variables not working as expected in Laravel queued jobs.

This seems like a pretty important issue - your config and env variables do weird stuff (really weird) when accessed from inside a queued job...

Any help?

28th July, 2017

zelaza started a new conversation Incredibly Strange Env Behavior • 1 year ago

Guys, I am struggling with something that I just cannot understand.

I have a .env file with some variables in it:

TEST=testval
FACEBOOK_APP_ID=whatever

When I access env('FACEBOOK_APP_ID') from a controller it works as expected - I get back 'whatver'.

env('TEST') works as expected, both in the controller and in the queued job.

But when I do the same thing from a queued Job, env('FACEBOOK_APP_ID') ALWAYS returns the value 469738190039286 - even when I delete the FACEBOOK_APP_ID line from the .env file.

It's as if something is "overwriting" env('FACEBOOK_APP_ID')...

I'm not kidding - this is really happening.

Any ideas?

Thanks.

16th May, 2017

zelaza started a new conversation Queued Broadcast Events Not Working • 1 year ago

Hi. I'm trying to get Broadcast Events working in Laravel 5.4. I've been killing myself for days trying to get them to work, and in a final act of desperation I changed:

class TestEvent implements ShouldBroadcast

to

class TestEvent implements ShouldBroadcastNow

in my TestEvent class, effectively bypassing the queue, and all of a sudden it works.

My queues are working fine - I use them for other things that are working.

Does anyone know why this would work without queuing but fail with queuing?

Thanks.

24th April, 2017

zelaza left a reply on Does Each Event Need A Listener? • 1 year ago

Well, I tested it with Laravel 5.4 and it does indeed appear that you can fire off an Event without any corresponding entry in EventServiceProvider.php or any corresponding Listener without taking any errors. So all's right with the world.

zelaza left a reply on Does Each Event Need A Listener? • 1 year ago

Thanks, Mike - I will give that a try - it's better than having to create "dummy" Listener classes. I'm also going to re-test what happens if I fire an Event that has no corresponding key in the $listen array at all.

In general I think we should be able to fire off an Event without any requirement to define a Listener, even an empty one as you are suggesting.

23rd April, 2017

zelaza started a new conversation Does Each Event Need A Listener? • 1 year ago

Hi. I'm building a Laravel package, and I want it do dispatch Events that may or may not have Listeners in the application. I seem to recall that if I dispatch an Event that doesn't have a Listener, I get an error? Is that still true and, if so, why, and is there a way to get around it other than creating "placeholder" do-nothing Listeners just to avoid taking the error?

It seems like we should be able to dispatch Events that don't necessarily have Listeners, no?

22nd April, 2017

zelaza left a reply on [L5] Register A Route Middleware At Package • 1 year ago

This is such a beautiful thing. But to make it work in 5.4 do the following:

public function boot(\Illuminate\Routing\Router $router) {
    $router->aliasMiddleware('name', 'MiddlewareClass');
}

14th March, 2017

zelaza left a reply on Laravel 5.4 Mix: How To Version Some Files But Not Others? • 1 year ago

Wish someone would answer this...

7th March, 2017

zelaza left a reply on Can't Get Later() To Delay Queued Emails (in Laravel 5.4) • 1 year ago

Thanks, KenoKokoro.

After further investigation it turns out that I had my QUEUE_DRIVER environment variable set to 'sync' rather than 'beanstalkd'.

Changing it to 'beanstalkd' solved the problem.

6th March, 2017

zelaza started a new conversation Can't Get Later() To Delay Queued Emails (in Laravel 5.4) • 1 year ago

I can't seem to get the later() function to actually delay the sending of emails. When I do this:

$when = Carbon::now()->addMinutes(5);
$mailJob = (new WelcomeEmail($emailData))->onQueue('mail');
Mail::to($emailAddress)->later($when, $mailJob);

or this:

$mailJob = (new WelcomeEmail($emailData))->onQueue('mail');
Mail::to($emailAddress)->later(300, $mailJob);

the emails go out immediately - I'm not even sure they're being queued at all let alone delayed... Any thoughts? Thanks.

27th February, 2017

zelaza started a new conversation Global Scopes Break Static Methods In Eloquent Models...? • 1 year ago

I have a public static method defined in an Eloquent Model, something like:

class MyBlurf extends Model {

    public static function blurf() {
        return 'blurf';
    }

}

When I have no Global Scopes defined on the Model the following works fine:

$strBlurf = MyBlurf::blurf();

But when I add a Global Scope to the Model:

class MyBlurf extends Model {

    protected static function boot()
    {
        parent::boot();
        static::addGlobalScope(new UserScope);
    }

    public static function blurf() {
        return 'blurf';
    }

}

and I do:

$strBlurf = MyBlurf::blurf();

I get:

BadMethodCallException: Call to undefined method Illuminate\Database\Query\Builder::blurf() in /home/forge/xxx/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2508

How can I make Global Scopes and Static Methods work at the same time??

26th February, 2017

zelaza started a new conversation Constructors And The Artisan Route:list Command • 1 year ago

The Artisan route:list command seems to need to instantiate all of your Controllers, so if you ever put anything in a Controller constructor that causes an error when the constructor gets called from the command line, you will break your php artisan route:list command, which is not a happy thing.

You can usually prevent this by carefully avoiding putting anything in any of your Controller constructors that would cause an error when run from the artisan command line.

However, there are certain situations where it makes really good programming sense to put something in a Controller that will take an error when called via artisan route:list (e.g. Controllers with several methods that all require a real http Request, which does not exist when the constructor is called by artisan).

In these cases I have been forced to put some logic in the Controller constructor that avoids taking the error by returning immediately when the constructor is being called by Artisan, e.g.:

    public function __construct(Request $request)
    {

        if ($_SERVER['PHP_SELF'] == 'artisan') {
            return null;
        }

I don't really like the above approach for a number of reasons, but it works.

Is there a "better" way to solve this problem?

19th February, 2017

zelaza started a new conversation Issue With Mix.js() On Laravel 5.4 • 1 year ago

I'm having an issue with Mix.js on Laravel 5.4. I'm trying to "compile" a simple, standalone js file that is really just anonymous, self-calling function, e.g.:

(function() {

    /* Load Script function we may need to load jQuery from the Google's CDN */
    /* That code is world-reknown. */
    /* One source: http://snipplr.com/view/18756/loadscript/ */

    var loadScript = function(url, callback){

        var script = document.createElement("script");
        script.type = "text/javascript";

    // etc, etc

I guess I don't really have to "compile" it, but I'm trying to run it through Mix.js so that it gets uglified when I run "npm run production".

But when I do "npm run dev" I get:


 ERROR  Failed to compile with 1 errors                                                                                                                                9:28:57 AM

This dependency was not found in node_modules:

* /Users/xxx/Code/test/resources/assets/yyy/js/zzz_app_a.js

Did you forget to run npm install --save for it?

Note that my source file is definitely located at "/Users/xxx/Code/test/resources/assets/yyy/js/zzz_app_a.js".

I have no idea why the error message is talking about "node_modules". I also don't know why node is calling it a "dependency"...

And I also get a Laravel Mix notice briefly flashing up on the screen that seems to say something about "Error: undefined error: can't resolve /Users..." and a path that flows out of the little message box and out of sight (is there any way to actually see the whole Laravel Mix error, by the way?).

Although it takes an error, it actually seems to "compile" the file. So I'm putting my Mix.js call for this at the very end of my webpack.mix.js file and running it with the error...

Note: this used to work fine on Elixir...

Is there a way to do what I want to do (essentially copy the js file when running "npm run dev" but uglify it when running "npm run production"), without getting errors?

zelaza left a reply on Can't Get Laravel Mix To Work - Frustration LIMIT Reached • 1 year ago

Hi. I'm having a similar issue with Mix. I'm trying to "complile" a simple, standalone js file that is really just anonymous, self-calling functions, e.g.:

(function() {

    /* Load Script function we may need to load jQuery from the Google's CDN */
    /* That code is world-reknown. */
    /* One source: http://snipplr.com/view/18756/loadscript/ */

    var loadScript = function(url, callback){

        var script = document.createElement("script");
        script.type = "text/javascript";

        // If the browser is Internet Explorer.
        if (script.readyState){
            script.onreadystatechange = function(){
                if (script.readyState == "loaded" || script.readyState == "complete"){
                    script.onreadystatechange = null;
                    callback();
                }
            };
            // For any other browser.
        } else {
            script.onload = function(){
                callback();
            };
        }

        script.src = url;
        document.getElementsByTagName("head")[0].appendChild(script);

etc, etc

I guess I don't really have to "compile" it, but I'm trying to run it through Mix.js so that it gets uglified when I run "npm run production".

But when I do "npm run dev" I get:


 ERROR  Failed to compile with 1 errors                                                                                                                                9:28:57 AM

This dependency was not found in node_modules:

* /Users/xxx/Code/test/resources/assets/yyy/js/zzz_app_a.js

Did you forget to run npm install --save for it?

Although it takes an error, it actually seems to "compile" the file. So I'm putting my Mix.js call for this at the very end of my webpack.mix.js file and running it with the error...

Is there a way to do what I want to do (without getting errors)?

10th February, 2017

zelaza started a new conversation How To Use Spark Without Billing Plans? • 1 year ago

Hi. What is the best way to use Spark with no billing, or with only a Free Plan and defaulting to the Free Plan? Thanks.

zelaza left a reply on How To Register/Create A User Programmatically? • 1 year ago

Thanks very much, themsaid. That looks like what I need. I will try it!

8th February, 2017

zelaza left a reply on How To Register A User Programmatically? • 1 year ago

Thanks for the response, Ben. I actually started thinking about something like that, but I'm thinking that since this is Spark and not just straight Laravel I can't just create a User. I think Spark does a lot more stuff when it creates a User... no?

zelaza left a reply on How To Register A User? • 1 year ago

No ideas on how to do this...?

zelaza started a new conversation How To Register A User? • 1 year ago

Hi. I need to register a User programmatically, without going through the normal form-based registration process.

I thought about mimicking what's in the register() method in the RegisterController:

    public function register(RegisterRequest $request)
    {
        Auth::login($user = Spark::interact(
            Register::class, [$request]
        ));

        event(new UserRegistered($user));

        return response()->json([
            'redirect' => $this->redirectPath()
        ]);
    }

but I don't know how to mimic the $request argument to Spark::interact().

So then I thought about just doing an http POST request to the [email protected]() method thus:

    public function register_user()
    {

        $data = [
            'name' => 'Joe User',
            'email' => '[email protected]',
            'password' => 'j0eybaby',
            'password_confirmation' => 'j0eybaby',
            'terms' => true,
            'busy' => true,
            'successful' => false,
            '_token' => csrf_token()
        ];

        $client = new GuzzleHttp\Client();
        $client->request('POST', 'https://www.hex1b.com/register', ['form_params' => $data]);

    }

but that gives mne a 500 Internal Server error.

Is there any way to do what I'm trying to do?

Thanks.

4th February, 2017

zelaza left a reply on Use Created_at In Accessor In Laravel 5.3? • 1 year ago

As far as I can tell 'created_at' is not available in an Accessor.

When I do this:

    // pseudo-fields appended to models when exported to json
    protected $appends = ['age_days'];

    // return age of model in days since 'created_at'
    public function getAgeDaysAttribute() {

        Log::info("\n\n****************************************");
        Log::info('$this: ' . var_export($this, true));


        Log::info("\n\n****************************************");
        Log::info('$this->attributes: ' . var_export($this->attributes, true));

        $arrayDates = $this->getDates();
        Log::info("\n\n****************************************");
        Log::info('$arrayDates: ' . var_export($arrayDates, true));

    }

I get this:

[2017-02-04 07:43:45] production.INFO: 

****************************************  
[2017-02-04 07:43:45] production.INFO: $this: App\ShopifyInquiry::__set_state(array(
   'connection' => 'tenant',
   'fillable' => 
  array (
    0 => 'state',
  ),
   'appends' => 
  array (
    0 => 'age_days',
  ),
   'table' => NULL,
   'primaryKey' => 'id',
   'keyType' => 'int',
   'perPage' => 15,
   'incrementing' => true,
   'timestamps' => true,
   'attributes' => 
  array (
    'state' => 'Open',
    'conversions' => 0,
    'conversion_value' => '0.0000',
    'conversion_currency' => '',
    'received_at' => '2017-02-04 07:34:19',
    'received_at_date' => '2017-02-04',
  ),
   'original' => 
  array (
    'state' => 'Open',
    'conversions' => 0,
    'conversion_value' => '0.0000',
    'conversion_currency' => '',
    'received_at' => '2017-02-04 07:34:19',
    'received_at_date' => '2017-02-04',
  ),
   'relations' => 
  array (
  ),
   'hidden' => 
  array (
  ),
   'visible' => 
  array (
  ),
   'guarded' => 
  array (
    0 => '*',
  ),
   'dates' => 
  array (
  ),
   'dateFormat' => NULL,
   'casts' => 
  array (
  ),
   'touches' => 
  array (
  ),
   'observables' => 
  array (
  ),
   'with' => 
  array (
  ),
   'exists' => true,
   'wasRecentlyCreated' => false,
))  
[2017-02-04 07:43:45] production.INFO: 

****************************************  
[2017-02-04 07:43:45] production.INFO: $this->attributes: array (
  'state' => 'Open',
  'conversions' => 0,
  'conversion_value' => '0.0000',
  'conversion_currency' => '',
  'received_at' => '2017-02-04 07:34:19',
  'received_at_date' => '2017-02-04',
)  
[2017-02-04 07:43:45] production.INFO: 

****************************************  
[2017-02-04 07:43:45] production.INFO: $arrayDates: array (
  0 => 'created_at',
  1 => 'updated_at',
)  

It seems like 'created_at' is not an attribute of the model and there is no way to "get it" in an accessor...?

zelaza left a reply on Use Created_at In Accessor In Laravel 5.3? • 1 year ago

As far as I can tell 'created_at' is not available in an accessor.

When I do this:

    // pseudo-fields appended to models when exported to json
    protected $appends = ['age_days'];
    
    // return age of model in days since 'created_at'
    public function getAgeDaysAttribute() {

        Log::info("\n\n****************************************");
        Log::info('$this: ' . var_export($this, true));


        Log::info("\n\n****************************************");
        Log::info('$this->attributes: ' . var_export($this->attributes, true));

        $arrayDates = $this->getDates();
        Log::info("\n\n****************************************");
        Log::info('$arrayDates: ' . var_export($arrayDates, true));

        // return Carbon::createFromFormat('Y-m-d H:i:s', $this->received_at)->diffInDays();

    }

I get this:

Last login: Fri Feb 3 21:23:16 on ttys001 Kurt-MacBook-Pro:~ laurencebertone$ ssh [email protected] Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-53-generic x86_64)

Get cloud support with Ubuntu Advantage Cloud Guest: http://www.ubuntu.com/business/services/cloud

107 packages can be updated. 0 updates are security updates.

*** System restart required *** Last login: Fri Feb 3 21:23:21 2017 from 96.32.44.5 [email protected]:~$ cd www* [email protected]:~/www.hex1b.com$ cd sto* [email protected]:~/www.hex1b.com/storage$ cd logs [email protected]:~/www.hex1b.com/storage/logs$ rm *.log [email protected]:~/www.hex1b.com/storage/logs$ ls laravel.log [email protected]:~/www.hex1b.com/storage/logs$ vi *.log [email protected]:~/www.hex1b.com/storage/logs$ vi *.log [email protected]:~/www.hex1b.com/storage/logs$ rm *.log [email protected]:~/www.hex1b.com/storage/logs$ vi *.log [email protected]:~/www.hex1b.com/storage/logs$ rm *.log [email protected]:~/www.hex1b.com/storage/logs$ vi *.log [email protected]:~/www.hex1b.com/storage/logs$ rm .log [email protected]:~/www.hex1b.com/storage/logs$ cd [email protected]:~$ cd www [email protected]:~/www.hex1b.com$ php artisan tenant_migrate:reset

  • Application In Production!     *
    

Do you wish to continue? [y|n] (yes/no) [no]:

yes

Tenant Database: db_1 Rolled back: 2016_12_31_150500_create_shopify_inquirers_table Rolled back: 2016_12_29_230500_create_shopify_customers_table Rolled back: 2016_11_28_235855_create_shopify_inquiries_table [email protected]:~/www.hex1b.com$ php artisan tenant_migrate:migrate

  • Application In Production!     *
    

Do you wish to continue? [y|n] (yes/no) [no]:

yes

Tenant Database: db_1

[Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'received_at' (SQL: create table shopify_inquiries (id int unsigned not null auto_incre ment primary key, type varchar(255) not null, shop varchar(255) not null, shop_name varchar(255) not null, first_name varchar(255) not null, last_name varchar(255) not null, name varchar(255) not null, email varchar(255) not null, product_id varchar(255) not null, product_title varchar(255) not null, product_image_url varcha r(255) not null default '', product json not null, variant_id varchar(255) not null, sku varchar(255) not null, variant_title varchar(255) not null, variant_url va rchar(255) not null, variant json not null, window_location json not null, theme json not null, path_prefix varchar(255) not null, timestamp varchar(255) not null, signature varchar(255) not null, comment text null, state enum('Archived', 'Closed', 'Converted', 'Deferred', 'Fulfilled', 'Open') not null default 'Open', state_bef ore_archived enum('Closed', 'Converted', 'Deferred', 'Fulfilled', 'Open') null, was_closed tinyint(1) not null default '0', was_closed_at timestamp null, was_fulfilled tinyint(1) not null default '0', was_fulfilled_at timestamp null, was_deferred tinyint(1) not null default '0', was_deferred_at timestamp null, was_converted tinyi nt(1) not null default '0', was_converted_at timestamp null, was_archived tinyint(1) not null default '0', was_archived_at timestamp null, conversions int not null d efault '0', conversion_currency varchar(255) not null default '', conversion_value decimal(13, 4) not null default '0', customer_value decimal(13, 4) not null default '0', received_at_date date not null, received_at timestamp not null, last_checked_at timestamp null, resolved_at timestamp null, created_at timestamp null, update d_at timestamp null) default character set utf8 collate utf8_unicode_ci)

[PDOException] SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'received_at'

[email protected]:~/www.hex1b.com$ [email protected]:~/www.hex1b.com$ [email protected]:~/www.hex1b.com$ php artisan tenant_migrate:migrate

  • Application In Production!     *
    

Do you wish to continue? [y|n] (yes/no) [no]:

yes

Tenant Database: db_1 Migrated: 2016_11_28_235855_create_shopify_inquiries_table Migrated: 2016_12_29_230500_create_shopify_customers_table Migrated: 2016_12_31_150500_create_shopify_inquirers_table [email protected]:~/www.hex1b.com$ [email protected]:~/www.hex1b.com$ cd sto* [email protected]:~/www.hex1b.com/storage$ cd logs [email protected]:~/www.hex1b.com/storage/logs$ vi *.log [email protected]:~/www.hex1b.com/storage/logs$ [email protected]:~/www.hex1b.com/storage/logs$ [email protected]:~/www.hex1b.com/storage/logs$ rm *.log [email protected]:~/www.hex1b.com/storage/logs$ ls -la total 12 drwxrwxr-x 2 forge forge 4096 Feb 4 07:33 . drwxrwxr-x 5 forge forge 4096 Jan 5 23:02 .. -rw-rw-r-- 1 forge forge 14 Dec 8 21:16 .gitignore [email protected]:~/www.hex1b.com/storage/logs$ ls -la total 12 drwxrwxr-x 2 forge forge 4096 Feb 4 07:33 . drwxrwxr-x 5 forge forge 4096 Jan 5 23:02 .. -rw-rw-r-- 1 forge forge 14 Dec 8 21:16 .gitignore [email protected]:~/www.hex1b.com/storage/logs$ ls -la total 16 drwxrwxr-x 2 forge forge 4096 Feb 4 07:33 . drwxrwxr-x 5 forge forge 4096 Jan 5 23:02 .. -rw-rw-r-- 1 forge forge 14 Dec 8 21:16 .gitignore -rw-r--r-- 1 forge forge 2871 Feb 4 07:34 laravel.log [email protected]:~/www.hex1b.com/storage/logs$ vi *.log [email protected]:~/www.hex1b.com/storage/logs$ rm *.log [email protected]:~/www.hex1b.com/storage/logs$ rm *.log [email protected]:~/www.hex1b.com/storage/logs$ vi *.log [email protected]:~/www.hex1b.com/storage/logs$ rm *.log [email protected]:~/www.hex1b.com/storage/logs$ vi *.log [email protected]:~/www.hex1b.com/storage/logs$ rm *.log [email protected]:~/www.hex1b.com/storage/logs$ vi *.log [email protected]:~/www.hex1b.com/storage/logs$ vi *.log

[2017-02-04 07:43:45] production.INFO:

[2017-02-04 07:43:45] production.INFO: $this: App\ShopifyInquiry::__set_state(array( 'connection' => 'tenant', 'fillable' => array ( 0 => 'state', ), 'appends' => array ( 0 => 'age_days', ), 'table' => NULL, 'primaryKey' => 'id', 'keyType' => 'int', 'perPage' => 15, 'incrementing' => true, 'timestamps' => true, 'attributes' => array ( 'state' => 'Open', 'conversions' => 0, 'conversion_value' => '0.0000', 'conversion_currency' => '', 'received_at' => '2017-02-04 07:34:19', 'received_at_date' => '2017-02-04', ), 'original' => array ( 'state' => 'Open', 'conversions' => 0, 'conversion_value' => '0.0000', 'conversion_currency' => '', 'received_at' => '2017-02-04 07:34:19', 'received_at_date' => '2017-02-04', ), 'relations' => array ( ), 'hidden' => array ( ), 'visible' => array ( ), 'guarded' => 1,1 Top

As shown, 'created_at' is not an attribute...

zelaza left a reply on Use Created_at In Accessor In Laravel 5.3? • 1 year ago

By the way, I'm using Laravel Spark - I don't think that should matter, but I am...

zelaza left a reply on Use Created_at In Accessor In Laravel 5.3? • 1 year ago

Thanks, but when I do that I get:

FatalErrorException in helpers.php line 519:

Method Illuminate\Database\Eloquent\Collection::__toString() must not throw an exception, caught ErrorException: Undefined index: created_at

3rd February, 2017

zelaza left a reply on Use Created_at In Accessor In Laravel 5.3? • 1 year ago

Thanks for responding. Yes, I tried $this->attributes['created_at'] and it failed (it was NULL). In fact even $this->attributes appeared NULL...

It's as if $this->created_at doesn't even exist, but it does (I can see it in the DB)...

zelaza started a new conversation Use Created_at In Accessor In Laravel 5.3? • 1 year ago

Hi. I'm trying to use created_at in an model accessor method in Laravel 5.3, and I can't get it to work. Basically I am trying to create and appended property called 'age_days' using an accessor method called getAgeDaysAttribute() that returns the age of the model in days since the created_at date. But when I try to use created_at in an accessor it is always null. Here is an example of the code I have tried

   /*
     * Pseudo-fields that get added to the models when the models are exported to json.
     */
    protected $appends = ['age_days'];


    /*
     * Returns age of model in days since created_at.
     */
    public function getAgeDaysAttribute() {

        return $this->created_at->diffInDays();
        // return Carbon::createFromFormat('Y-m-d H:i:s', $this->created_at)->diffInDays();

    }

25th January, 2017

zelaza left a reply on Spark Bug • 1 year ago

Actually, I can't even find the "Spark repo". I see laravel/spark-installer and laravel/spark-docs... How can I submit an issue? Thanks

zelaza left a reply on Spark Bug • 1 year ago

Ok, thanks, I'll submit it as an issue. In my opinion it's a really good and important feature to have - if you are going to refuse to downgrade a user's subscription you need to tell them why RIGHT NOW - refusing to downgrade them and giving them a generic "contact support" message is a really (unacceptably) bad user experience. I did change the code myself, but I'd rather have the Spark developers make the change so that all Spark users can benefit from it.

16th January, 2017

zelaza started a new conversation Spark Bug • 1 year ago

Hi.

I think there's a bug in the 'updateSubscription()' method of the 'subscriptions.js' mixin that's preventing messages thrown in IneligibleForPlan::because($message) from being displayed to the user.

The message that gets displayed when the IneligibleForPlan exception gets thrown is hard-coded to "We were unable to update your subscription. Please contact customer support".

I think the line:

this.planForm.errors.set({plan: ["We were unable to update your subscription. Please contact customer support."]});

needs to be changed to:

this.planForm.errors.set({plan: response.body.plan});

or some similar fix.

Anyone know how to submit this as a real bug report?

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.