# |
Jan 22nd 2020, 19:41 |
ricksaccous |
they have that but if it doesn't have what you want then you should figure out a way to handle it on your own |
# |
Jan 22nd 2020, 19:41 |
ricksaccous |
https://book.cakephp.org/authorization/2/en/middleware.html#identity-decorator |
# |
Jan 22nd 2020, 19:40 |
ricksaccous |
oh, within the view... |
# |
Jan 22nd 2020, 19:40 |
ricksaccous |
https://github.com/cakephp/authorization |
# |
Jan 22nd 2020, 19:39 |
ricksaccous |
yeah, there's docs for the authorization plugin |
# |
Jan 22nd 2020, 19:37 |
FredSavagely |
Is there a resource somewhere that can show me how to use authorization within the view in CakePHP 4? |
# |
Jan 22nd 2020, 17:56 |
jslamka5685 |
I am already ordering the query. I will make sure I am not overlooking something |
# |
Jan 22nd 2020, 17:55 |
ricksaccous |
show what you're attempting if you want |
# |
Jan 22nd 2020, 17:55 |
ricksaccous |
or you can simply ->order() the query you are paginating |
# |
Jan 22nd 2020, 17:55 |
ricksaccous |
you can set it in the paginator settings via 'order' |
# |
Jan 22nd 2020, 17:54 |
jslamka5685 |
How can I grab the latest 20 sort ASC? |
# |
Jan 22nd 2020, 17:54 |
ricksaccous |
why not just sort by created ASC |
# |
Jan 22nd 2020, 17:53 |
jslamka5685 |
I planned to sort by created DESC then reverse the order so the conversation appears like what youd see in your SMS app on a phone |
# |
Jan 22nd 2020, 17:53 |
ricksaccous |
if you don't care about sorting by other means |
# |
Jan 22nd 2020, 17:53 |
ricksaccous |
also you can either use paginator links or simply order the query you are paginating |
# |
Jan 22nd 2020, 17:52 |
ricksaccous |
this doesn't explain why you have to reverse the item order |
# |
Jan 22nd 2020, 17:52 |
ricksaccous |
ok... |
# |
Jan 22nd 2020, 17:50 |
jslamka5685 |
messaging between two users |
# |
Jan 22nd 2020, 17:50 |
jslamka5685 |
It is to display a conversation |
# |
Jan 22nd 2020, 17:50 |
ricksaccous |
@jslamka5685 this is the problem you are trying to solve right? |
# |
Jan 22nd 2020, 17:49 |
ricksaccous |
are you wanting to reverse them because of possible nulls? |
# |
Jan 22nd 2020, 17:49 |
ricksaccous |
.... |
# |
Jan 22nd 2020, 17:49 |
mark.mikkelson |
couldn't you just use ?sort=dateanddirection=desc |
# |
Jan 22nd 2020, 17:40 |
jslamka5685 |
How can I reverse the item order in a pagintor object? |
# |
Jan 22nd 2020, 17:39 |
jslamka5685 |
To do this, I believe I need to select records in descending order and then reverse them |
# |
Jan 22nd 2020, 17:39 |
jslamka5685 |
When working with Cake3x paginator, I am looking to get the latest records in ASC order. |
# |
Jan 22nd 2020, 17:25 |
slackebot |
my end point ( /tickets/update ) . I have this in my routes.php : `Router::scope('/tickets', function (RouteBuilder $routes) {` `});` |
# |
Jan 22nd 2020, 17:25 |
mark.mikkelson |
Afternoon all. (in 3.7.7) I'm trying to disable the CSRF middleware for a route or just entirely for the full cake app, but having no joy. I've implemented what's documented here: https://book.cakephp.org/3/en/controllers/middleware.html#cross-site-request-forgery-csrf-middleware (ie. modified application.php and config/routes.php) however, end up getting the same error "Error: Missing CSRF token cookie" when im making json posts to |
# |
Jan 22nd 2020, 17:19 |
matt |
thanks for helping guys |
# |
Jan 22nd 2020, 17:18 |
matt |
deleting the table i felt was a good approch |
# |
Jan 22nd 2020, 16:33 |
neon1024 |
..and allows easier re-indexing |
# |
Jan 22nd 2020, 16:26 |
ricksaccous |
that would invalidate the key constraint though, but i don't know if that wuold stop you from destroying/recreating the table |
# |
Jan 22nd 2020, 16:26 |
ricksaccous |
that's what i tend to do |
# |
Jan 22nd 2020, 16:26 |
ricksaccous |
after that use logic to refill the data if the data is necessary |
# |
Jan 22nd 2020, 16:26 |
ricksaccous |
destroy the table in a migration and recreate it |
# |
Jan 22nd 2020, 16:25 |
ricksaccous |
when trying to change the primary key to another column it's usually not worth it |
# |
Jan 22nd 2020, 16:25 |
matt |
i think it worked but when it tried to backfill the table it sets all to 0 |
# |
Jan 22nd 2020, 16:25 |
matt |
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' in /home/vagrant/Apps/clubtrac.local/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php:16 |
# |
Jan 22nd 2020, 16:24 |
ndm |
https://book.cakephp.org/phinx/0/en/migrations.html#working-with-foreign-keys |
# |
Jan 22nd 2020, 16:24 |
matt |
will try that |
# |
Jan 22nd 2020, 16:23 |
ndm |
So there's a foreign key constraint that you need to drop first |