-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bugs add image quality manager & watermark fix routing system upd…
…ate packages and use finder and filesystem project from symfony and more ...
- Loading branch information
1 parent
f4a12e2
commit 027ee87
Showing
30 changed files
with
465 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
TOKEN=geFromApp | ||
CRYPT_TOKEN=genFromApp | ||
TOKEN=generate_from_app_Security_class | ||
CRYPT_TOKEN=generate_from_app_Security_class | ||
|
||
# Database | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_NAME=app | ||
DB_NAME=ex | ||
DB_USERNAME=root | ||
DB_PASSWORD= | ||
|
||
MAIL_HOST=smtp.gmail.com | ||
MAIL_PORT=465 | ||
MAIL_USERNAME=test@gmail.com | ||
MAIL_PASSWORD=ex | ||
MAIL_USERNAME=ex@gmail.com | ||
MAIL_PASSWORD=ex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
function errorClass($name) | ||
{ | ||
return errorExists($name) ? "is-invalid" : null; | ||
} | ||
|
||
function errorText($name) | ||
{ | ||
return errorExists($name) ? "<div><small class=\"text-danger\">" . error($name) . "</small></div>" : null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Auth; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Http\Requests\Auth\LoginRequest; | ||
use App\Http\Services\Mail; | ||
use System\Auth\Auth; | ||
use System\Security\Security; | ||
|
||
class LoginController extends Controller | ||
{ | ||
public function login() | ||
{ | ||
$request = new LoginRequest(); | ||
Auth::loginUsingEmail($request->email, $request->password, "user not fount.", "Password incorrect"); | ||
$user = Auth::userUsingEmail($request->email); | ||
if ($user->permission == "root") | ||
return redirect(route("admin.index")); | ||
return redirect(route("home.index")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Auth; | ||
|
||
use App\Http\Controllers\Controller; | ||
use System\Auth\Auth; | ||
|
||
class LogoutController extends Controller | ||
{ | ||
public function logout() | ||
{ | ||
Auth::logout(); | ||
return back(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Auth; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Http\Requests\Auth\RegisterRequest; | ||
use App\Http\Services\ImageUpload; | ||
use App\Http\Services\Mail; | ||
use App\Models\User; | ||
use Ramsey\Uuid\Uuid; | ||
use System\Auth\Auth; | ||
use System\Security\Security; | ||
|
||
class RegisterController extends Controller | ||
{ | ||
public function register() | ||
{ | ||
$request = new RegisterRequest(); | ||
$inputs = $request->all(); | ||
$inputs["avatar"] = ImageUpload::uploadAndFit("avatar", "user_avatar", 151, 119); | ||
$inputs['permission'] = 'user'; | ||
Auth::storeUser($inputs, "password"); | ||
flash("user_activation_send", "Successfully registered."); | ||
return redirect(route("auth.login")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,38 @@ | ||
<!-- cerate --> | ||
<?php | ||
function errorClass($name) | ||
{ | ||
return errorExists($name) ? "is-invalid" : null; | ||
} | ||
|
||
function errorText($name) | ||
{ | ||
return errorExists($name) ? "<div><small class=\"text-danger\">" . error($name) . "</small></div>" : null; | ||
} | ||
|
||
function sidebarActive($routeName, $contain = false) | ||
{ | ||
return equalUrl(route($routeName), $contain) ? "active" : null; | ||
} | ||
|
||
function navActive($routeName) | ||
{ | ||
return equalUrl(route($routeName)) ? "active" : null; | ||
} | ||
|
||
function sidebarAngle($routeName, $contain = true) | ||
{ | ||
return equalUrl(route($routeName), $contain) ? "bi-chevron-down" : "bi-chevron-left"; | ||
} | ||
|
||
function sidebarLinkActive($routeName) | ||
{ | ||
return equalUrl(route($routeName)) ? "sidebar-link-active" : null; | ||
} | ||
|
||
function sidebarDropDownActive($routeNames, $contain = false) | ||
{ | ||
foreach ($routeNames as $routeName) | ||
if (equalUrl(route($routeName), $contain)) | ||
return "sidebar-group-link-active"; | ||
return null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace App\Http\Requests\Admin; | ||
|
||
use System\Request\Request; | ||
|
||
class PostRequest extends Request | ||
{ | ||
public function rules() | ||
{ | ||
if (methodField() == "put") // for update | ||
return [ | ||
"rules" => [ | ||
"title" => "required|max:210", | ||
"description" => "required|max:380", | ||
"body" => "required", | ||
"cat_id" => "required|exists:categories,id", | ||
"image" => "file|mimes:jpeg,jpg,png,gif", | ||
], | ||
]; | ||
|
||
return [ | ||
"rules" => [ | ||
"title" => "required|max:210", | ||
"description" => "required|max:380", | ||
"body" => "required", | ||
"cat_id" => "required|exists:categories,id", | ||
"image" => "required|file|mimes:jpeg,jpg,png,gif", | ||
], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace App\Http\Requests\Auth; | ||
|
||
use System\Request\Request; | ||
|
||
class LoginRequest extends Request | ||
{ | ||
public function rules() | ||
{ | ||
return [ | ||
"rules" => [ | ||
"email" => "required|email", | ||
"password" => "required", | ||
], | ||
"errors" => [ | ||
"email" => "required!some custom error|email!some custom error", | ||
] | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace App\Http\Requests\Auth; | ||
|
||
use System\Request\Request; | ||
|
||
class RegisterRequest extends Request | ||
{ | ||
public function rules() | ||
{ | ||
return [ | ||
"rules" => [ | ||
"name" => "required|max:210", | ||
"email" => "required|max:90|email|unique:users,email", | ||
"avatar" => "required|file|mimes:jpeg,jpg,png,gif|max:2048", | ||
"password" => "required|min:8|confirmed", | ||
"bio" => "required|max:380" | ||
], | ||
"errors" => [ | ||
"email" => "required!some custom error|email!some custom error", | ||
] | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use System\Database\ORM\Model; | ||
use System\Database\Traits\HasSoftDelete; | ||
|
||
class User extends Model{ | ||
use HasSoftDelete; | ||
protected $table = "users"; | ||
protected $fillable = ["name", "email", "password", "avatar", "permission", "bio"]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.