Skip to content

Commit

Permalink
Merge pull request #16 from soheilkhaledabdi/soheil
Browse files Browse the repository at this point in the history
  • Loading branch information
BaseMax authored Sep 26, 2024
2 parents be3266f + 86b5139 commit 4b049b9
Show file tree
Hide file tree
Showing 15 changed files with 155 additions and 110 deletions.
104 changes: 38 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,38 @@
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>

<p align="center">
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
</p>

## About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).

Laravel is accessible, powerful, and provides tools required for large, robust applications.

## Learning Laravel

Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.

If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

## Laravel Sponsors

We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).

### Premium Partners

- **[Vehikl](https://vehikl.com/)**
- **[Tighten Co.](https://tighten.co)**
- **[WebReinvent](https://webreinvent.com/)**
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
- **[64 Robots](https://64robots.com)**
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
- **[Cyber-Duck](https://cyber-duck.co.uk)**
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
- **[Jump24](https://jump24.co.uk)**
- **[Redberry](https://redberry.international/laravel/)**
- **[Active Logic](https://activelogic.com)**
- **[byte5](https://byte5.de)**
- **[OP.GG](https://op.gg)**

## Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).

## Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).

## Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [[email protected]](mailto:[email protected]). All security vulnerabilities will be promptly addressed.

## License

The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
# SALAM AUTH

## Overview
SALAM AUTH is a robust authentication system designed to provide secure and efficient user authentication for web applications. It supports various authentication methods including password-based, OAuth, and multi-factor authentication.

## Features
- **Password-based Authentication**: Secure user login with hashed passwords.
- **OAuth Support**: Integration with popular OAuth providers like Google, Facebook, and GitHub.
- **Multi-factor Authentication**: Enhanced security with two-factor authentication.
- **User Management**: Admin interface for managing users and roles.
- **Session Management**: Secure session handling with token-based authentication.

## Installation
To install SALAM AUTH, follow these steps:

1. Clone the repository:
```sh
git clone https://github.com/soheilkhaledabdi/salam-auth.git
cd salam-auth
```

2. Install dependencies:
```sh
npm install
```

3. Set up environment variables:
Create a `.env` file in the root directory and add the necessary

4. Run database migrations:
```sh
npm run migrate
```

5. Start the application:
```sh
npm start
```
33 changes: 33 additions & 0 deletions app/Http/Controllers/api/v1/MobileController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace App\Http\Controllers\api\v1;

use App\Http\Controllers\Controller;
use App\Models\Mobile;
use Illuminate\Http\Request;

class MobileController extends Controller
{
public function saveMobile(Request $request)
{
$request->validate([
'mobile' => 'required',
]);

if (Mobile::where('mobile', $request->mobile)->first()) {
return response()->json([
'message' => 'شماره موبایل وارد شده قبلا ثبت شده است.',
'data' => [],
]);
}

Mobile::create([
'mobile' => $request->mobile,
]);

return response()->json([
'message' => 'شماره موبایل شما سیو شد منتظر خبر های جدید باشید.',
'data' => [],
]);
}
}
15 changes: 15 additions & 0 deletions app/Models/Mobile.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Mobile extends Model
{
use HasFactory;

protected $fillable = [
'mobile',
];
}
28 changes: 28 additions & 0 deletions database/migrations/2024_09_26_124950_create_mobiles_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('mobiles', function (Blueprint $table) {
$table->id();
$table->string('mobile')->unique();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('mobiles');
}
};
2 changes: 1 addition & 1 deletion public/assets/js/dataTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -10752,7 +10752,7 @@
* parameter - if it is not given, the value of `zeroRecords` will be used
* instead (either the default or given value).
*/
"sEmptyTable": "No data available in table",
"sEmptyTable": "داده‌ای در جدول موجود نیست.",


/**
Expand Down
10 changes: 5 additions & 5 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
@csrf
<!-- Email Address -->
<div>
<x-input-label for="email" :value="__('Email')"/>
<x-input-label for="email" :value="__('ایمیل')"/>
<x-text-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required
autofocus autocomplete="username"/>
<x-input-error :messages="$errors->get('email')" class="mt-2"/>
</div>

<!-- Password -->
<div class="mt-4">
<x-input-label for="password" :value="__('Password')"/>
<x-input-label for="password" :value="__('رمز عبور')"/>

<x-text-input id="password" class="block mt-1 w-full"
type="password"
Expand All @@ -34,13 +34,13 @@
<input id="remember_me" type="checkbox"
class="rounded dark:bg-gray-900 border-gray-300 dark:border-gray-700 text-indigo-600 shadow-sm focus:ring-indigo-500 dark:focus:ring-indigo-600 dark:focus:ring-offset-gray-800"
name="remember">
<span class="text-gray-600 cursor-pointer font-bold mr-2">{{ __('Remember me') }}</span>
<span class="text-gray-600 cursor-pointer font-bold mr-2">{{ __('به خاطر سپردن') }}</span>
</label>
</div>

@if (Route::has('password.request'))
<a class="text-[#276EF6] font-bold block" href="{{ route('password.request') }}">
{{ __('Forgot your password?') }}
{{ __('فراموشی رمز؟') }}
</a>
@endif

Expand All @@ -49,7 +49,7 @@ class="rounded dark:bg-gray-900 border-gray-300 dark:border-gray-700 text-indigo
</a>

<x-button-auth>
{{ __('Log in') }}
{{ __('ورود') }}
</x-button-auth>
</form>
</x-guest-layout>
10 changes: 5 additions & 5 deletions resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@

<!-- Name -->
<div>
<x-input-label for="name" :value="__('Name')"/>
<x-input-label for="name" :value="__('نام')"/>
<x-text-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required
autofocus autocomplete="name"/>
<x-input-error :messages="$errors->get('name')" class="mt-2"/>
</div>

<!-- Email Address -->
<div class="mt-4">
<x-input-label for="email" :value="__('Email')"/>
<x-input-label for="email" :value="__('ایمیل')"/>
<x-text-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required
autocomplete="username"/>
<x-input-error :messages="$errors->get('email')" class="mt-2"/>
</div>

<!-- Password -->
<div class="mt-4">
<x-input-label for="password" :value="__('Password')"/>
<x-input-label for="password" :value="__('رمز')"/>

<x-text-input id="password" class="block mt-1 w-full"
type="password"
Expand All @@ -36,7 +36,7 @@

<!-- Confirm Password -->
<div class="mt-4">
<x-input-label for="password_confirmation" :value="__('Confirm Password')"/>
<x-input-label for="password_confirmation" :value="__('تکرار رمز')"/>

<x-text-input id="password_confirmation" class="block mt-1 w-full"
type="password"
Expand All @@ -50,7 +50,7 @@
</a>

<x-button-auth>
{{ __('Register') }}
{{ __('ثبت نام') }}
</x-button-auth>
</form>
</x-guest-layout>
8 changes: 4 additions & 4 deletions resources/views/auth/verify-email.blade.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<x-guest-layout>
<div class="mb-4 text-gray-600 dark:text-gray-400 text-[15px] text-center">
{{ __('Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn\'t receive the email, we will gladly send you another.') }}
{{ __('ممنون که ثبت‌نام کردید! قبل از شروع، لطفاً ایمیل خود را با کلیک بر روی لینکی که برای شما ارسال کرده‌ایم تأیید کنید. اگر ایمیل را دریافت نکردید، با کمال میل ایمیل دیگری برای شما ارسال خواهیم کرد.') }}
</div>

@if(session('status'))
@if (session('status') == 'verification-link-sent')
<div class="mb-4 font-medium text-[15px] text-center text-green-600 dark:text-green-400">
{{ __('A new verification link has been sent to the email address you provided during registration.') }}
{{ __('یک لینک تأیید جدید به آدرس ایمیلی که هنگام ثبت‌نام ارائه داده‌اید ارسال شد.') }}
</div>
@else
<div class="mb-4 font-medium text-[15px] text-center text-red-600 dark:text-red-400">
Expand All @@ -19,7 +19,7 @@

<div>
<x-button-auth>
{{ __('Resend Verification Email') }}
{{ __('ارسال مجدد') }}
</x-button-auth>
</div>
</form>
Expand All @@ -29,7 +29,7 @@

<button type="submit"
class="mt-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800">
{{ __('Log Out') }}
{{ __('خروج') }}
</button>
</form>
</x-guest-layout>
2 changes: 1 addition & 1 deletion resources/views/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ __('Dashboard') }}</div>
<div class="card-header">{{ __('داشبورد') }}</div>

<div class="card-body">
@if (session('status'))
Expand Down
14 changes: 7 additions & 7 deletions resources/views/layouts/navigation.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@if($status === "true")
<div class="hidden gap-2 sm:-my-px sm:ms-10 sm:flex">
<x-nav-link :href="route('admin.dashboard')" :active="request()->routeIs('admin.dashboard')">
{{ __('Dashboard') }}
{{ __('داشبورد') }}
</x-nav-link>
</div>
<div class="hidden space-x-16 gap-2 sm:-my-px ms-2 sm:flex">
Expand All @@ -26,7 +26,7 @@
@else
<div class="hidden space-x-16 gap-2 sm:-my-px sm:ms-10 sm:flex">
<x-nav-link :href="route('user.dashboard')" :active="request()->routeIs('user.dashboard')">
{{ __('Dashboard') }}
{{ __('داشبورد') }}
</x-nav-link>
<x-nav-link :href="route('user.codes.index')" :active="request()->routeIs('user.codes.index')">
{{ __('کد ها') }}
Expand All @@ -52,7 +52,7 @@

<x-slot name="content">
<x-dropdown-link :href="route('profile.edit')">
{{ __('Profile') }}
{{ __('پروفایل') }}
</x-dropdown-link>

<x-dropdown-link :href="route('editor')">
Expand All @@ -76,7 +76,7 @@
<x-dropdown-link :href="route('logout')"
onclick="event.preventDefault();
this.closest('form').submit();">
{{ __('Log Out') }}
{{ __('خروج') }}
</x-dropdown-link>
</form>
</x-slot>
Expand All @@ -99,7 +99,7 @@
<div :class="{'block': open, 'hidden': ! open}" class="hidden sm:hidden">
<div class="pt-2 pb-3 space-y-1">
<x-responsive-nav-link :href="route('user.dashboard')" :active="request()->routeIs('user.dashboard')">
{{ __('Dashboard') }}
{{ __('داشبورد') }}
</x-responsive-nav-link>
</div>

Expand All @@ -112,7 +112,7 @@

<div class="mt-3 space-y-1">
<x-responsive-nav-link :href="route('profile.edit')">
{{ __('Profile') }}
{{ __('پروفایل') }}
</x-responsive-nav-link>

@if(auth()->user()->is_admin())
Expand All @@ -128,7 +128,7 @@
<x-responsive-nav-link :href="route('logout')"
onclick="event.preventDefault();
this.closest('form').submit();">
{{ __('Log Out') }}
{{ __('پروفایل') }}
</x-responsive-nav-link>
</form>
</div>
Expand Down
Loading

0 comments on commit 4b049b9

Please sign in to comment.