phpsharepoint-2013laravel-7

Upload csv file to SharePoint using PHP Laravel


I am referring the steps mentioned here phpSPO to include the library first in my php application using command composer require vgrem/php-spo. But when using below code to create a client, is not working for me. I am receiving all the client attributes as null.

  use Office365\Runtime\Auth\ClientCredential;
  use Office365\SharePoint\ClientContext;

  $credentials = new ClientCredential("{clientId}", "{clientSecret}");
  $ctx = (new ClientContext("{siteUrl}"))->withCredentials($credentials);

If anyone faced the same issue and got it fixed then please guide me as well. Thanks.


Solution

  • Followed this post and I was able to resolve this issue. Thank you. https://stackoverflow.com/questions/67861925/php-using-phpspo-with-sharepoint-how-to-create-folder-in-a-subsite