Skip to content

Commit c19a702

Browse files
committed
first commit
0 parents  commit c19a702

File tree

3,133 files changed

+5210811
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,133 files changed

+5210811
-0
lines changed

LICENSE

+674
Large diffs are not rendered by default.

app/Authors.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class Authors extends Model
8+
{
9+
protected $connection = 'hadith';
10+
11+
protected $table = 'authors';
12+
13+
14+
}

app/Books.php

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class Books extends Model
8+
{
9+
protected $connection = 'hadith';
10+
11+
protected $table = 'books';
12+
}

app/BooksAuthor.php

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
use Illuminate\Support\Facades\DB ;
7+
8+
class BooksAuthor extends Model
9+
{
10+
protected $connection = 'hadith';
11+
12+
protected $table = 'booksauthors';
13+
14+
public function books(){
15+
DB::connection('hadith')->select('select * from booksauthors
16+
JOIN books ON books.id = booksauthors.bookid
17+
JOIN authors ON authors.id = booksauthors.authorid');
18+
19+
}
20+
21+
22+
}

app/Category.php

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class Category extends Model
8+
{
9+
protected $connection = 'hadith';
10+
11+
protected $table = 'categories';
12+
}

app/Comments.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class Comments extends Model
8+
{
9+
protected $connection = 'feed';
10+
11+
protected $table = 'comments';
12+
13+
}

app/Console/Kernel.php

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
namespace App\Console;
4+
5+
use Illuminate\Console\Scheduling\Schedule;
6+
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
7+
8+
class Kernel extends ConsoleKernel
9+
{
10+
/**
11+
* The Artisan commands provided by your application.
12+
*
13+
* @var array
14+
*/
15+
protected $commands = [
16+
//
17+
];
18+
19+
/**
20+
* Define the application's command schedule.
21+
*
22+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
23+
* @return void
24+
*/
25+
protected function schedule(Schedule $schedule)
26+
{
27+
// $schedule->command('inspire')
28+
// ->hourly();
29+
}
30+
31+
/**
32+
* Register the Closure based commands for the application.
33+
*
34+
* @return void
35+
*/
36+
protected function commands()
37+
{
38+
require base_path('routes/console.php');
39+
}
40+
}

app/Exceptions/Handler.php

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
3+
namespace App\Exceptions;
4+
5+
use Exception;
6+
use Illuminate\Auth\AuthenticationException;
7+
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
8+
9+
class Handler extends ExceptionHandler
10+
{
11+
/**
12+
* A list of the exception types that should not be reported.
13+
*
14+
* @var array
15+
*/
16+
protected $dontReport = [
17+
\Illuminate\Auth\AuthenticationException::class,
18+
\Illuminate\Auth\Access\AuthorizationException::class,
19+
\Symfony\Component\HttpKernel\Exception\HttpException::class,
20+
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
21+
\Illuminate\Session\TokenMismatchException::class,
22+
\Illuminate\Validation\ValidationException::class,
23+
];
24+
25+
/**
26+
* Report or log an exception.
27+
*
28+
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
29+
*
30+
* @param \Exception $exception
31+
* @return void
32+
*/
33+
public function report(Exception $exception)
34+
{
35+
parent::report($exception);
36+
}
37+
38+
/**
39+
* Render an exception into an HTTP response.
40+
*
41+
* @param \Illuminate\Http\Request $request
42+
* @param \Exception $exception
43+
* @return \Illuminate\Http\Response
44+
*/
45+
public function render($request, Exception $exception)
46+
{
47+
return parent::render($request, $exception);
48+
}
49+
50+
/**
51+
* Convert an authentication exception into an unauthenticated response.
52+
*
53+
* @param \Illuminate\Http\Request $request
54+
* @param \Illuminate\Auth\AuthenticationException $exception
55+
* @return \Illuminate\Http\Response
56+
*/
57+
protected function unauthenticated($request, AuthenticationException $exception)
58+
{
59+
if ($request->expectsJson()) {
60+
return response()->json(['error' => 'Unauthenticated.'], 401);
61+
}
62+
63+
return redirect()->guest('login');
64+
}
65+
}

app/Feedback.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class Feedback extends Model
8+
{
9+
protected $connection = 'feed';
10+
11+
protected $table = 'feedback';
12+
13+
public function comment(){
14+
return $this->belongsTo('App\Comments');
15+
}
16+
}

app/Hadith.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class Hadith extends Model
8+
{
9+
protected $connection = 'hadith';
10+
11+
protected $table = 'hadith';
12+
13+
}

app/HadithBody.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class HadithBody extends Model
8+
{
9+
protected $connection = 'body';
10+
11+
protected $table = 'hadithbody';
12+
13+
}

app/HadithFts.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class HadithFts extends Model
8+
{
9+
protected $connection = 'fts';
10+
11+
protected $table = 'hadithfts_content';
12+
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
7+
8+
class ForgotPasswordController extends Controller
9+
{
10+
/*
11+
|--------------------------------------------------------------------------
12+
| Password Reset Controller
13+
|--------------------------------------------------------------------------
14+
|
15+
| This controller is responsible for handling password reset emails and
16+
| includes a trait which assists in sending these notifications from
17+
| your application to your users. Feel free to explore this trait.
18+
|
19+
*/
20+
21+
use SendsPasswordResetEmails;
22+
23+
/**
24+
* Create a new controller instance.
25+
*
26+
* @return void
27+
*/
28+
public function __construct()
29+
{
30+
$this->middleware('guest');
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use Illuminate\Foundation\Auth\AuthenticatesUsers;
7+
8+
class LoginController extends Controller
9+
{
10+
/*
11+
|--------------------------------------------------------------------------
12+
| Login Controller
13+
|--------------------------------------------------------------------------
14+
|
15+
| This controller handles authenticating users for the application and
16+
| redirecting them to your home screen. The controller uses a trait
17+
| to conveniently provide its functionality to your applications.
18+
|
19+
*/
20+
21+
use AuthenticatesUsers;
22+
23+
/**
24+
* Where to redirect users after login.
25+
*
26+
* @var string
27+
*/
28+
protected $redirectTo = '/admins';
29+
30+
/**
31+
* Create a new controller instance.
32+
*
33+
* @return void
34+
*/
35+
public function __construct()
36+
{
37+
$this->middleware('guest', ['except' => 'logout']);
38+
}
39+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\User;
6+
use Validator;
7+
use App\Http\Controllers\Controller;
8+
use Illuminate\Foundation\Auth\RegistersUsers;
9+
10+
class RegisterController extends Controller
11+
{
12+
/*
13+
|--------------------------------------------------------------------------
14+
| Register Controller
15+
|--------------------------------------------------------------------------
16+
|
17+
| This controller handles the registration of new users as well as their
18+
| validation and creation. By default this controller uses a trait to
19+
| provide this functionality without requiring any additional code.
20+
|
21+
*/
22+
23+
use RegistersUsers;
24+
25+
/**
26+
* Where to redirect users after login / registration.
27+
*
28+
* @var string
29+
*/
30+
protected $redirectTo = '/login';
31+
32+
/**
33+
* Create a new controller instance.
34+
*
35+
* @return void
36+
*/
37+
public function __construct()
38+
{
39+
$this->middleware('guest');
40+
}
41+
42+
/**
43+
* Get a validator for an incoming registration request.
44+
*
45+
* @param array $data
46+
* @return \Illuminate\Contracts\Validation\Validator
47+
*/
48+
protected function validator(array $data)
49+
{
50+
return Validator::make($data, [
51+
'name' => 'required|max:255',
52+
'email' => 'required|email|max:255|unique:users',
53+
'password' => 'required|min:6|confirmed',
54+
]);
55+
}
56+
57+
/**
58+
* Create a new user instance after a valid registration.
59+
*
60+
* @param array $data
61+
* @return User
62+
*/
63+
protected function create(array $data)
64+
{
65+
return User::create([
66+
'name' => $data['name'],
67+
'email' => $data['email'],
68+
'password' => bcrypt($data['password']),
69+
]);
70+
}
71+
}

0 commit comments

Comments
 (0)