Logs for #cakephp

Page 4 of 36,196, showing 100 records out of 3,619,517 total, starting on record 301, ending on 400

# At Username Text
# Jul 17th, 07:49 h.mavisakalian “SELECT name FROM Users WHERE name LIKE {$array}”
# Jul 17th, 07:47 admad @h.mavisakalian step 1: Figure out the SQL query you need to get the result you want
# Jul 17th, 07:47 conehead I think `IN` is at least one. So Even with 2 or more values it should show up
# Jul 17th, 07:46 h.mavisakalian also bring the results that have 2 of the array values in the title
# Jul 17th, 07:46 h.mavisakalian but
# Jul 17th, 07:46 h.mavisakalian $query = $this->Users->find(‘all’,[ ‘conditions’ => [‘name LIKE’ => $searchArray], ‘order’ => [‘Users.id’ => ‘ASC’] ]);
# Jul 17th, 07:46 h.mavisakalian something like this
# Jul 17th, 07:45 h.mavisakalian that is why I mentioned the LIKE
# Jul 17th, 07:45 h.mavisakalian @conehead Thank you, but I need something else… you see the problem is I need the query to give me the results of the rows that for example have 2 values from the array as well
# Jul 17th, 07:42 admad yes
# Jul 17th, 07:41 koeller @admad So the proper way would be that the client sends another index request?
# Jul 17th, 07:41 conehead @h.mavisakalian probably you need something like this: ``` $query = $this->Users->find(‘all’,[ ‘conditions’ => ['yourField IN' => $searchArray], ‘order’ => [‘Users.id’ => ‘ASC’] ]); ```
# Jul 17th, 07:40 admad @koeller for a REST API for a delete request you just respond with a success/failure status
# Jul 17th, 07:39 admad @maymeow if it's a standalone plugin first plug it into an app :slightly_smiling_face:
# Jul 17th, 07:39 koeller @admad: Okay, what would be the best way then? setting a view variable with the result of the finder im using in index Action?
# Jul 17th, 07:39 graziel @maymeow you are probably missing cache config after updating cake https://github.com/cakephp/app/blob/master/config/app.default.php#L111
# Jul 17th, 07:38 admad @koeller since you mention using JWT auth I assume you are working on a stateless REST API. There's no redirection for such requests.
# Jul 17th, 07:37 maymeow Any idea how to solve this?
# Jul 17th, 07:36 admad how do you expect `‘conditions’ => $searchArray` to work without specifying which fields/columns to use?
# Jul 17th, 07:35 dereuromark see awesome list
# Jul 17th, 07:35 koeller Hi everyone, I have a question regarding the friendsofcake/CRUD plugin. I'm doing a simple delete and try to redirect to index, so that the response of the request would be a list of all items for logged user. I'm using JWT as Authentication method. Reading this:https://crud.readthedocs.io/en/latest/actions/delete.html#crud-beforeredirect I thought, it should automatically redirect to index, but it won't. So I tried to manually redirect in
# Jul 17th, 07:35 slackebot $this->Crud->on('afterDelete') with $this->redirect(['index']) and $this->setAction('index'), but I would only recieve a NotFoundException. I'm a bit puzzled here. Thank you for reading!
# Jul 17th, 07:35 h.mavisakalian which plugin is that?
# Jul 17th, 07:35 dereuromark use Search plugin for this
# Jul 17th, 07:34 h.mavisakalian What am I doing wrong?
# Jul 17th, 07:34 h.mavisakalian But it doesn’t work
# Jul 17th, 07:34 h.mavisakalian $query = $this->Users->find(‘all’,[ ‘conditions’ => $searchArray, ‘order’ => [‘Users.id’ => ‘ASC’] ]);
# Jul 17th, 07:33 h.mavisakalian Now I want to search the database this way
# Jul 17th, 07:33 h.mavisakalian I created an array from a search query with all values using exlode(’ ’, $searchValue);
# Jul 17th, 07:31 h.mavisakalian Good morning everyone. I have a question about search queries in CakePHP 3.X
# Jul 17th, 07:25 aivaras.godliauskas here you can set conditions
# Jul 17th, 07:25 aivaras.godliauskas ``` class ArticlesTable extends Table { public function initialize(array $config) { $this->hasMany('Comments') ->setConditions(['approved' => true]); $this->hasMany('UnapprovedComments', [ 'className' => 'Comments' ]) ->setConditions(['approved' => false]) ->setProperty('unapproved_comments'); } } ```
# Jul 17th, 07:25 aivaras.godliauskas https://book.cakephp.org/3.0/en/orm/associations.html#default-association-conditions
# Jul 17th, 07:24 neon1024 I need gmp, sodium and intl
# Jul 17th, 07:24 neon1024 Anyone know where I can find package names for PHP extension for Debian Fastly?
# Jul 17th, 07:23 aivaras.godliauskas Hi @neon1024 Fun fact im useing n3on as my nic
# Jul 17th, 07:23 felix.robaglia I'd be curious how ! I'm an intern and have a lot to learn @aivaras.godliauskas ^^ How can I say it directly in the table ?
# Jul 17th, 07:23 neon1024 Morning all :wave:
# Jul 17th, 07:23 aivaras.godliauskas or you can try and use some kind of soft delete for example https://github.com/UseMuffin/Trash
# Jul 17th, 07:23 neon1024 I quite like creating my own query and passing it to the Paginator :slightly_smiling_face:
# Jul 17th, 07:22 aivaras.godliauskas if you want to do it right way you can add this condition in table itself, where realiation is defined
# Jul 17th, 07:22 admad no. read up about custom finders on manul
# Jul 17th, 07:22 felix.robaglia Like a method i'll put in my AppController admad?
# Jul 17th, 07:22 felix.robaglia Wow, thanks a lot, I must be blind then cause it has to be in the doc ! Ty guys !
# Jul 17th, 07:22 admad also a cleaner way would be to make a custom finder for that
# Jul 17th, 07:21 admad or use `conditions` like that :slightly_smiling_face:
# Jul 17th, 07:21 aivaras.godliauskas @felix.robaglia you can go ``` $this->paginate = [ 'contain' => ['Contracts'=>[ 'conditions'=>['delete IS'=>null] ] ] ]; ``` i believe
# Jul 17th, 07:21 admad @felix.robaglia `['contain' => ['Contracts' => function ($q) { $q->where(...)}]`
# Jul 17th, 07:19 felix.robaglia But I would like to only get contracts that have NULL in their 'deleted' column. I'm sorry if that's a dumb question or anything, but I did read the doc and i'm still stuck ! Thanks :slightly_smiling_face:
# Jul 17th, 07:19 felix.robaglia ``` $this->paginate = [ 'contain' => ['Contracts'] ]; ```
# Jul 17th, 07:19 felix.robaglia Hello, I'm discovering hasMany relations and i'm stuck on something I guess is really easy. I have a clients table, and it hasMany contracts. So I use this piece of code to retrieve contracts in my Clients Controller :
# Jul 17th, 07:18 maymeow After i run i18n extract on plugin i have problem with `The "_cake_core_" cache configuration does not exists.` what now?
# Jul 17th, 01:38 niel45 I'm gguessing that would depend on what you are using as the Authenticator. If you have used your own User class you would reset the password via that I'm guessing. I have not implemented it yet myself.
# Jul 17th, 01:06 geoff anybody here have experience with the new authentication plugin? i'm having a hard time finding any instructions on how to reset a user's password. i'm sure it's simple, and i'm missing something very easy and i'll feel _very_ dumb once somebody explains it to me... any tips?
# Jul 16th, 19:52 maymeow ill try
# Jul 16th, 19:45 challgren @maymeow for testing I would set at least 1 migration to be a break point and see if -t 0 does all of them or to the first break point
# Jul 16th, 19:44 maymeow yes i know but in this db is everything created only via Migrations
# Jul 16th, 19:43 niel45 rollback only works for table you have created via Migrations. Any thing existing before that isn't touched.
# Jul 16th, 19:41 maymeow ill try what said @ricksaccous... i think `bin/cake migrations rollback -t 0` will work for me
# Jul 16th, 19:41 maymeow yes @niel45... something like `php artisan migrate:refresh` in laravel. When i post changes to app they will go to CI and are deployed to review
# Jul 16th, 19:40 niel45 if so, there is a method from Phinx that will check for a table exiting. I've used it for exactly that
# Jul 16th, 19:38 niel45 @maymeow, are you asking how to drop tables if they exist, before creating them in a migration?
# Jul 16th, 19:37 challgren Couldn’t you write a shell to truncate the tables for you? and then run all the migrations?
# Jul 16th, 19:37 maymeow wrong writen ansver but yes i need run all migrations to create clean tables ...
# Jul 16th, 19:34 ricksaccous that would essentially delete all your db tables though
# Jul 16th, 19:34 ricksaccous then you could run them again, but that's only if everyone on your team properly made rollbacks
# Jul 16th, 19:33 ricksaccous like bin/cake migrations rollback -t 0
# Jul 16th, 19:33 ricksaccous i mean supposedly you'd be able to rollback everything
# Jul 16th, 19:33 ricksaccous are you having fk issues when you run migrations?
# Jul 16th, 19:32 ricksaccous @maymeow what do you mean?
# Jul 16th, 19:32 maymeow How can i run clean migrations? (without need to delete database tables manually)
# Jul 16th, 18:07 maxxstyle06 help him guys!
# Jul 16th, 18:07 maxxstyle06 I cannot help xD
# Jul 16th, 17:54 itmpls Why does scope not seem to work at all? Am I doing it wrong? I have a similar row with the same company_id but it doesn't throw any validation error. If I remove the scope array then it properly shows it.
# Jul 16th, 17:38 maxxstyle06 I can pay money aswell if someone wants
# Jul 16th, 17:37 maxxstyle06 Can someone come to teamviewer please?
# Jul 16th, 17:36 maxxstyle06 https://wi.cr/links/go
# Jul 16th, 17:35 maxxstyle06 Api link
# Jul 16th, 17:34 maxxstyle06 Here is api link
# Jul 16th, 17:34 maxxstyle06 wi.cr/links/go
# Jul 16th, 17:34 maxxstyle06 It’s wi.cr
# Jul 16th, 17:33 maxxstyle06 http://wikihosting.us/HKcr
# Jul 16th, 17:32 maxxstyle06 Here is my website
# Jul 16th, 17:31 maxxstyle06 I’m not using oauth2
# Jul 16th, 17:31 maxxstyle06 Devito no bro
# Jul 16th, 17:26 devito are you using any implementation of oauth2? Cause you can leverage the Client grant flow for this.
# Jul 16th, 17:24 devito ahh
# Jul 16th, 17:23 maxxstyle06 Yes
# Jul 16th, 17:23 itmpls so you control both domains?
# Jul 16th, 17:23 maxxstyle06 To my main domain which uses cakephp
# Jul 16th, 17:23 maxxstyle06 That is not using cakephp
# Jul 16th, 17:23 maxxstyle06 I’m trying to send external data from external url
# Jul 16th, 17:22 maxxstyle06 Sorry for late
# Jul 16th, 17:13 itmpls i think you might be overthinking it
# Jul 16th, 17:13 devito what exactly are you trying to secure max?
# Jul 16th, 17:13 itmpls that's how a lot of external calls are done though, on lots of sites you use.. through ajax. it's just an in-page http request
# Jul 16th, 17:12 maxxstyle06 Because ajax shows all datas in browser
# Jul 16th, 17:12 ricksaccous i'm actually probably not really qualified to help because my experience writing APIs is minimal and each time i made it very simplistic
# Jul 16th, 17:12 maxxstyle06 But I’m afraid that ajax will show it
# Jul 16th, 17:11 maxxstyle06 People suggested me jwt