{"id":21228470,"url":"https://github.com/scottybo/textlocal","last_synced_at":"2026-03-08T21:40:22.785Z","repository":{"id":62541364,"uuid":"103130101","full_name":"scottybo/textlocal","owner":"scottybo","description":"Laravel implementation of the TextLocal API","archived":false,"fork":false,"pushed_at":"2024-08-02T14:38:47.000Z","size":32,"stargazers_count":4,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-19T03:38:23.363Z","etag":null,"topics":["laravel","laravel-application","laravel-package","laravel5-package","textlocal"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scottybo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-11T11:56:34.000Z","updated_at":"2024-09-16T17:37:16.000Z","dependencies_parsed_at":"2022-11-02T16:16:06.585Z","dependency_job_id":null,"html_url":"https://github.com/scottybo/textlocal","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottybo%2Ftextlocal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottybo%2Ftextlocal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottybo%2Ftextlocal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottybo%2Ftextlocal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scottybo","download_url":"https://codeload.github.com/scottybo/textlocal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225643634,"owners_count":17501409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","laravel-application","laravel-package","laravel5-package","textlocal"],"created_at":"2024-11-20T23:19:11.113Z","updated_at":"2026-03-08T21:40:17.740Z","avatar_url":"https://github.com/scottybo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Text Local API\n### Introduction\nThis package allows you to use the TextLocal API in your Laravel 5.5+ app. The core class is a modified version of the demo class provided by TextLocal on: http://api.txtlocal.com/docs/phpclass and uses Guzzle to connect to the API and also provides some additional features not available in the demo class.\n\n### Installation\n**Step 1.** Install the package in one of two ways:\n\n**EITHER** via composer:\n```shell\ncomposer require scottybo/textlocal\n```\n**OR** by adding the following to your composer.json file and running \"composer update\"\n```php\n\"require\": {\n    ...\n    \"scottybo/textlocal\": \"1.3.*\"\n}\n```\n**Step 2.** Add the \"TextLocal\" facade in your config/app.php file\n```php\n'aliases' =\u003e [\n    ...\n    'TextLocal' =\u003e Illuminate\\Support\\Facades\\TextLocal::class,\n];\n```\n**Step 3.** You'll now need to publish the configuration file using the command below. A file will be created: config/textlocal.php\n```shell\nphp artisan vendor:publish --provider=\"App\\TextLocalApi\\TextLocalServiceProvider\" --tag=\"config\"\n```\n**Step 4.** Add your TextLocal credentials to your .env file\n\n**Important** Either specify a Key OR a Hash - don't enter both!\n```\nTEXTLOCAL_KEY=\nTEXTLOCAL_USERNAME=\nTEXTLOCAL_HASH=\n```\n\n### Example usage\n**Important:** View the API docs to see which commands you can use: \n\nIn this example we are going to create a command the grab received messages and displays them in the console, using the command\n**php artisan textlocal:get-received-messages**\n```php\n\u003c?php\nnamespace App\\Console\\Commands;\nuse Illuminate\\Console\\Command;\nuse TextLocal;\n\nclass GetReceivedMessages extends Command\n{\n    /**\n     * The name and signature of the console command.\n     *\n     * @var string\n     */\n    protected $signature = 'textlocal:get-received-messages';\n    /**\n     * The console command description.\n     *\n     * @var string\n     */\n    protected $description = 'Find and store and messages received into Text Local';\n    /**\n     * Create a new command instance.\n     *\n     * @return void\n     */\n    public function __construct()\n    {\n        parent::__construct();\n    }\n    /**\n     * Execute the console command.\n     *\n     * @return mixed\n     */\n    public function handle()\n    {\n        // Load our inboxes\n        $inboxes = TextLocal::getInboxes();\n        \n        $start = 0;\n        $limit = 1000;\n        $min_time = strtotime('-1 day');\n        $max_time = time(); // now\n        \n        // Loop through the inboxes\n        foreach($inboxes-\u003einboxes as $inbox) {\n            \n            // Load the messages for the current inbox (which we will call a folder)\n            $folder = TextLocal::getMessages($inbox-\u003eid, $start, $limit, $min_time,$max_time);\n            \n            // If there are messages in the folder...\n            if(sizeof($folder-\u003emessages) \u003e 0) {\n                foreach($folder-\u003emessages as $message) {\n                    dump($message-\u003emessage);\n                }\n            }\n        }\n    }\n}\n```\n\n### Available commands\n\n * getLastRequest ()\n* sendSms ($numbers, $message, $sender, $sched=null, $test=false, $receiptURL=null, $custom=null, $optouts=false, $simpleReplyService=false)\n* sendSmsGroup ($groupId, $message, $sender=null, $sched=null, $test=false, $receiptURL=null, $custom=null, $optouts=false, $simpleReplyService=false)\n* sendMms ($numbers, $fileSource, $message, $sched=null, $test=false, $optouts=false)\n* sendMmsGroup ($groupId, $fileSource, $message, $sched=null, $test=false, $optouts=false)\n* getUsers ()\n* transferCredits ($user, $credits)\n* getTemplates ()\n* checkKeyword ($keyword)\n* createGroup ($name)\n* getContacts ($groupId, $limit, $startPos=0)\n* createContacts ($numbers, $groupid= '5')\n* createContactsBulk ($contacts, $groupid= '5')\n* getGroups ()\n* getMessageStatus ($messageid)\n* getBatchStatus ($batchid)\n* getSenderNames ()\n* getInboxes ()\n* getBalance ()\n* getMessages ($inbox, $start, $limit, $min_time, $max_time)\n* cancelScheduledMessage ($id)\n* getScheduledMessages ()\n* deleteContact ($number, $groupid=5)\n* deleteGroup ($groupid)\n* getSingleMessageHistory ($start, $limit, $min_time, $max_time)\n* getAPIMessageHistory ($start, $limit, $min_time, $max_time)\n* getEmailToSMSHistory ($start, $limit, $min_time, $max_time)\n* getGroupMessageHistory ($start, $limit, $min_time, $max_time)\n* getSurveys ()\n* getSurveyDetails ()\n* getSurveyResults ($surveyid, $start, $end)\n* getOptouts ($time=null)\n\n\n### Development\n\nWant to contribute? Great - push away!\n\n### Todos\n\n - Tests not properly implemented\n \n### Licensed under MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottybo%2Ftextlocal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottybo%2Ftextlocal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottybo%2Ftextlocal/lists"}