Skip to content

Commit 0ffe144

Browse files
committed
Initial commit
0 parents  commit 0ffe144

15 files changed

+10175
-0
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_size = 4
9+
indent_style = space
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

.gitattributes

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore all test and documentation with "export-ignore".
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/.travis.yml export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/.scrutinizer.yml export-ignore
10+
/tests export-ignore
11+
/.editorconfig export-ignore
12+
/.styleci.yml export-ignore

.github/workflows/php.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: phpunit
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Validate composer.json and composer.lock
14+
run: composer validate
15+
16+
- name: Install dependencies
17+
run: composer install --prefer-dist --no-progress --no-suggest
18+
19+
- name: Run test suite
20+
run: composer run-script test

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.phpunit.result.cache
2+
.idea
3+
vendor
4+
composer.lock

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) codelayer GmbH <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Verify the enrollment status of college and university students
2+
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/codelayer/laravel-student-validator.svg?style=flat-square)](https://packagist.org/packages/codelayer/laravel-student-validator) ![phpunit](https://github.com/codelayerhq/laravel-student-validator/workflows/phpunit/badge.svg?branch=master)
4+
5+
This package can be used to validate college and university student's email addresses.
6+
7+
You can install the package using composer:
8+
9+
```bash
10+
composer require codelayer/laravel-student-validator
11+
```
12+
13+
### Translations
14+
15+
If you wish to customize the package's translation, you can publish the translation files:
16+
17+
```bash
18+
php artisan vendor:publish --provider="Codelayer\StudentValidator\StudentValidatorServiceProvider"
19+
```
20+
21+
## Usage
22+
23+
Simply use the `StudentEmail` rule inside your rules array, e.g. in a form request:
24+
25+
```php
26+
use Codelayer\StudentValidator\Rules\StudentEmail;
27+
28+
public function rules()
29+
{
30+
return [
31+
'email' => ['required', 'email', new StudentEmail()],
32+
];
33+
}
34+
```
35+
36+
## About Us
37+
38+
[codelayer](https://codelayer.de) is a web development agency based in Karlsruhe, Germany. This package was developed for use in our product [likvi](https://likvi.de).
39+
40+
## License
41+
42+
The MIT License (MIT).

composer.json

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "codelayer/laravel-student-validator",
3+
"description": "Validate educational email addresses for student status verification.",
4+
"keywords": [
5+
"laravel",
6+
"student",
7+
"education",
8+
"edu",
9+
"validation"
10+
],
11+
"license": "MIT",
12+
"authors": [
13+
{
14+
"name": "Tobias Dierich",
15+
"email": "[email protected]",
16+
"homepage": "https://codelayer.de",
17+
"role": "Developer"
18+
}
19+
],
20+
"minimum-stability": "stable",
21+
"prefer-stable": true,
22+
"require": {
23+
"php": "^7.2",
24+
"ext-json": "*",
25+
"illuminate/support": "^5.8|^6.0|^7.0",
26+
"egulias/email-validator": "^2.1",
27+
"jeremykendall/php-domain-parser": "^5.6"
28+
},
29+
"require-dev": {
30+
"phpunit/phpunit": "~8.0"
31+
},
32+
"autoload": {
33+
"psr-4": {
34+
"Codelayer\\StudentValidator\\": "src"
35+
}
36+
},
37+
"autoload-dev": {
38+
"psr-4": {
39+
"Codelayer\\StudentValidator\\Test\\": "tests"
40+
}
41+
},
42+
"extra": {
43+
"laravel": {
44+
"providers": [
45+
"Codelayer\\StudentValidator\\StudentValidatorServiceProvider"
46+
]
47+
}
48+
},
49+
"scripts": {
50+
"test": "phpunit"
51+
}
52+
}

phpunit.xml.dist

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="Permissions Test Suite">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<directory suffix=".php">src/</directory>
20+
</whitelist>
21+
</filter>
22+
<php>
23+
<env name="CACHE_DRIVER" value="array"/>
24+
</php>
25+
</phpunit>

resources/lang/de/messages.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
return [
4+
'student_email' => 'Die E-Mail-Adresse ist keine gültige Hochschul-Adresse.',
5+
];

resources/lang/en/messages.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
return [
4+
'student_email' => 'The email address is not a valid university address.',
5+
];

0 commit comments

Comments
 (0)