Skip to content

Commit

Permalink
Merge pull request #1 from amiralibarasoud/main
Browse files Browse the repository at this point in the history
init
  • Loading branch information
amiralibarasoud authored Oct 14, 2024
2 parents 0e28b6c + badd8a2 commit d805bd6
Show file tree
Hide file tree
Showing 7 changed files with 657 additions and 1 deletion.
149 changes: 149 additions & 0 deletions .gitignore.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# Created by https://www.toptal.com/developers/gitignore/api/phpstorm,laravel,composer
# Edit at https://www.toptal.com/developers/gitignore?templates=phpstorm,laravel,composer

### Composer ###
composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock

### Laravel ###
node_modules/
npm-debug.log
yarn-error.log

# Laravel 4 specific
bootstrap/compiled.php
app/storage/

# Laravel 5 & Lumen specific
public/storage
public/hot

# Laravel 5 & Lumen specific with changed public path
public_html/storage
public_html/hot

storage/*.key
.env
Homestead.yaml
Homestead.json
/.vagrant
.phpunit.result.cache
### PhpStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### PhpStorm Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/

# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml

# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/

# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$

# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml

# Azure Toolkit for IntelliJ plugin
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
.idea/**/azureSettings.xml

# End of https://www.toptal.com/developers/gitignore/api/phpstorm,laravel,composer
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# smsir-php
# SMS Package for Sms.ir

This is a Laravel package for sending SMS using a custom API.

## Installation

Run the following command to install the package:

## Usage

You can use this package to send SMS messages:
27 changes: 27 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "ipe/smsir-php",
"description": "A package for sending SMS.",
"type": "library",
"require": {
"php": "^7.3|^8.0",
"guzzlehttp/guzzle": "^7.0"
},
"autoload": {
"psr-4": {
"MyVendor\\SmsPackage\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"MyVendor\\SmsPackage\\SmsServiceProvider"
],
"aliases": {
"Sms": "MyVendor\\SmsPackage\\Facades\\Sms"
}
}
},
"license": "MIT",
"minimum-stability": "stable",
"prefer-stable": true
}
23 changes: 23 additions & 0 deletions src/Exceptions/SmsException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace MyVendor\SmsPackage\Exceptions;

use Exception;

class SmsException extends Exception
{
protected $statusCode;

// Constructor accepts a message and status code
public function __construct($message = "An unexpected error occurred", $statusCode = null)
{
$this->statusCode = $statusCode; // Set the status code
parent::__construct($message); // Call the parent constructor
}

// Getter for the status code
public function getStatusCode()
{
return $this->statusCode;
}
}
14 changes: 14 additions & 0 deletions src/Facades/Sms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php


namespace MyVendor\SmsPackage\Facades;

use Illuminate\Support\Facades\Facade;

class Sms extends Facade
{
protected static function getFacadeAccessor()
{
return 'MyVendor\SmsPackage\SmsService';
}
}
Loading

0 comments on commit d805bd6

Please sign in to comment.