Skip to content

Commit

Permalink
Merge pull request #35 from ahmetarsiv/dev
Browse files Browse the repository at this point in the history
dev master sync
  • Loading branch information
ahmetarsiv committed Jun 12, 2024
2 parents 31bbf0d + 3367a7d commit 415a90a
Show file tree
Hide file tree
Showing 197 changed files with 5,445 additions and 11,572 deletions.
162 changes: 48 additions & 114 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,152 +1,86 @@
<p align="center">
<a href="https://codenteq.com"><img width="200" src="https://codenteq.com/wp-content/uploads/2022/12/laerx-default.webp" alt="Codenteq Laerx"></a>
</p>
<p align="center">
<a href="https://packagist.org/packages/codenteq/laerx"><img src="https://poser.pugx.org/codenteq/laerx/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/codenteq/laerx"><img src="https://poser.pugx.org/codenteq/laerx/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://github.com/codenteq/laerx/blob/master/LICENSE"><img src="https://poser.pugx.org/codenteq/laerx/license.svg" alt="License"></a>
<a href="#backers"><img src="https://opencollective.com/codenteq/backers/badge.svg" alt="Backers on Open Collective"></a>
<a href="https://github.com/codenteq/laerx/actions"><img src="https://github.com/bagisto/bagisto/workflows/CI/badge.svg" alt="Actions on Github"></a>
<a href="#contributors"><img src="https://opencollective.com/codenteq/contributors/badge.svg" alt="Contributors on Open Collective"></a>
<a href="#sponsors"><img src="https://opencollective.com/codenteq/sponsors/badge.svg" alt="Sponsors on Open Collective"></a>
</p>
<p align="center"><img src="https://codenteq.com/wp-content/uploads/2022/12/laerx-default.webp" width="250" alt="Laerx Course Management Logo" /></p>

<p align="center">
<a href="https://twitter.com/intent/follow?screen_name=codenteq"><img src="https://img.shields.io/twitter/follow/codenteq?style=social"></a>
</p>
<h1 align="center">Laerx Course Management</h1>

<p align="center">
➡️ <a href="https://www.codenteq.com/">Website</a> | <a href="https://twitter.com/i/communities/1588983448135417859">Community</a> ⬅️
</p>

<p align="center" style="display: inline;">
<img class="flag-img" src="https://flagicons.lipis.dev/flags/4x3/tr.svg" alt="Turkish" width="24" height="24">
<a href="https://packagist.org/packages/codenteq/laerx"><img src="https://poser.pugx.org/codenteq/laerx/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://github.com/codenteq/laerx/blob/master/LICENSE"><img src="https://poser.pugx.org/codenteq/laerx/license.svg" alt="License"></a>
<a href="https://packagist.org/packages/codenteq/laerx"><img src="https://poser.pugx.org/codenteq/laerx/d/total.svg" alt="Total Downloads"></a>
</p>

# Laerx
Laerx is a course management system provided by [Codenteq](https://github.com/codenteq) to create a consistent driver license for app users.

Get detailed information about your clients, exams and courses to create an effective report and track your progress. You can also use audio lessons, online quizzes, and the tool/teacher appointment system.

## Getting Started

# Topics

1. [Visit our live](#visit-our-live-demo)
2. [Features](#features)
3. [Installation](#installation)
4. [Contributions](#contributions)
5. [Sponsor](#sponsor)
6. [Licence](#licence)

## Visit our live [Demo](https://dev-laerx.codenteq.com)

## Features

- Admin Module
- Question Module
- Audio Lesson Module
- Company Module
- Payment Module
- Setting Module
- Multi Language
- Licence Group
- Periods
- Car Types
- Payment Module
- Discount Coupon
- Payment Plans
- Payment Packages
- Invoices Module
- Manager Module
- Student Module
- Report Module
- Excel Student İmport Module
- Question Module
- Live Lesson Module
- Group Exam Module
- Notification Module
- Booking Module
- Support Module
- Payment Module
- Invoices Module
- Iyzico Payment Services
- Bank Transfer Services
- Teacher Module
- My Booking Module
- Students Module
- My Lesson Module
- Live Lesson Module
- Online Exam Module
- Default Exam
- Custom Exam
- My Exam Results
- Group Exam Module
- My Booking Module
- Notification Module
- Support Module


## Installation

> If you are using Docker run the following command
First, install the package:

```bash
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/var/www/html \
-w /var/www/html \
laravelsail/php81-composer:latest \
composer install --ignore-platform-reqs
composer create-project codenteq/laerx
```

> Or
### Docker Installation

Run the following command
```bash
composer install
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/var/www/html \
-w /var/www/html \
laravelsail/php81-composer:latest \
composer install --ignore-platform-reqs
```

> Run the following command for the file system and If you are using Docker
```bash
./vendor/sail/bin artisan storage link
./vendor/sail/bin artisan storage link
```

> Or
Configure the database connection is going to be using in `.env`

```bash
php artisan storage link
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laerx
DB_USERNAME=sail
DB_PASSWORD=password
```

> Configure the database connection is going to be using in .env
```bash
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=drivecourseapp
DB_USERNAME=root
DB_PASSWORD=
./vendor/bin/sail artisan migrate --seed
```

> If you are using Docker and run this:
### Composer Installation

Run the following command

```bash
./vendor/bin/sail artisan migrate --seed
composer install
```

> Or
```bash
php artisan migrate --seed
php artisan storage:link
```

## Contributions

<a href="https://github.com/codenteq/laerx/graphs/contributors"><img src="https://opencollective.com/codenteq/contributors.svg?width=890&button=false"/></a>
Configure the database connection is going to be using in `.env`

```bash
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laerx
DB_USERNAME=root
DB_PASSWORD=
```

## Sponsor
```bash
php artisan migrate --seed
```

[Sponsor this project](https://opencollective.com/codenteq).
## How to contribute
Laerx Course Management is always open for direct contributions. Contributions can be in the form of design suggestions, documentation improvements, new component suggestions, code improvements, adding new features or fixing problems. For more information please check our [Contribution Guideline document.](https://github.com/codenteq/laerx/blob/master/CONTRIBUTING.md)

## Licence
## Useful Links

[MIT Licence](https://github.com/codenteq/laerx/blob/master/LICENSE)
* [Open Laerx](https://laerx.codenteq.com/)
1 change: 0 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class Kernel extends ConsoleKernel
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
Expand Down
2 changes: 1 addition & 1 deletion app/Excel/Exports/UsersExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class UsersExport implements FromView
public function view(): View
{
return view('exports.users', [
'users' => User::where('type', User::Normal)->with('info')->whereRelation('info','companyId',companyId())->get()
'users' => User::where('type', User::Normal)->with('info')->whereRelation('info', 'companyId', companyId())->get(),
]);
}
}
15 changes: 3 additions & 12 deletions app/Excel/Imports/UserImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,13 @@
class UserImport implements ToModel, WithHeadingRow
{
/**
* @param array $row
*
* @return User|null
*/
public function model(array $row)
{
return self::userStore($row);
}

/**
* @param $row
*/
public function userStore($row): void
{
DB::transaction(function () use ($row) {
Expand All @@ -43,15 +38,11 @@ public function userStore($row): void
});
}

/**
* @param $row
* @param $id
*/
public function userInfoStore($row, $id): void
{
$period = Period::where('title',$row['donem'])->first();
$month = Month::where('title',$row['ay'])->first();
$group = Group::where('title',$row['sinif'])->first();
$period = Period::where('title', $row['donem'])->first();
$month = Month::where('title', $row['ay'])->first();
$group = Group::where('title', $row['sinif'])->first();

$info = new UserInfo();
$info->status = 1;
Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function register()
'file' => $e->getFile(),
'line' => $e->getLine(),
'code' => $e->getCode(),
]
],
])->concat(collect($e->getTrace())->take(5))->toArray();
Log::channel('slack')->error($e->getMessage(), $errorLog);
});
Expand Down
32 changes: 18 additions & 14 deletions app/Helpers/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
use App\Models\AppointmentSetting;
use App\Models\Company;
use App\Models\Invoice;
use App\Models\QuestionChoiceKey;
use App\Models\TestQuestion;
use App\Models\UserAnswer;
use Carbon\Carbon;
use Carbon\CarbonInterval;
use Carbon\CarbonPeriod;
use Illuminate\Support\Str;

function ignoreDateCheck($date): bool
{
return (bool)AppointmentSetting::where('ignore_date', $date)->where('companyId', companyId())->first();
return (bool) AppointmentSetting::where('ignore_date', $date)->where('companyId', companyId())->first();
}

function companyId(): int
Expand All @@ -30,39 +27,43 @@ function currentMounth(): array
{
$result = CarbonPeriod::create(Carbon::now()->format('d-m-Y'), '1 day', Carbon::now()->addMonth()->format('d-m-Y'));
foreach ($result as $dt) {
$months[] = [$dt->format("Y-m-d") => ignoreDateCheck($dt->format("Y-m-d"))];
$months[] = [$dt->format('Y-m-d') => ignoreDateCheck($dt->format('Y-m-d'))];
}

return $months;
}

function invoiceDiffDate($id): int
{
$invoice = Invoice::select('end_date')->where('companyId', $id)->orderBy('id', 'desc')->first();
$end = Carbon::parse($invoice->end_date);

return $end->diffInDays(Carbon::now());
}

function invoiceStatus($id): bool
{
$invoice = Invoice::select('status')->where('companyId', $id)->orderBy('id', 'desc')->first();

return $invoice->status == 0;
}

function companyLogo(): string
{
return '/storage/' . auth()->user()->info->companyInfo->logo;
return '/storage/'.auth()->user()->info->companyInfo->logo;
}

function imagePath($path): string
{
return '/storage/' . $path;
return '/storage/'.$path;
}

function totalPoint($correct, $length): int
{
if ($correct && $length) {
return 100 / $length * $correct;
}

return 0;
}

Expand All @@ -71,14 +72,16 @@ function resultStatus($point): string
if ($point) {
return $point >= 70 ? 'Başarılı' : 'Başarısız';
}

return 0;
}

function examTime($questionLength): string
{
if ($questionLength == 50) {
return 45 . ' dakika';
return 45 .' dakika';
}

return CarbonInterval::seconds($questionLength * 60)->cascade()->forHumans();
}

Expand All @@ -87,6 +90,7 @@ function getSubdomainLogo()
$url = \request()->getHttpHost();
$subdomain = explode('.', $url)[0];
$companyLogo = Company::where('subdomain', $subdomain)->with('info')->first();

return $companyLogo->info->logo ?? null;
}

Expand All @@ -95,16 +99,17 @@ function getSubdomainCompanyName()
$url = \request()->getHttpHost();
$subdomain = explode('.', $url)[0];
$company = Company::where('subdomain', $subdomain)->first();

return $company->title ?? null;
}

function htmlTagFragmentation($request): array
{
$data = strip_tags($request->content, '<td>');
$domdoc = new \DOMDocument();
$domdoc->loadHTML('<?xml encoding="utf-8" ?>'. $data);
$domdoc->loadHTML('<?xml encoding="utf-8" ?>'.$data);
$users = $domdoc->getElementsByTagName('td');
$arr = array();
$arr = [];
foreach ($users as $user) {
array_push($arr, $user->nodeValue);
}
Expand All @@ -114,16 +119,15 @@ function htmlTagFragmentation($request): array
foreach ($arr as $user) {
if ($index == 2) {
$userArr[$arrIndex]['tc'] = $user;
}
else if ($index == 3) {
} elseif ($index == 3) {
$surname = Str::afterLast($user, ' ');
$name = Str::replaceLast($surname, '', $user);
$userArr[$arrIndex]['name'] = $name;
$userArr[$arrIndex]['surname'] = $surname;
$arrIndex++;
}
else if ($index == 16)
} elseif ($index == 16) {
$index = 0;
}
$index++;
}

Expand Down
Loading

0 comments on commit 415a90a

Please sign in to comment.