deansatch

deansatch

Member Since 1 Year Ago

Experience Points 37,630
Experience
Level
Lessons Completed 173
Lessons
Completed
Best Reply Awards 27
Best Answer
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.

26 Nov
2 weeks ago

deansatch left a reply on Supervisor Queue:work Failing

@BURLRESEARCH - Yeah I fixed the dB issue so hopefully it won’t happen again.

But it wasn’t that the jobs were failing, after sql automatically reboots it just wouldn’t run the jobs...they were still sitting in the table. I had to do reread and update just to get it to start working properly again

24 Nov
3 weeks ago

deansatch started a new conversation Best Answer Button 404

Tried marking a best answer and end up on the 404 page every time. A couple of what seems like variable names being output in the url.

Just in case it is caused by js errors...this was on an iPhone 7 safari - haven’t tried it from my laptop yet

deansatch left a reply on Inserting Game Points To DB As They Are Playing

@SNAPEY - Yeah that makes sense. Thanks (can’t mark your answer as best as I get 404)

I was also wondering if maybe there was some way of using a queue? Not sure exactly how it works behind the scenes but like when you use queue to send emails so they go in the background after the user may have closed the tab. And wondered if it could sort the que into a single dB insert rather than insert each queued item one by one?

deansatch left a reply on Inserting Game Points To DB As They Are Playing

The answers are math questions so viewing console won’t help and they only have a few seconds to answer

So if I have thousands of players at the same time, how should I handle this to get each answer in the dB?

23 Nov
3 weeks ago

deansatch started a new conversation Inserting Game Points To DB As They Are Playing

Not so much an eloquent question but more advice on best performance for inserting to dB...

If I have a game where players can answer questions every 2-3 seconds and I want to store their score and answers, would an insert on ever single answer be bad? Especially since there could be hundreds or even thousands of people playing at the same time

I know I could accumulate their answers and submit them all together at the end but I don’t want them to be able to just refresh the page or close the tab if they are scoring terrible as it needs to log their performance without allowing them to cheat like this in an attempt to improve their overall efficiency score

deansatch left a reply on Supervisor Queue:work Failing

@BURLRESEARCH - That returns www-data which is the same user I use for setting all permissions on folders. It does work as root but it seems like when the DB has any sort of failure and reboots it just doesn't seem to restart the processes.

So if I type supervisorctl now I will see 3 processes RUNNING. But if I come back in a week or so, no doubt the DB will have had some issue and typing supervisorctl then will show them tasks as FAILED for exiting too quickly.

20 Nov
3 weeks ago
18 Nov
3 weeks ago

deansatch left a reply on Create Child And Have It Belong To Family Where I Clicked To 'Add Child'

If you are doing it like that you can just change your form method to GET and family_id will be in the url query string and available with request()->family_id

deansatch started a new conversation Supervisor Queue:work Failing

I set up a worker with supervisor on a site a while back which is supposed to send out emails on dates chosen by customers. It seems to have stopped working at some point as a couple of jobs in my database 'jobs' table were meant to go out today and didn't.

I checked the worker.log file and there are hundreds of lines saying things along the lines of:

[Illuminate\Database\QueryException] SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_s chema.tables where table_schema = homestead and table_name = site_settings)

[Doctrine\DBAL\Driver\PDOException] SQLSTATE[HY000] [2002] Connection refused

my supervisor/conf.d/laravel-worker.conf file looks like this:


[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/site/artisan queue:work --sleep=10 --tries=3 
autostart=true
autorestart=true
user=root
numprocs=3
redirect_stderr=true
stdout_logfile=/var/www/site/storage/supervisor/worker.log


If I run "cd /var/www/site/" then "php artisan queue:work" from ssh the jobs go out as they should. Any ideas? It seems really tough to debug stuff like this. Also is there any way I can monitor this so that I don't have to rely on the unhappy customers letting me know an email never turned up

08 Aug
4 months ago

deansatch started a new conversation Token Mismatch On Localhost Only

I have a site which works fine on the live server. It also works fine on my old macbook localhost. I have copied it over to my new macbook but when I try sign in or sign up I get a token mismatch error. Tried it on valet, then homestead (with homestead mysql) but it still throws the error. "Illuminate \ Session \ TokenMismatchException"

This is an exact copy of the one on my other macbook - I've tried clearing cache & config. Cleared cookies. If I push this to production it works ok on there.

Any ideas?

02 Aug
4 months ago

deansatch left a reply on Homestead Apache Gives 500 Error When Setting Php_value

Anyone any ideas? I've wasted a full day on this now :(

Still got about 20 more VMs to set up and don't want to keep replicating the issue

deansatch left a reply on Homestead Apache Gives 500 Error When Setting Php_value

Config variable ${APACHE_RUN_DIR} is not defined apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot

deansatch started a new conversation Homestead Apache Gives 500 Error When Setting Php_value

Just got a brand new macbook, transferred all my projects over and installed fresh homestead, vbox, vagrant etc...

I have php_value in my htaccess file for a site which worked ok on my previous mac but throws the internal server error on my new one. If I delete those lines all works.

Any idea what I'm missing? I didn't have to do any particular changes on my old mac to get that working.

btw - I use homestead on per project basis so ideally I don't want to have to ssh into every new vagrant server to mess with modules...hoping more for a global solution

08 May
7 months ago

deansatch left a reply on WithTrashed() If User Is Admin

I did try that but they seem to be called before Auth so I can’t do my if statement

deansatch started a new conversation WithTrashed() If User Is Admin

Is there a way to add withTrashed() to a model only if the Auth::user()->isAdmin(). So basically records are deleted to front end users but admins can still work with them when logged in?

04 May
7 months ago

deansatch left a reply on Task Belongs To Project And/or Milestone

Never mind...just remembered I can do a morphOne

deansatch started a new conversation Task Belongs To Project And/or Milestone

I want a user to be able to create a 'Task' and that task could belong to a 'Project' or it could belong to a 'Milestone'. (A milestone will always belong to a project).

What's the best table setup for this? Pivot? I want to keep options open for future too where a Task could belong to anything e.g. user, product etc...

25 Mar
8 months ago

deansatch started a new conversation "My Participation" Bug

Tiny little bug:

Someone posted a question. I answered. I edited my answer. Went to "My Participation" and no sign of that thread.

Whatever the cause, it might be related to some other inconsistencies I've noticed with the "- {{time}} by {{user}} UDATED" sometimes not showing the correct name too

deansatch left a reply on Mysql Goes Down

Is that not just to stop warning in the log file? I'm more concerned with why mysql keeps shutting down and restarting

deansatch left a reply on Need To Sort Prodcut By Price ASC And DESC

@snapey Just out of curiosity, what would happen if someone changed the url to ?sort=hello - would it throw an error?

deansatch left a reply on Mysql Goes Down

Any ideas anyone?

22 Mar
8 months ago

deansatch left a reply on Mysql Goes Down


2018-03-20T09:50:20.352122Z 31702 [Note] Aborted connection 31702 to db: 'unconnected' user: 'root' host: 'localhost' (Got an error reading communication packets)
2018-03-20T09:50:20.352276Z 31701 [Note] Aborted connection 31701 to db: 'lingotot' user: 'root' host: 'localhost' (Got an error reading communication packets)
2018-03-20T16:53:47.637226Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2018-03-20T16:53:47.645002Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2018-03-20T16:53:48.138787Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-03-20T16:53:48.145802Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.21-0ubuntu0.16.04.1) starting as process 22518 ...
2018-03-20T16:53:48.162467Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-03-20T16:53:48.162504Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-03-20T16:53:48.162526Z 0 [Note] InnoDB: Uses event mutexes
2018-03-20T16:53:48.162534Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-03-20T16:53:48.162541Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-03-20T16:53:48.162547Z 0 [Note] InnoDB: Using Linux native AIO
2018-03-20T16:53:48.163287Z 0 [Note] InnoDB: Number of pools: 1
2018-03-20T16:53:48.164001Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-03-20T16:53:48.168087Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-03-20T16:53:48.168443Z 0 [ERROR] InnoDB: mmap(137428992 bytes) failed; errno 12
2018-03-20T16:53:48.168465Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2018-03-20T16:53:48.168474Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-03-20T16:53:48.168486Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-03-20T16:53:48.168492Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-03-20T16:53:48.168500Z 0 [ERROR] Failed to initialize builtin plugins.
2018-03-20T16:53:48.168505Z 0 [ERROR] Aborting

2018-03-20T16:53:48.168518Z 0 [Note] Binlog end
2018-03-20T16:53:48.170083Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

2018-03-20T16:54:17.865993Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2018-03-20T16:54:17.866081Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2018-03-20T16:54:18.030503Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-03-20T16:54:18.032406Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.21-0ubuntu0.16.04.1) starting as process 22733 ...
2018-03-20T16:54:18.038007Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-03-20T16:54:18.038049Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-03-20T16:54:18.038059Z 0 [Note] InnoDB: Uses event mutexes
2018-03-20T16:54:18.038065Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-03-20T16:54:18.038072Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-03-20T16:54:18.038078Z 0 [Note] InnoDB: Using Linux native AIO
2018-03-20T16:54:18.038379Z 0 [Note] InnoDB: Number of pools: 1
2018-03-20T16:54:18.038522Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-03-20T16:54:18.040492Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-03-20T16:54:18.050071Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-03-20T16:54:18.052516Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-03-20T16:54:18.070163Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-03-20T16:54:18.072329Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 39365648
2018-03-20T16:54:18.072360Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 39365657
2018-03-20T16:54:18.072370Z 0 [Note] InnoDB: Database was not shutdown normally!
2018-03-20T16:54:18.072389Z 0 [Note] InnoDB: Starting crash recovery.
2018-03-20T16:54:18.239588Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-03-20T16:54:18.239634Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-03-20T16:54:18.239698Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-03-20T16:54:18.268402Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-03-20T16:54:18.269730Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-03-20T16:54:18.269753Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-03-20T16:54:18.270515Z 0 [Note] InnoDB: Waiting for purge to start
2018-03-20T16:54:18.320775Z 0 [Note] InnoDB: 5.7.21 started; log sequence number 39365657
2018-03-20T16:54:18.321824Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-03-20T16:54:18.322183Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-03-20T16:54:18.329836Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2018-03-20T16:54:18.329865Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2018-03-20T16:54:18.329879Z 0 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2018-03-20T16:54:18.329914Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2018-03-20T16:54:18.338620Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180320 16:54:18
2018-03-20T16:54:18.359917Z 0 [Note] Event Scheduler: Loaded 0 events
2018-03-20T16:54:18.360114Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.21-0ubuntu0.16.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
2018-03-20T16:54:18.870806Z 2 [Note] Access denied for user 'root'@'localhost' (using password: NO)


20 Mar
8 months ago

deansatch started a new conversation Mysql Goes Down

Just noticed mysql went down for a few minutes. This is the log...any ideas what the cause could be?


2018-03-20T16:54:17.865993Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2018-03-20T16:54:17.866081Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2018-03-20T16:54:18.030503Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-03-20T16:54:18.032406Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.21-0ubuntu0.16.04.1) starting as process 22733 ...
2018-03-20T16:54:18.038007Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-03-20T16:54:18.038049Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-03-20T16:54:18.038059Z 0 [Note] InnoDB: Uses event mutexes
2018-03-20T16:54:18.038065Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-03-20T16:54:18.038072Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-03-20T16:54:18.038078Z 0 [Note] InnoDB: Using Linux native AIO
2018-03-20T16:54:18.038379Z 0 [Note] InnoDB: Number of pools: 1
2018-03-20T16:54:18.038522Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-03-20T16:54:18.040492Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-03-20T16:54:18.050071Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-03-20T16:54:18.052516Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-03-20T16:54:18.070163Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-03-20T16:54:18.072329Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 39365648
2018-03-20T16:54:18.072360Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 39365657
2018-03-20T16:54:18.072370Z 0 [Note] InnoDB: Database was not shutdown normally!
2018-03-20T16:54:18.072389Z 0 [Note] InnoDB: Starting crash recovery.
2018-03-20T16:54:18.239588Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-03-20T16:54:18.239634Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-03-20T16:54:18.239698Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-03-20T16:54:18.268402Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-03-20T16:54:18.269730Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-03-20T16:54:18.269753Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-03-20T16:54:18.270515Z 0 [Note] InnoDB: Waiting for purge to start
2018-03-20T16:54:18.320775Z 0 [Note] InnoDB: 5.7.21 started; log sequence number 39365657
2018-03-20T16:54:18.321824Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-03-20T16:54:18.322183Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-03-20T16:54:18.329836Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2018-03-20T16:54:18.329865Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2018-03-20T16:54:18.329879Z 0 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2018-03-20T16:54:18.329914Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2018-03-20T16:54:18.338620Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180320 16:54:18
2018-03-20T16:54:18.359917Z 0 [Note] Event Scheduler: Loaded 0 events
2018-03-20T16:54:18.360114Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.21-0ubuntu0.16.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
2018-03-20T16:54:18.870806Z 2 [Note] Access denied for user 'root'@'localhost' (using password: NO)


19 Mar
8 months ago

deansatch left a reply on The "best" Method To Put Active Bootstrap Class On Li Element Depending On The Page

How about something like...


@if (\Route::current()->getName() == 'yourRouteName') {
    <li class="active"><a href="{{route('yourRouteName')}}">Hello</a></li>
@else
    <li><a href="{{route('yourRouteName')}}">Hello</a></li>
@endif

15 Mar
9 months ago

deansatch left a reply on How To Get Max Bid Value Of Currently Logged User


$highestbid = Bid::where('user_id', Auth::id())->max('bid'); // Highest bid of all users (works fine)

deansatch left a reply on Protected Registration

You if you need the token in your registration processing either pass the token through to a new post route or include the token in your current blade action

form class="form-horizontal" method="POST" action="{{ route('register', ['registration_token'=>$token]) }}"

You'd have to pass the token to the view though for this:


 if (RegistrationToken::where('token', $token)) {
        return view('auth.register', compact('token'));
    }

deansatch left a reply on Property [id] Does Not Exist On This Collection Instance

in your read() method dd($request) and see if that has an id. If it does make sure that ClassDetail actually has a row with course_id equal to that

deansatch left a reply on Protected Registration

In your blade template you are calling your register route somewhere without passing a token

//you must have somewhere

{{ route('register') }} 


//But it would need to be

{{ route('register', ['registration_token'=>'123']) }} 


In reality though I expect that call should be removed completely as it is invite only.

14 Mar
9 months ago

deansatch left a reply on Update Relationship Attributes

Should it not be $person->addresses()->firstWhere

deansatch left a reply on Large Collection Is Empty In HTML?

What if you try and output it outside of the attribute? I’m no expert with vue but just wondering if since it worked once and now doesn’t, and take(2) works that maybe it is a recent row/item contianing invalid data

deansatch left a reply on Exception Thrown With Message "DateTime::__construct(): Failed To Parse Time String

Looks like this might be the problem. Maybe for now just rollback your carbon version to the previous commit until php gets sorted

https://github.com/briannesbitt/Carbon/issues/1157

deansatch left a reply on Exception Thrown With Message "DateTime::__construct(): Failed To Parse Time String

Does this happen on all routes? What if you just try and return a string instead of your query?

deansatch left a reply on Validate Numbered Array

Oh I see. Give this a go


public function rules() 
  {

    $rules = [ 'exists' => [ 'areas' => ['id'] ]];

    foreach($this->request->get('area_id') as $k => $v){
        $rules['area_id.'.$k] = 'required';
    }

        return $rules;
  }

deansatch left a reply on Validate Numbered Array

Actually, array format aside...your code doesn’t seem to be anything to do with validation. Could you show more code in context?

deansatch left a reply on Validate Numbered Array

So if it’s js that creates the array you must name it when you post it (presumably Ajax)?

deansatch left a reply on Exception Thrown With Message "DateTime::__construct(): Failed To Parse Time String

It’s this - date has some negative number appended:

"DateTime::__construct(): Failed to parse time string (2018-03-14 21:13:35.-325792) at position 24 (7): Unexpected character"

Let’s see the code

deansatch left a reply on Validate Numbered Array

Surely your inputs have a name? How do you end up with that array?

deansatch left a reply on Laravel Pagination Get First Page

In that case you can access everything from the toArray() method:


<li><a href="{{ $paginator->toArray()['first_page_url'] }}">First</a></li>

deansatch left a reply on Laravel Pagination Get First Page

Like I said, why wouldn't the first page url not just be the plain route? No calculations needed


<li><a href="{{ route('yourRoute')  }}">First</a></li>

deansatch left a reply on Laravel - Follow A Collection Of Routes In Order

I would store the step number the user is up to in the database and force a redirect to that step no matter which of the routes they try to access

deansatch left a reply on Laravel Pagination Get First Page

You still could have used that to generate your page numbers, next and previous..then you would just need to add your own first and last page links either side

Wouldn't the first page link just be the plain route with no query string at all?

deansatch left a reply on Best Practice For Caching?

Jeff does a great video on Russian doll caching that might worth a watch. That way you can cache the queries you want and still update the cache when you make a change

deansatch left a reply on Laravel Pagination Get First Page

Is there a reason you are manually building this instead of just {{ $elements->links() }}

13 Mar
9 months ago

deansatch left a reply on Preferred Date, Choose 3, System Sorts Out Who Goes When

Yeah I'm just trying to get my head around what logic/math would work out at what point an event is definitely oversubscribed

e.g. Lets say there are 5 events A,B,C,D&E. And 1 person limit on each

U= user

U1 chooses A B C
U2 chooses A B C
U3 chooses A B D

// at this point one is full but I don't know which one as it could be A or B

U4 chooses A B D

// Now we can definitely say A-D are full

// But if U4 did A D E instead still only one unknown is full

U4 chooses A D E
U5 chooses A B D // this now becomes impossible as all 3 are full already


deansatch started a new conversation Preferred Date, Choose 3, System Sorts Out Who Goes When

Basically I am wanting to build something where there are events available each with 10 places available. Users can book a place but must choose their 3 most preferred dates. Then when registration closes, the system will work out who goes on what date to ensure there are no more than 10 per event.

Any ideas what the best route to take would be?

One big hurdle I can see is how could the system know if there are going to be too many people on one event. If for example 40 people happen to choose the same 3 there will be 10 people can't go any date.