├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── Procfile ├── app ├── Console │ ├── Commands │ │ └── Inspire.php │ └── Kernel.php ├── Events │ └── Event.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Auth │ │ │ ├── AuthController.php │ │ │ └── PasswordController.php │ │ ├── Controller.php │ │ ├── FollowersController.php │ │ ├── SessionsController.php │ │ ├── StaticPagesController.php │ │ ├── StatusesController.php │ │ └── UsersController.php │ ├── Kernel.php │ ├── Middleware │ │ ├── Authenticate.php │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ └── VerifyCsrfToken.php │ ├── Requests │ │ └── Request.php │ └── routes.php ├── Jobs │ └── Job.php ├── Listeners │ └── .gitkeep ├── Models │ ├── Status.php │ └── User.php ├── Policies │ ├── .gitkeep │ ├── StatusPolicy.php │ └── UserPolicy.php └── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── artisan ├── bootstrap ├── app.php ├── autoload.php ├── cache │ └── .gitignore └── helpers.php ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── compile.php ├── database.php ├── filesystems.php ├── mail.php ├── queue.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── ModelFactory.php ├── migrations │ ├── .gitkeep │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2016_12_17_103708_add_is_admin_to_users_table.php │ ├── 2016_12_17_122826_add_activation_to_users_table.php │ ├── 2016_12_18_011525_create_statuses_table.php │ └── 2016_12_18_013048_create_followers_table.php └── seeds │ ├── .gitkeep │ ├── DatabaseSeeder.php │ ├── FollowersTableSeeder.php │ ├── StatusesTableSeeder.php │ └── UsersTableSeeder.php ├── fake_lang ├── compiled.php └── readme.md ├── gulpfile.js ├── package.json ├── phpspec.yml ├── phpunit.xml ├── public ├── .htaccess ├── css │ ├── app.css │ └── app.css.map ├── favicon.ico ├── index.php ├── js │ ├── app.js │ └── app.js.map ├── robots.txt └── web.config ├── readme.md ├── resources ├── assets │ ├── js │ │ └── app.js │ └── sass │ │ └── app.scss ├── lang │ ├── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php │ └── zh-CN │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ ├── auth │ ├── password.blade.php │ └── reset.blade.php │ ├── emails │ ├── confirm.blade.php │ └── password.blade.php │ ├── errors │ └── 503.blade.php │ ├── layouts │ ├── _footer.blade.php │ ├── _header.blade.php │ └── default.blade.php │ ├── sessions │ └── create.blade.php │ ├── shared │ ├── errors.blade.php │ ├── feed.blade.php │ ├── messages.blade.php │ ├── stats.blade.php │ ├── status_form.blade.php │ └── user_info.blade.php │ ├── static_pages │ ├── about.blade.php │ ├── help.blade.php │ └── home.blade.php │ ├── statuses │ └── _status.blade.php │ ├── users │ ├── _follow_form.blade.php │ ├── _user.blade.php │ ├── create.blade.php │ ├── edit.blade.php │ ├── index.blade.php │ ├── show.blade.php │ └── show_follow.blade.php │ └── vendor │ └── .gitkeep ├── server.php ├── storage ├── app │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore └── tests ├── ExampleTest.php └── TestCase.php /.editorconfig: -------------------------------------------------------------------------------- 1 | # coding styles between different editors and IDEs 2 | # editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | 8 | # Change these settings to your own preference 9 | indent_style = space 10 | indent_size = 4 11 | 12 | # We recommend you to keep these unchanged 13 | end_of_line = lf 14 | charset = utf-8 15 | trim_trailing_whitespace = true 16 | insert_final_newline = false 17 | 18 | [*.{js,html,blade.php,css,scss}] 19 | indent_style = space 20 | indent_size = 2 21 | 22 | [*.md] 23 | trim_trailing_whitespace = false 24 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_ENV=local 2 | APP_DEBUG=true 3 | APP_KEY=SomeRandomString 4 | 5 | DB_CONNECTION=mysql 6 | DB_HOST=127.0.0.1 7 | DB_DATABASE=homestead 8 | DB_USERNAME=homestead 9 | DB_PASSWORD=secret 10 | 11 | CACHE_DRIVER=file 12 | SESSION_DRIVER=file 13 | QUEUE_DRIVER=sync 14 | 15 | REDIS_HOST=127.0.0.1 16 | REDIS_PASSWORD=null 17 | REDIS_PORT=6379 18 | 19 | MAIL_DRIVER=smtp 20 | MAIL_HOST=mailtrap.io 21 | MAIL_PORT=2525 22 | MAIL_USERNAME=null 23 | MAIL_PASSWORD=null 24 | MAIL_ENCRYPTION=null 25 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.less linguist-vendored 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /node_modules 3 | Homestead.yaml 4 | Homestead.json 5 | .env 6 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: vendor/bin/heroku-php-apache2 public/ 2 | -------------------------------------------------------------------------------- /app/Console/Commands/Inspire.php: -------------------------------------------------------------------------------- 1 | comment(PHP_EOL.Inspiring::quote().PHP_EOL); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 28 | ->hourly(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Events/Event.php: -------------------------------------------------------------------------------- 1 | getMessage(), $e); 47 | } 48 | 49 | return parent::render($request, $e); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/AuthController.php: -------------------------------------------------------------------------------- 1 | middleware('guest', ['except' => 'getLogout']); 34 | } 35 | 36 | /** 37 | * Get a validator for an incoming registration request. 38 | * 39 | * @param array $data 40 | * @return \Illuminate\Contracts\Validation\Validator 41 | */ 42 | protected function validator(array $data) 43 | { 44 | return Validator::make($data, [ 45 | 'name' => 'required|max:255', 46 | 'email' => 'required|email|max:255|unique:users', 47 | 'password' => 'required|confirmed|min:6', 48 | ]); 49 | } 50 | 51 | /** 52 | * Create a new user instance after a valid registration. 53 | * 54 | * @param array $data 55 | * @return User 56 | */ 57 | protected function create(array $data) 58 | { 59 | return User::create([ 60 | 'name' => $data['name'], 61 | 'email' => $data['email'], 62 | 'password' => bcrypt($data['password']), 63 | ]); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/PasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | middleware('auth', [ 18 | 'store', 'destroy' 19 | ]); 20 | } 21 | 22 | public function store($id) 23 | { 24 | $user = User::findOrFail($id); 25 | 26 | if (Auth::user()->id === $user->id) { 27 | return redirect('/'); 28 | } 29 | 30 | if (!Auth::user()->isFollowing($id)) { 31 | Auth::user()->follow($id); 32 | } 33 | 34 | return redirect()->route('users.show', $id); 35 | } 36 | 37 | public function destroy($id) 38 | { 39 | $user = User::findOrFail($id); 40 | 41 | if (Auth::user()->id === $user->id) { 42 | return redirect('/'); 43 | } 44 | 45 | if (Auth::user()->isFollowing($id)) { 46 | Auth::user()->unfollow($id); 47 | } 48 | 49 | return redirect()->route('users.show', $id); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/Http/Controllers/SessionsController.php: -------------------------------------------------------------------------------- 1 | middleware('guest', [ 17 | 'only' => ['create'] 18 | ]); 19 | } 20 | 21 | public function create() 22 | { 23 | return view('sessions.create'); 24 | } 25 | 26 | public function store(Request $request) 27 | { 28 | $this->validate($request, [ 29 | 'email' => 'required|email|max:255', 30 | 'password' => 'required' 31 | ]); 32 | 33 | $credentials = [ 34 | 'email' => $request->input('email'), 35 | 'password' => $request->input('password'), 36 | ]; 37 | 38 | if (Auth::attempt($credentials, $request->has('remember'))) { 39 | if(Auth::user()->activated) { 40 | session()->flash('success', '欢迎回来!'); 41 | return redirect()->intended(route('users.show', [Auth::user()])); 42 | } else { 43 | Auth::logout(); 44 | session()->flash('warning', '你的账号未激活,请检查邮箱中的注册邮件进行激活。'); 45 | return redirect('/'); 46 | } 47 | } else { 48 | session()->flash('danger', '很抱歉,您的邮箱和密码不匹配'); 49 | return redirect()->back(); 50 | } 51 | } 52 | 53 | public function destroy() 54 | { 55 | Auth::logout(); 56 | session()->flash('success', '您已成功退出!'); 57 | return redirect('login'); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/Http/Controllers/StaticPagesController.php: -------------------------------------------------------------------------------- 1 | feed()->paginate(30); 21 | } 22 | 23 | return view('static_pages/home', compact('feed_items')); 24 | } 25 | 26 | public function help() 27 | { 28 | return view('static_pages/help'); 29 | } 30 | 31 | public function about() 32 | { 33 | return view('static_pages/about'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Http/Controllers/StatusesController.php: -------------------------------------------------------------------------------- 1 | middleware('auth', [ 18 | 'only' => ['store', 'destroy'] 19 | ]); 20 | } 21 | 22 | public function store(Request $request) 23 | { 24 | $this->validate($request, [ 25 | 'content' => 'required|max:140' 26 | ]); 27 | 28 | Auth::user()->statuses()->create([ 29 | 'content' => $request->content 30 | ]); 31 | return redirect()->back(); 32 | } 33 | 34 | public function destroy($id) 35 | { 36 | $status = Status::findOrFail($id); 37 | $this->authorize('destroy', $status); 38 | $status->delete(); 39 | session()->flash('success', '微博已被成功删除!'); 40 | return redirect()->back(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Http/Controllers/UsersController.php: -------------------------------------------------------------------------------- 1 | middleware('auth', [ 20 | 'only' => ['edit', 'update', 'destroy', 'followings', 'followers'] 21 | ]); 22 | 23 | $this->middleware('guest', [ 24 | 'only' => ['create'] 25 | ]); 26 | } 27 | 28 | public function index() 29 | { 30 | $users = User::paginate(30); 31 | return view('users.index', compact('users')); 32 | } 33 | 34 | public function create() 35 | { 36 | return view('users.create'); 37 | } 38 | 39 | public function show($id) 40 | { 41 | $user = User::findOrFail($id); 42 | $statuses = $user->statuses() 43 | ->orderBy('created_at', 'desc') 44 | ->paginate(30); 45 | return view('users.show', compact('user', 'statuses')); 46 | } 47 | 48 | public function store(Request $request) 49 | { 50 | $this->validate($request, [ 51 | 'name' => 'required|max:50', 52 | 'email' => 'required|email|unique:users|max:255', 53 | 'password' => 'required|confirmed|min:6' 54 | ]); 55 | 56 | $user = User::create([ 57 | 'name' => $request->name, 58 | 'email' => $request->email, 59 | 'password' => bcrypt($request->password), 60 | ]); 61 | 62 | $this->sendEmailConfirmationTo($user); 63 | session()->flash('success', '验证邮件已发送到你的注册邮箱上,请注意查收。'); 64 | return redirect('/'); 65 | } 66 | 67 | public function edit($id) 68 | { 69 | $user = User::findOrFail($id); 70 | $this->authorize('update', $user); 71 | return view('users.edit', compact('user')); 72 | } 73 | 74 | public function update($id, Request $request) 75 | { 76 | $this->validate($request, [ 77 | 'name' => 'required|max:50', 78 | 'password' => 'confirmed|min:6' 79 | ]); 80 | 81 | $user = User::findOrFail($id); 82 | $this->authorize('update', $user); 83 | 84 | $data = []; 85 | $data['name'] = $request->name; 86 | if ($request->password) { 87 | $data['password'] = bcrypt($request->password); 88 | } 89 | $user->update($data); 90 | 91 | session()->flash('success', '个人资料更新成功!'); 92 | 93 | return redirect()->route('users.show', $id); 94 | } 95 | 96 | public function destroy($id) 97 | { 98 | $user = User::findOrFail($id); 99 | $this->authorize('destroy', $user); 100 | $user->delete(); 101 | session()->flash('success', '成功删除用户!'); 102 | return back(); 103 | } 104 | 105 | protected function sendEmailConfirmationTo($user) 106 | { 107 | $view = 'emails.confirm'; 108 | $data = compact('user'); 109 | $from = 'aufree@estgroupe.com'; 110 | $name = 'Aufree'; 111 | $to = $user->email; 112 | $subject = "感谢注册 Sample 应用!请确认你的邮箱。"; 113 | 114 | Mail::send($view, $data, function ($message) use ($from, $name, $to, $subject) { 115 | $message->from($from, $name)->to($to)->subject($subject); 116 | }); 117 | } 118 | 119 | public function confirmEmail($token) 120 | { 121 | $user = User::where('activation_token', $token)->firstOrFail(); 122 | 123 | $user->activated = true; 124 | $user->activation_token = null; 125 | $user->save(); 126 | 127 | Auth::login($user); 128 | session()->flash('success', '恭喜你,激活成功!'); 129 | return redirect()->route('users.show', [$user]); 130 | } 131 | 132 | public function followings($id) 133 | { 134 | $user = User::findOrFail($id); 135 | $users = $user->followings()->paginate(30); 136 | $title = '关注的人'; 137 | return view('users.show_follow', compact('users', 'title')); 138 | } 139 | 140 | public function followers($id) 141 | { 142 | $user = User::findOrFail($id); 143 | $users = $user->followers()->paginate(30); 144 | $title = '粉丝'; 145 | return view('users.show_follow', compact('users', 'title')); 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | \App\Http\Middleware\Authenticate::class, 30 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 31 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 32 | ]; 33 | } 34 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 26 | } 27 | 28 | /** 29 | * Handle an incoming request. 30 | * 31 | * @param \Illuminate\Http\Request $request 32 | * @param \Closure $next 33 | * @return mixed 34 | */ 35 | public function handle($request, Closure $next) 36 | { 37 | if ($this->auth->guest()) { 38 | if ($request->ajax()) { 39 | return response('Unauthorized.', 401); 40 | } else { 41 | return redirect()->guest('login'); 42 | } 43 | } 44 | 45 | return $next($request); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 26 | } 27 | 28 | /** 29 | * Handle an incoming request. 30 | * 31 | * @param \Illuminate\Http\Request $request 32 | * @param \Closure $next 33 | * @return mixed 34 | */ 35 | public function handle($request, Closure $next) 36 | { 37 | if ($this->auth->check()) { 38 | return redirect('/'); 39 | } 40 | 41 | return $next($request); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | name('home'); 4 | get('/help', 'StaticPagesController@help')->name('help'); 5 | get('/about', 'StaticPagesController@about')->name('about'); 6 | 7 | get('signup', 'UsersController@create')->name('signup'); 8 | resource('users', 'UsersController'); 9 | 10 | get('login', 'SessionsController@create')->name('login'); 11 | post('login', 'SessionsController@store')->name('login'); 12 | delete('logout', 'SessionsController@destroy')->name('logout'); 13 | 14 | get('signup/confirm/{token}', 'UsersController@confirmEmail')->name('confirm_email'); 15 | 16 | get('password/email', 'Auth\PasswordController@getEmail')->name('password.reset'); 17 | post('password/email', 'Auth\PasswordController@postEmail')->name('password.reset'); 18 | get('password/reset/{token}', 'Auth\PasswordController@getReset')->name('password.edit'); 19 | post('password/reset', 'Auth\PasswordController@postReset')->name('password.update'); 20 | 21 | resource('statuses', 'StatusesController', ['only' => ['store', 'destroy']]); 22 | 23 | get('/users/{id}/followings', 'UsersController@followings')->name('users.followings'); 24 | get('/users/{id}/followers', 'UsersController@followers')->name('users.followers'); 25 | post('/users/followers/{id}', 'FollowersController@store')->name('followers.store'); 26 | delete('/users/followers/{id}', 'FollowersController@destroy')->name('followers.destroy'); 27 | -------------------------------------------------------------------------------- /app/Jobs/Job.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | activation_token = str_random(30); 48 | }); 49 | } 50 | 51 | public function gravatar($size = '100') 52 | { 53 | $hash = md5(strtolower(trim($this->attributes['email']))); 54 | return "http://www.gravatar.com/avatar/$hash?s=$size"; 55 | } 56 | 57 | public function statuses() 58 | { 59 | return $this->hasMany(Status::class); 60 | } 61 | 62 | public function feed() 63 | { 64 | $user_ids = Auth::user()->followings->pluck('id')->toArray(); 65 | array_push($user_ids, Auth::user()->id); 66 | return Status::whereIn('user_id', $user_ids) 67 | ->with('user') 68 | ->orderBy('created_at', 'desc'); 69 | } 70 | 71 | public function followers() 72 | { 73 | return $this->belongsToMany(User::Class, 'followers', 'user_id', 'follower_id'); 74 | } 75 | 76 | public function followings() 77 | { 78 | return $this->belongsToMany(User::Class, 'followers', 'follower_id', 'user_id'); 79 | } 80 | 81 | public function follow($user_ids) 82 | { 83 | if (!is_array($user_ids)) { 84 | $user_ids = compact('user_ids'); 85 | } 86 | $this->followings()->sync($user_ids, false); 87 | } 88 | 89 | public function unfollow($user_ids) 90 | { 91 | if (!is_array($user_ids)) { 92 | $user_ids = compact('user_ids'); 93 | } 94 | $this->followings()->detach($user_ids); 95 | } 96 | 97 | public function isFollowing($user_id) 98 | { 99 | return $this->followings->contains($user_id); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /app/Policies/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/summerblue/laravel-tutorial/761c049942eb0230d9449bda9f257e88ffa5d3b5/app/Policies/.gitkeep -------------------------------------------------------------------------------- /app/Policies/StatusPolicy.php: -------------------------------------------------------------------------------- 1 | id === $status->user_id; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Policies/UserPolicy.php: -------------------------------------------------------------------------------- 1 | id === $user->id; 15 | } 16 | 17 | public function destroy(User $currentUser, User $user) 18 | { 19 | return $currentUser->is_admin && $currentUser->id !== $user->id; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 22 | User::class => UserPolicy::class, 23 | Status::class => StatusPolicy::class, 24 | ]; 25 | 26 | /** 27 | * Register any application authentication / authorization services. 28 | * 29 | * @param \Illuminate\Contracts\Auth\Access\Gate $gate 30 | * @return void 31 | */ 32 | public function boot(GateContract $gate) 33 | { 34 | $this->registerPolicies($gate); 35 | 36 | // 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'App\Listeners\EventListener', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any other events for your application. 23 | * 24 | * @param \Illuminate\Contracts\Events\Dispatcher $events 25 | * @return void 26 | */ 27 | public function boot(DispatcherContract $events) 28 | { 29 | parent::boot($events); 30 | 31 | // 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | group(['namespace' => $this->namespace], function ($router) { 41 | require app_path('Http/routes.php'); 42 | }); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 32 | 33 | $status = $kernel->handle( 34 | $input = new Symfony\Component\Console\Input\ArgvInput, 35 | new Symfony\Component\Console\Output\ConsoleOutput 36 | ); 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Shutdown The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once Artisan has finished running. We will fire off the shutdown events 44 | | so that any final work may be done by the application before we shut 45 | | down the process. This is the last thing to happen to the request. 46 | | 47 | */ 48 | 49 | $kernel->terminate($input, $status); 50 | 51 | exit($status); 52 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | 'pgsql', 10 | 'host' => $url["host"], 11 | 'database' => substr($url["path"], 1), 12 | 'username' => $url["user"], 13 | 'password' => $url["pass"], 14 | ]; 15 | } else { 16 | return $db_config = [ 17 | 'connetion' => env('DB_CONNECTION', 'mysql'), 18 | 'host' => env('DB_HOST', 'localhost'), 19 | 'database' => env('DB_DATABASE', 'forge'), 20 | 'username' => env('DB_USERNAME', 'forge'), 21 | 'password' => env('DB_PASSWORD', ''), 22 | ]; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "type": "project", 7 | "require": { 8 | "php": ">=5.5.9", 9 | "laravel/framework": "5.1.*", 10 | "caouecs/laravel-lang": "~3.0" 11 | }, 12 | "require-dev": { 13 | "fzaninotto/faker": "~1.4", 14 | "mockery/mockery": "0.9.*", 15 | "phpunit/phpunit": "~4.0", 16 | "phpspec/phpspec": "~2.1" 17 | }, 18 | "autoload": { 19 | "classmap": [ 20 | "database" 21 | ], 22 | "psr-4": { 23 | "App\\": "app/" 24 | } 25 | }, 26 | "autoload-dev": { 27 | "classmap": [ 28 | "tests/TestCase.php" 29 | ] 30 | }, 31 | "scripts": { 32 | "post-root-package-install": [ 33 | "php -r \"copy('.env.example', '.env');\"" 34 | ], 35 | "post-create-project-cmd": [ 36 | "php artisan key:generate" 37 | ], 38 | "post-install-cmd": [ 39 | "Illuminate\\Foundation\\ComposerScripts::postInstall", 40 | "php artisan optimize" 41 | ], 42 | "post-update-cmd": [ 43 | "Illuminate\\Foundation\\ComposerScripts::postUpdate", 44 | "php artisan optimize" 45 | ] 46 | }, 47 | "config": { 48 | "preferred-install": "dist" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /config/app.php: -------------------------------------------------------------------------------- 1 | env('APP_DEBUG', false), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Application URL 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This URL is used by the console to properly generate URLs when using 24 | | the Artisan command line tool. You should set this to the root of 25 | | your application so that it is used when running Artisan tasks. 26 | | 27 | */ 28 | 29 | 'url' => 'http://localhost', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Application Timezone 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may specify the default timezone for your application, which 37 | | will be used by the PHP date and date-time functions. We have gone 38 | | ahead and set this to a sensible default for you out of the box. 39 | | 40 | */ 41 | 42 | 'timezone' => 'UTC', 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Application Locale Configuration 47 | |-------------------------------------------------------------------------- 48 | | 49 | | The application locale determines the default locale that will be used 50 | | by the translation service provider. You are free to set this value 51 | | to any of the locales which will be supported by the application. 52 | | 53 | */ 54 | 55 | 'locale' => 'zh-CN', 56 | 57 | /* 58 | |-------------------------------------------------------------------------- 59 | | Application Fallback Locale 60 | |-------------------------------------------------------------------------- 61 | | 62 | | The fallback locale determines the locale to use when the current one 63 | | is not available. You may change the value to correspond to any of 64 | | the language folders that are provided through your application. 65 | | 66 | */ 67 | 68 | 'fallback_locale' => 'en', 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Encryption Key 73 | |-------------------------------------------------------------------------- 74 | | 75 | | This key is used by the Illuminate encrypter service and should be set 76 | | to a random, 32 character string, otherwise these encrypted strings 77 | | will not be safe. Please do this before deploying an application! 78 | | 79 | */ 80 | 81 | 'key' => env('APP_KEY', 'SomeRandomString'), 82 | 83 | 'cipher' => 'AES-256-CBC', 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | Logging Configuration 88 | |-------------------------------------------------------------------------- 89 | | 90 | | Here you may configure the log settings for your application. Out of 91 | | the box, Laravel uses the Monolog PHP logging library. This gives 92 | | you a variety of powerful log handlers / formatters to utilize. 93 | | 94 | | Available Settings: "single", "daily", "syslog", "errorlog" 95 | | 96 | */ 97 | 98 | 'log' => env('APP_LOG', 'single'), 99 | 100 | /* 101 | |-------------------------------------------------------------------------- 102 | | Autoloaded Service Providers 103 | |-------------------------------------------------------------------------- 104 | | 105 | | The service providers listed here will be automatically loaded on the 106 | | request to your application. Feel free to add your own services to 107 | | this array to grant expanded functionality to your applications. 108 | | 109 | */ 110 | 111 | 'providers' => [ 112 | 113 | /* 114 | * Laravel Framework Service Providers... 115 | */ 116 | Illuminate\Foundation\Providers\ArtisanServiceProvider::class, 117 | Illuminate\Auth\AuthServiceProvider::class, 118 | Illuminate\Broadcasting\BroadcastServiceProvider::class, 119 | Illuminate\Bus\BusServiceProvider::class, 120 | Illuminate\Cache\CacheServiceProvider::class, 121 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, 122 | Illuminate\Routing\ControllerServiceProvider::class, 123 | Illuminate\Cookie\CookieServiceProvider::class, 124 | Illuminate\Database\DatabaseServiceProvider::class, 125 | Illuminate\Encryption\EncryptionServiceProvider::class, 126 | Illuminate\Filesystem\FilesystemServiceProvider::class, 127 | Illuminate\Foundation\Providers\FoundationServiceProvider::class, 128 | Illuminate\Hashing\HashServiceProvider::class, 129 | Illuminate\Mail\MailServiceProvider::class, 130 | Illuminate\Pagination\PaginationServiceProvider::class, 131 | Illuminate\Pipeline\PipelineServiceProvider::class, 132 | Illuminate\Queue\QueueServiceProvider::class, 133 | Illuminate\Redis\RedisServiceProvider::class, 134 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, 135 | Illuminate\Session\SessionServiceProvider::class, 136 | Illuminate\Translation\TranslationServiceProvider::class, 137 | Illuminate\Validation\ValidationServiceProvider::class, 138 | Illuminate\View\ViewServiceProvider::class, 139 | 140 | /* 141 | * Application Service Providers... 142 | */ 143 | App\Providers\AppServiceProvider::class, 144 | App\Providers\AuthServiceProvider::class, 145 | App\Providers\EventServiceProvider::class, 146 | App\Providers\RouteServiceProvider::class, 147 | 148 | ], 149 | 150 | /* 151 | |-------------------------------------------------------------------------- 152 | | Class Aliases 153 | |-------------------------------------------------------------------------- 154 | | 155 | | This array of class aliases will be registered when this application 156 | | is started. However, feel free to register as many as you wish as 157 | | the aliases are "lazy" loaded so they don't hinder performance. 158 | | 159 | */ 160 | 161 | 'aliases' => [ 162 | 163 | 'App' => Illuminate\Support\Facades\App::class, 164 | 'Artisan' => Illuminate\Support\Facades\Artisan::class, 165 | 'Auth' => Illuminate\Support\Facades\Auth::class, 166 | 'Blade' => Illuminate\Support\Facades\Blade::class, 167 | 'Bus' => Illuminate\Support\Facades\Bus::class, 168 | 'Cache' => Illuminate\Support\Facades\Cache::class, 169 | 'Config' => Illuminate\Support\Facades\Config::class, 170 | 'Cookie' => Illuminate\Support\Facades\Cookie::class, 171 | 'Crypt' => Illuminate\Support\Facades\Crypt::class, 172 | 'DB' => Illuminate\Support\Facades\DB::class, 173 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 174 | 'Event' => Illuminate\Support\Facades\Event::class, 175 | 'File' => Illuminate\Support\Facades\File::class, 176 | 'Gate' => Illuminate\Support\Facades\Gate::class, 177 | 'Hash' => Illuminate\Support\Facades\Hash::class, 178 | 'Input' => Illuminate\Support\Facades\Input::class, 179 | 'Lang' => Illuminate\Support\Facades\Lang::class, 180 | 'Log' => Illuminate\Support\Facades\Log::class, 181 | 'Mail' => Illuminate\Support\Facades\Mail::class, 182 | 'Password' => Illuminate\Support\Facades\Password::class, 183 | 'Queue' => Illuminate\Support\Facades\Queue::class, 184 | 'Redirect' => Illuminate\Support\Facades\Redirect::class, 185 | 'Redis' => Illuminate\Support\Facades\Redis::class, 186 | 'Request' => Illuminate\Support\Facades\Request::class, 187 | 'Response' => Illuminate\Support\Facades\Response::class, 188 | 'Route' => Illuminate\Support\Facades\Route::class, 189 | 'Schema' => Illuminate\Support\Facades\Schema::class, 190 | 'Session' => Illuminate\Support\Facades\Session::class, 191 | 'Storage' => Illuminate\Support\Facades\Storage::class, 192 | 'URL' => Illuminate\Support\Facades\URL::class, 193 | 'Validator' => Illuminate\Support\Facades\Validator::class, 194 | 'View' => Illuminate\Support\Facades\View::class, 195 | 196 | ], 197 | 198 | ]; 199 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | 'eloquent', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Authentication Model 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "Eloquent" authentication driver, we need to know which 26 | | Eloquent model should be used to retrieve your users. Of course, it 27 | | is often just the "User" model but you may use whatever you like. 28 | | 29 | */ 30 | 31 | 'model' => App\Models\User::class, 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Authentication Table 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "Database" authentication driver, we need to know which 39 | | table should be used to retrieve your users. We have chosen a basic 40 | | default value but you may easily change it to any table you like. 41 | | 42 | */ 43 | 44 | 'table' => 'users', 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Password Reset Settings 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here you may set the options for resetting passwords including the view 52 | | that is your password reset e-mail. You can also set the name of the 53 | | table that maintains all of the reset tokens for your application. 54 | | 55 | | The expire time is the number of minutes that the reset token should be 56 | | considered valid. This security feature keeps tokens short-lived so 57 | | they have less time to be guessed. You may change this as needed. 58 | | 59 | */ 60 | 61 | 'password' => [ 62 | 'email' => 'emails.password', 63 | 'table' => 'password_resets', 64 | 'expire' => 60, 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'pusher'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Broadcast Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may define all of the broadcast connections that will be used 24 | | to broadcast events to other systems or over websockets. Samples of 25 | | each available type of connection are provided inside this array. 26 | | 27 | */ 28 | 29 | 'connections' => [ 30 | 31 | 'pusher' => [ 32 | 'driver' => 'pusher', 33 | 'key' => env('PUSHER_KEY'), 34 | 'secret' => env('PUSHER_SECRET'), 35 | 'app_id' => env('PUSHER_APP_ID'), 36 | 'options' => [ 37 | // 38 | ], 39 | ], 40 | 41 | 'redis' => [ 42 | 'driver' => 'redis', 43 | 'connection' => 'default', 44 | ], 45 | 46 | 'log' => [ 47 | 'driver' => 'log', 48 | ], 49 | 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Cache Stores 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may define all of the cache "stores" for your application as 24 | | well as their drivers. You may even define multiple stores for the 25 | | same cache driver to group types of items stored in your caches. 26 | | 27 | */ 28 | 29 | 'stores' => [ 30 | 31 | 'apc' => [ 32 | 'driver' => 'apc', 33 | ], 34 | 35 | 'array' => [ 36 | 'driver' => 'array', 37 | ], 38 | 39 | 'database' => [ 40 | 'driver' => 'database', 41 | 'table' => 'cache', 42 | 'connection' => null, 43 | ], 44 | 45 | 'file' => [ 46 | 'driver' => 'file', 47 | 'path' => storage_path('framework/cache'), 48 | ], 49 | 50 | 'memcached' => [ 51 | 'driver' => 'memcached', 52 | 'servers' => [ 53 | [ 54 | 'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100, 55 | ], 56 | ], 57 | ], 58 | 59 | 'redis' => [ 60 | 'driver' => 'redis', 61 | 'connection' => 'default', 62 | ], 63 | 64 | ], 65 | 66 | /* 67 | |-------------------------------------------------------------------------- 68 | | Cache Key Prefix 69 | |-------------------------------------------------------------------------- 70 | | 71 | | When utilizing a RAM based store such as APC or Memcached, there might 72 | | be other applications utilizing the same cache. So, we'll specify a 73 | | value to get prefixed to all our keys so we can avoid collisions. 74 | | 75 | */ 76 | 77 | 'prefix' => 'laravel', 78 | 79 | ]; 80 | -------------------------------------------------------------------------------- /config/compile.php: -------------------------------------------------------------------------------- 1 | [ 17 | // 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled File Providers 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may list service providers which define a "compiles" function 26 | | that returns additional files that should be compiled, providing an 27 | | easy way to get common files from any packages you are utilizing. 28 | | 29 | */ 30 | 31 | 'providers' => [ 32 | // 33 | ], 34 | 35 | ]; 36 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | PDO::FETCH_CLASS, 8 | 9 | 'default' => $db_config['connetion'], 10 | 11 | 'connections' => [ 12 | 13 | 'sqlite' => [ 14 | 'driver' => 'sqlite', 15 | 'database' => database_path('database.sqlite'), 16 | 'prefix' => '', 17 | ], 18 | 19 | 'mysql' => [ 20 | 'driver' => 'mysql', 21 | 'host' => env('DB_HOST', 'localhost'), 22 | 'database' => env('DB_DATABASE', 'forge'), 23 | 'username' => env('DB_USERNAME', 'forge'), 24 | 'password' => env('DB_PASSWORD', ''), 25 | 'charset' => 'utf8', 26 | 'collation' => 'utf8_unicode_ci', 27 | 'prefix' => '', 28 | 'strict' => false, 29 | ], 30 | 31 | 'pgsql' => [ 32 | 'driver' => 'pgsql', 33 | 'host' => $db_config['host'], 34 | 'database' => $db_config['database'], 35 | 'username' => $db_config['username'], 36 | 'password' => $db_config['password'], 37 | 'charset' => 'utf8', 38 | 'prefix' => '', 39 | 'schema' => 'public', 40 | ], 41 | 42 | 'sqlsrv' => [ 43 | 'driver' => 'sqlsrv', 44 | 'host' => env('DB_HOST', 'localhost'), 45 | 'database' => env('DB_DATABASE', 'forge'), 46 | 'username' => env('DB_USERNAME', 'forge'), 47 | 'password' => env('DB_PASSWORD', ''), 48 | 'charset' => 'utf8', 49 | 'prefix' => '', 50 | ], 51 | 52 | ], 53 | 54 | 'migrations' => 'migrations', 55 | 56 | 'redis' => [ 57 | 58 | 'cluster' => false, 59 | 60 | 'default' => [ 61 | 'host' => env('REDIS_HOST', 'localhost'), 62 | 'password' => env('REDIS_PASSWORD', null), 63 | 'port' => env('REDIS_PORT', 6379), 64 | 'database' => 0, 65 | ], 66 | 67 | ], 68 | 69 | ]; 70 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | 'local', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Default Cloud Filesystem Disk 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Many applications store files both locally and in the cloud. For this 26 | | reason, you may specify a default "cloud" driver here. This driver 27 | | will be bound as the Cloud disk implementation in the container. 28 | | 29 | */ 30 | 31 | 'cloud' => 's3', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Filesystem Disks 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Here you may configure as many filesystem "disks" as you wish, and you 39 | | may even configure multiple disks of the same driver. Defaults have 40 | | been setup for each driver as an example of the required options. 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'ftp' => [ 52 | 'driver' => 'ftp', 53 | 'host' => 'ftp.example.com', 54 | 'username' => 'your-username', 55 | 'password' => 'your-password', 56 | 57 | // Optional FTP Settings... 58 | // 'port' => 21, 59 | // 'root' => '', 60 | // 'passive' => true, 61 | // 'ssl' => true, 62 | // 'timeout' => 30, 63 | ], 64 | 65 | 's3' => [ 66 | 'driver' => 's3', 67 | 'key' => 'your-key', 68 | 'secret' => 'your-secret', 69 | 'region' => 'your-region', 70 | 'bucket' => 'your-bucket', 71 | ], 72 | 73 | 'rackspace' => [ 74 | 'driver' => 'rackspace', 75 | 'username' => 'your-username', 76 | 'key' => 'your-key', 77 | 'container' => 'your-container', 78 | 'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/', 79 | 'region' => 'IAD', 80 | 'url_type' => 'publicURL', 81 | ], 82 | 83 | ], 84 | 85 | ]; 86 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_DRIVER', 'smtp'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | SMTP Host Address 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may provide the host address of the SMTP server used by your 26 | | applications. A default option is provided that is compatible with 27 | | the Mailgun mail service which will provide reliable deliveries. 28 | | 29 | */ 30 | 31 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | SMTP Host Port 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This is the SMTP port used by your application to deliver e-mails to 39 | | users of the application. Like the host we have set this value to 40 | | stay compatible with the Mailgun e-mail application by default. 41 | | 42 | */ 43 | 44 | 'port' => env('MAIL_PORT', 587), 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Global "From" Address 49 | |-------------------------------------------------------------------------- 50 | | 51 | | You may wish for all e-mails sent by your application to be sent from 52 | | the same address. Here, you may specify a name and address that is 53 | | used globally for all e-mails that are sent by your application. 54 | | 55 | */ 56 | 57 | 'from' => ['address' => null, 'name' => null], 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | E-Mail Encryption Protocol 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Here you may specify the encryption protocol that should be used when 65 | | the application send e-mail messages. A sensible default using the 66 | | transport layer security protocol should provide great security. 67 | | 68 | */ 69 | 70 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | SMTP Server Username 75 | |-------------------------------------------------------------------------- 76 | | 77 | | If your SMTP server requires a username for authentication, you should 78 | | set it here. This will get used to authenticate with your server on 79 | | connection. You may also set the "password" value below this one. 80 | | 81 | */ 82 | 83 | 'username' => env('MAIL_USERNAME'), 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | SMTP Server Password 88 | |-------------------------------------------------------------------------- 89 | | 90 | | Here you may set the password required by your SMTP server to send out 91 | | messages from your application. This will be given to the server on 92 | | connection so that the application will be able to send messages. 93 | | 94 | */ 95 | 96 | 'password' => env('MAIL_PASSWORD'), 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Sendmail System Path 101 | |-------------------------------------------------------------------------- 102 | | 103 | | When using the "sendmail" driver to send e-mails, we will need to know 104 | | the path to where Sendmail lives on this server. A default path has 105 | | been provided here, which will work well on most of your systems. 106 | | 107 | */ 108 | 109 | 'sendmail' => '/usr/sbin/sendmail -bs', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Mail "Pretend" 114 | |-------------------------------------------------------------------------- 115 | | 116 | | When this option is enabled, e-mail will not actually be sent over the 117 | | web and will instead be written to your application's logs files so 118 | | you may inspect the message. This is great for local development. 119 | | 120 | */ 121 | 122 | 'pretend' => env('MAIL_PRETEND', false), 123 | 124 | ]; 125 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Queue Connections 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may configure the connection information for each server that 27 | | is used by your application. A default configuration has been added 28 | | for each back-end shipped with Laravel. You are free to add more. 29 | | 30 | */ 31 | 32 | 'connections' => [ 33 | 34 | 'sync' => [ 35 | 'driver' => 'sync', 36 | ], 37 | 38 | 'database' => [ 39 | 'driver' => 'database', 40 | 'table' => 'jobs', 41 | 'queue' => 'default', 42 | 'expire' => 60, 43 | ], 44 | 45 | 'beanstalkd' => [ 46 | 'driver' => 'beanstalkd', 47 | 'host' => 'localhost', 48 | 'queue' => 'default', 49 | 'ttr' => 60, 50 | ], 51 | 52 | 'sqs' => [ 53 | 'driver' => 'sqs', 54 | 'key' => 'your-public-key', 55 | 'secret' => 'your-secret-key', 56 | 'queue' => 'your-queue-url', 57 | 'region' => 'us-east-1', 58 | ], 59 | 60 | 'iron' => [ 61 | 'driver' => 'iron', 62 | 'host' => 'mq-aws-us-east-1.iron.io', 63 | 'token' => 'your-token', 64 | 'project' => 'your-project-id', 65 | 'queue' => 'your-queue-name', 66 | 'encrypt' => true, 67 | ], 68 | 69 | 'redis' => [ 70 | 'driver' => 'redis', 71 | 'connection' => 'default', 72 | 'queue' => 'default', 73 | 'expire' => 60, 74 | ], 75 | 76 | ], 77 | 78 | /* 79 | |-------------------------------------------------------------------------- 80 | | Failed Queue Jobs 81 | |-------------------------------------------------------------------------- 82 | | 83 | | These options configure the behavior of failed queue job logging so you 84 | | can control which database and table are used to store the jobs that 85 | | have failed. You may change them to any database / table you wish. 86 | | 87 | */ 88 | 89 | 'failed' => [ 90 | 'database' => env('DB_CONNECTION', 'mysql'), 91 | 'table' => 'failed_jobs', 92 | ], 93 | 94 | ]; 95 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | ], 21 | 22 | 'mandrill' => [ 23 | 'secret' => env('MANDRILL_SECRET'), 24 | ], 25 | 26 | 'ses' => [ 27 | 'key' => env('SES_KEY'), 28 | 'secret' => env('SES_SECRET'), 29 | 'region' => 'us-east-1', 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => App\Models\User::class, 34 | 'key' => env('STRIPE_KEY'), 35 | 'secret' => env('STRIPE_SECRET'), 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle before it expires. If you want them 28 | | to immediately expire on the browser closing, set that option. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | 'expire_on_close' => false, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Session Encryption 39 | |-------------------------------------------------------------------------- 40 | | 41 | | This option allows you to easily specify that all of your session data 42 | | should be encrypted before it is stored. All encryption will be run 43 | | automatically by Laravel and you can use the Session like normal. 44 | | 45 | */ 46 | 47 | 'encrypt' => false, 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Session File Location 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When using the native session driver, we need a location where session 55 | | files may be stored. A default has been set for you but a different 56 | | location may be specified. This is only needed for file sessions. 57 | | 58 | */ 59 | 60 | 'files' => storage_path('framework/sessions'), 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Session Database Connection 65 | |-------------------------------------------------------------------------- 66 | | 67 | | When using the "database" or "redis" session drivers, you may specify a 68 | | connection that should be used to manage these sessions. This should 69 | | correspond to a connection in your database configuration options. 70 | | 71 | */ 72 | 73 | 'connection' => null, 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Session Database Table 78 | |-------------------------------------------------------------------------- 79 | | 80 | | When using the "database" session driver, you may specify the table we 81 | | should use to manage the sessions. Of course, a sensible default is 82 | | provided for you; however, you are free to change this as needed. 83 | | 84 | */ 85 | 86 | 'table' => 'sessions', 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Session Sweeping Lottery 91 | |-------------------------------------------------------------------------- 92 | | 93 | | Some session drivers must manually sweep their storage location to get 94 | | rid of old sessions from storage. Here are the chances that it will 95 | | happen on a given request. By default, the odds are 2 out of 100. 96 | | 97 | */ 98 | 99 | 'lottery' => [2, 100], 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Session Cookie Name 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Here you may change the name of the cookie used to identify a session 107 | | instance by ID. The name specified here will get used every time a 108 | | new session cookie is created by the framework for every driver. 109 | | 110 | */ 111 | 112 | 'cookie' => 'laravel_session', 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Session Cookie Path 117 | |-------------------------------------------------------------------------- 118 | | 119 | | The session cookie path determines the path for which the cookie will 120 | | be regarded as available. Typically, this will be the root path of 121 | | your application but you are free to change this when necessary. 122 | | 123 | */ 124 | 125 | 'path' => '/', 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Session Cookie Domain 130 | |-------------------------------------------------------------------------- 131 | | 132 | | Here you may change the domain of the cookie used to identify a session 133 | | in your application. This will determine which domains the cookie is 134 | | available to in your application. A sensible default has been set. 135 | | 136 | */ 137 | 138 | 'domain' => null, 139 | 140 | /* 141 | |-------------------------------------------------------------------------- 142 | | HTTPS Only Cookies 143 | |-------------------------------------------------------------------------- 144 | | 145 | | By setting this option to true, session cookies will only be sent back 146 | | to the server if the browser has a HTTPS connection. This will keep 147 | | the cookie from being sent to you if it can not be done securely. 148 | | 149 | */ 150 | 151 | 'secure' => false, 152 | 153 | ]; 154 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | realpath(base_path('resources/views')), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => realpath(storage_path('framework/views')), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | define(App\Models\User::class, function (Faker\Generator $faker) { 15 | $date_time = $faker->date . ' ' . $faker->time; 16 | static $password; 17 | 18 | return [ 19 | 'name' => $faker->name, 20 | 'email' => $faker->safeEmail, 21 | 'is_admin' => false, 22 | 'activated' => true, 23 | 'password' => $password ?: $password = bcrypt('secret'), 24 | 'remember_token' => str_random(10), 25 | 'created_at' => $date_time, 26 | 'updated_at' => $date_time, 27 | ]; 28 | }); 29 | 30 | $factory->define(App\Models\Status::class, function (Faker\Generator $faker) { 31 | $date_time = $faker->date . ' ' . $faker->time; 32 | return [ 33 | 'content' => $faker->text(), 34 | 'created_at' => $date_time, 35 | 'updated_at' => $date_time, 36 | ]; 37 | }); 38 | -------------------------------------------------------------------------------- /database/migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/summerblue/laravel-tutorial/761c049942eb0230d9449bda9f257e88ffa5d3b5/database/migrations/.gitkeep -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('name'); 18 | $table->string('email')->unique(); 19 | $table->string('password', 60); 20 | $table->rememberToken(); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::drop('users'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 17 | $table->string('token')->index(); 18 | $table->timestamp('created_at'); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::drop('password_resets'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/migrations/2016_12_17_103708_add_is_admin_to_users_table.php: -------------------------------------------------------------------------------- 1 | boolean('is_admin')->default(false); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('users', function (Blueprint $table) { 28 | $table->dropColumn('is_admin'); 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/migrations/2016_12_17_122826_add_activation_to_users_table.php: -------------------------------------------------------------------------------- 1 | string('activation_token')->nullable(); 17 | $table->boolean('activated')->default(false); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('users', function (Blueprint $table) { 29 | $table->dropColumn('activation_token'); 30 | $table->dropColumn('activated'); 31 | }); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2016_12_18_011525_create_statuses_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->text('content'); 18 | $table->integer('user_id')->index(); 19 | $table->index(['created_at']); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::drop('statuses'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2016_12_18_013048_create_followers_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('user_id')->index(); 18 | $table->integer('follower_id')->index(); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::drop('followers'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/seeds/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/summerblue/laravel-tutorial/761c049942eb0230d9449bda9f257e88ffa5d3b5/database/seeds/.gitkeep -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call('UsersTableSeeder'); 18 | $this->call('StatusesTableSeeder'); 19 | $this->call('FollowersTableSeeder'); 20 | 21 | Model::reguard(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /database/seeds/FollowersTableSeeder.php: -------------------------------------------------------------------------------- 1 | first(); 17 | $user_id = $user->id; 18 | 19 | // 获取去除掉 ID 为 1 的所有用户 ID 数组 20 | $followers = $users->slice(1); 21 | $follower_ids = $followers->pluck('id')->toArray(); 22 | 23 | // 关注除了 1 号用户以外的所有用户 24 | $user->follow($follower_ids); 25 | 26 | // 除了 1 号用户以外的所有用户都来关注 1 号用户 27 | foreach ($followers as $follower) { 28 | $follower->follow($user_id); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/seeds/StatusesTableSeeder.php: -------------------------------------------------------------------------------- 1 | times(100)->make()->each(function ($status) use ($faker, $user_ids) { 20 | $status->user_id = $faker->randomElement($user_ids); 21 | }); 22 | 23 | Status::insert($statuses->toArray()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /database/seeds/UsersTableSeeder.php: -------------------------------------------------------------------------------- 1 | times(50)->make(); 16 | User::insert($users->toArray()); 17 | 18 | $user = User::find(1); 19 | $user->name = 'Aufree'; 20 | $user->email = 'aufree@estgroupe.com'; 21 | $user->password = bcrypt('password'); 22 | $user->is_admin = true; 23 | $user->activated = true; 24 | $user->save(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fake_lang/readme.md: -------------------------------------------------------------------------------- 1 | 开发上请无视此文件夹。 2 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var elixir = require('laravel-elixir'); 2 | 3 | elixir(function(mix) { 4 | mix.sass('app.scss') 5 | .browserify('app.js'); 6 | }); 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "devDependencies": { 4 | "gulp": "^3.8.8" 5 | }, 6 | "dependencies": { 7 | "bootstrap-sass": "^3.0.0", 8 | "jquery": "^3.1.1", 9 | "laravel-elixir": "^4.0.0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /phpspec.yml: -------------------------------------------------------------------------------- 1 | suites: 2 | main: 3 | namespace: App 4 | psr4_prefix: App 5 | src_path: app -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests 14 | 15 | 16 | 17 | 18 | ./app 19 | 20 | ./app/Http/routes.php 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes If Not A Folder... 9 | RewriteCond %{REQUEST_FILENAME} !-d 10 | RewriteRule ^(.*)/$ /$1 [L,R=301] 11 | 12 | # Handle Front Controller... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_FILENAME} !-f 15 | RewriteRule ^ index.php [L] 16 | 17 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/summerblue/laravel-tutorial/761c049942eb0230d9449bda9f257e88ffa5d3b5/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | /* 11 | |-------------------------------------------------------------------------- 12 | | Register The Auto Loader 13 | |-------------------------------------------------------------------------- 14 | | 15 | | Composer provides a convenient, automatically generated class loader for 16 | | our application. We just need to utilize it! We'll simply require it 17 | | into the script here so that we don't have to worry about manual 18 | | loading any of our classes later on. It feels nice to relax. 19 | | 20 | */ 21 | 22 | require __DIR__.'/../bootstrap/autoload.php'; 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Turn On The Lights 27 | |-------------------------------------------------------------------------- 28 | | 29 | | We need to illuminate PHP development, so let us turn on the lights. 30 | | This bootstraps the framework and gets it ready for use, then it 31 | | will load up this application so that we can run it and send 32 | | the responses back to the browser and delight our users. 33 | | 34 | */ 35 | 36 | $app = require_once __DIR__.'/../bootstrap/app.php'; 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Run The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once we have the application, we can handle the incoming request 44 | | through the kernel, and send the associated response back to 45 | | the client's browser allowing them to enjoy the creative 46 | | and wonderful application we have prepared for them. 47 | | 48 | */ 49 | 50 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 51 | 52 | $response = $kernel->handle( 53 | $request = Illuminate\Http\Request::capture() 54 | ); 55 | 56 | $response->send(); 57 | 58 | $kernel->terminate($request, $response); 59 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Laravel PHP Framework 4 | 5 | [![Build Status](https://travis-ci.org/laravel/framework.svg)](https://travis-ci.org/laravel/framework) 6 | [![Total Downloads](https://poser.pugx.org/laravel/framework/d/total.svg)](https://packagist.org/packages/laravel/framework) 7 | [![Latest Stable Version](https://poser.pugx.org/laravel/framework/v/stable.svg)](https://packagist.org/packages/laravel/framework) 8 | [![Latest Unstable Version](https://poser.pugx.org/laravel/framework/v/unstable.svg)](https://packagist.org/packages/laravel/framework) 9 | [![License](https://poser.pugx.org/laravel/framework/license.svg)](https://packagist.org/packages/laravel/framework) 10 | 11 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, queueing, and caching. 12 | 13 | Laravel is accessible, yet powerful, providing powerful tools needed for large, robust applications. A superb inversion of control container, expressive migration system, and tightly integrated unit testing support give you the tools you need to build any application with which you are tasked. 14 | 15 | ## Official Documentation 16 | 17 | Documentation for the framework can be found on the [Laravel website](http://laravel.com/docs). 18 | 19 | ## Contributing 20 | 21 | Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](http://laravel.com/docs/contributions). 22 | 23 | ## Security Vulnerabilities 24 | 25 | If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed. 26 | 27 | ### License 28 | 29 | The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) 30 | -------------------------------------------------------------------------------- /resources/assets/js/app.js: -------------------------------------------------------------------------------- 1 | window.$ = window.jQuery = require('jquery'); 2 | require('bootstrap-sass'); 3 | 4 | $(document).ready(function() { 5 | 6 | }); 7 | -------------------------------------------------------------------------------- /resources/assets/sass/app.scss: -------------------------------------------------------------------------------- 1 | @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; 2 | 3 | $navbar-color: #3c3e42; 4 | 5 | /* universal */ 6 | 7 | body { 8 | padding-top: 60px; 9 | } 10 | 11 | section { 12 | overflow: auto; 13 | } 14 | 15 | textarea { 16 | resize: vertical; 17 | } 18 | 19 | .jumbotron { 20 | text-align: center; 21 | } 22 | 23 | .alert-status { 24 | @extend .alert-info; 25 | } 26 | 27 | /* typography */ 28 | 29 | h1, h2, h3, h4, h5, h6 { 30 | line-height: 1; 31 | } 32 | 33 | h1 { 34 | font-size: 3em; 35 | letter-spacing: -2px; 36 | margin-bottom: 30px; 37 | text-align: center; 38 | } 39 | 40 | h2 { 41 | font-size: 1.2em; 42 | letter-spacing: -1px; 43 | margin-bottom: 30px; 44 | text-align: center; 45 | font-weight: normal; 46 | color: #777; 47 | } 48 | 49 | p { 50 | font-size: 1.1em; 51 | line-height: 1.7em; 52 | } 53 | 54 | /* header */ 55 | 56 | .navbar-inverse { 57 | background-color: $navbar-color; 58 | } 59 | 60 | #logo { 61 | float: left; 62 | margin-right: 10px; 63 | font-size: 1.7em; 64 | color: #fff; 65 | text-decoration: none; 66 | letter-spacing: -1px; 67 | padding-top: 9px; 68 | font-weight: bold; 69 | &:hover { 70 | color: #fff; 71 | } 72 | } 73 | 74 | #logout { 75 | cursor: default; 76 | &:hover { 77 | background-color: transparent; 78 | } 79 | } 80 | 81 | /* footer */ 82 | 83 | footer { 84 | margin-top: 45px; 85 | padding-top: 5px; 86 | border-top: 1px solid #eaeaea; 87 | color: #777; 88 | 89 | a { 90 | color: #555; 91 | } 92 | 93 | a:hover { 94 | color: #222; 95 | } 96 | 97 | small { 98 | float: left; 99 | } 100 | 101 | ul { 102 | float: right; 103 | list-style: none; 104 | 105 | li { 106 | float: left; 107 | margin-left: 15px; 108 | } 109 | } 110 | 111 | img.brand-icon { 112 | width: 17px; 113 | height: 17px; 114 | } 115 | 116 | .slogon { 117 | font-size: 13px; 118 | font-weight: bold; 119 | } 120 | } 121 | 122 | /* sidebar */ 123 | 124 | aside { 125 | section { 126 | padding: 10px 0; 127 | margin-top: 20px; 128 | &:first-child { 129 | border: 0; 130 | padding-top: 0; 131 | } 132 | span { 133 | display: block; 134 | margin-bottom: 3px; 135 | line-height: 1; 136 | } 137 | } 138 | } 139 | 140 | section.user_info { 141 | padding-bottom: 10px; 142 | margin-top: 20px; 143 | text-align: center; 144 | .gravatar { 145 | float: none; 146 | max-width: 70px; 147 | } 148 | h1 { 149 | font-size: 1.4em; 150 | letter-spacing: -1px; 151 | margin-bottom: 3px; 152 | margin-top: 15px; 153 | } 154 | } 155 | 156 | .gravatar { 157 | float: left; 158 | margin-right: 10px; 159 | max-width: 50px; 160 | border-radius: 50%; 161 | } 162 | 163 | .stats { 164 | overflow: auto; 165 | margin-top: 0; 166 | padding: 0; 167 | a { 168 | float: left; 169 | padding: 0 10px; 170 | text-align: center; 171 | width: 33%; 172 | border-left: 1px solid $gray-lighter; 173 | color: gray; 174 | &:first-child { 175 | padding-left: 0; 176 | border: 0; 177 | } 178 | &:hover { 179 | text-decoration: none; 180 | color: #337ab7; 181 | } 182 | } 183 | strong { 184 | display: block; 185 | font-size: 1.2em; 186 | color: black; 187 | } 188 | } 189 | 190 | .user_avatars { 191 | overflow: auto; 192 | margin-top: 10px; 193 | .gravatar { 194 | margin: 1px 1px; 195 | } 196 | a { 197 | padding: 0; 198 | } 199 | } 200 | 201 | .users.follow { 202 | padding: 0; 203 | } 204 | 205 | /* forms */ 206 | 207 | #follow_form button { 208 | margin: 0 auto; 209 | display: block; 210 | margin-top: 25px; 211 | } 212 | 213 | input, textarea, select, .uneditable-input { 214 | border: 1px solid #bbb; 215 | width: 100%; 216 | margin-bottom: 15px; 217 | } 218 | 219 | input { 220 | height: auto !important; 221 | } 222 | 223 | .panel { 224 | margin-top: 50px; 225 | } 226 | 227 | /* Users edit */ 228 | 229 | .gravatar_edit { 230 | margin: 15px auto; 231 | text-align: center; 232 | .gravatar { 233 | float: none; 234 | max-width: 100px; 235 | } 236 | } 237 | 238 | /* Users index */ 239 | 240 | .users { 241 | list-style: none; 242 | margin: 0; 243 | padding-left: 0; 244 | li { 245 | overflow: auto; 246 | padding: 10px 0; 247 | border-bottom: 1px solid $gray-lighter; 248 | } 249 | } 250 | 251 | .delete-btn { 252 | float: right; 253 | position: relative; 254 | right: 0; 255 | } 256 | 257 | /* statuses */ 258 | 259 | .statuses { 260 | list-style: none; 261 | padding: 0; 262 | margin-top: 20px; 263 | li { 264 | padding: 10px 0; 265 | border-top: 1px solid #e8e8e8; 266 | position: relative; 267 | } 268 | .user { 269 | margin-top: 5em; 270 | padding-top: 0; 271 | } 272 | .content { 273 | display: block; 274 | margin-left: 60px; 275 | word-break: break-word; 276 | img { 277 | display: block; 278 | padding: 5px 0; 279 | } 280 | } 281 | .timestamp { 282 | color: $gray-light; 283 | display: block; 284 | margin-left: 60px; 285 | } 286 | .gravatar { 287 | margin-right: 10px; 288 | margin-top: 5px; 289 | } 290 | form { 291 | button.status-delete-btn { 292 | position: absolute; 293 | right: 0; 294 | top: 10px; 295 | } 296 | } 297 | } 298 | 299 | aside { 300 | textarea { 301 | height: 100px; 302 | margin-bottom: 5px; 303 | } 304 | } 305 | 306 | .status_form { 307 | margin-top: 20px; 308 | } 309 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /resources/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | 'The :attribute must be accepted.', 17 | 'active_url' => 'The :attribute is not a valid URL.', 18 | 'after' => 'The :attribute must be a date after :date.', 19 | 'alpha' => 'The :attribute may only contain letters.', 20 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', 21 | 'alpha_num' => 'The :attribute may only contain letters and numbers.', 22 | 'array' => 'The :attribute must be an array.', 23 | 'before' => 'The :attribute must be a date before :date.', 24 | 'between' => [ 25 | 'numeric' => 'The :attribute must be between :min and :max.', 26 | 'file' => 'The :attribute must be between :min and :max kilobytes.', 27 | 'string' => 'The :attribute must be between :min and :max characters.', 28 | 'array' => 'The :attribute must have between :min and :max items.', 29 | ], 30 | 'boolean' => 'The :attribute field must be true or false.', 31 | 'confirmed' => 'The :attribute confirmation does not match.', 32 | 'date' => 'The :attribute is not a valid date.', 33 | 'date_format' => 'The :attribute does not match the format :format.', 34 | 'different' => 'The :attribute and :other must be different.', 35 | 'digits' => 'The :attribute must be :digits digits.', 36 | 'digits_between' => 'The :attribute must be between :min and :max digits.', 37 | 'email' => 'The :attribute must be a valid email address.', 38 | 'exists' => 'The selected :attribute is invalid.', 39 | 'filled' => 'The :attribute field is required.', 40 | 'image' => 'The :attribute must be an image.', 41 | 'in' => 'The selected :attribute is invalid.', 42 | 'integer' => 'The :attribute must be an integer.', 43 | 'ip' => 'The :attribute must be a valid IP address.', 44 | 'json' => 'The :attribute must be a valid JSON string.', 45 | 'max' => [ 46 | 'numeric' => 'The :attribute may not be greater than :max.', 47 | 'file' => 'The :attribute may not be greater than :max kilobytes.', 48 | 'string' => 'The :attribute may not be greater than :max characters.', 49 | 'array' => 'The :attribute may not have more than :max items.', 50 | ], 51 | 'mimes' => 'The :attribute must be a file of type: :values.', 52 | 'min' => [ 53 | 'numeric' => 'The :attribute must be at least :min.', 54 | 'file' => 'The :attribute must be at least :min kilobytes.', 55 | 'string' => 'The :attribute must be at least :min characters.', 56 | 'array' => 'The :attribute must have at least :min items.', 57 | ], 58 | 'not_in' => 'The selected :attribute is invalid.', 59 | 'numeric' => 'The :attribute must be a number.', 60 | 'regex' => 'The :attribute format is invalid.', 61 | 'required' => 'The :attribute field is required.', 62 | 'required_if' => 'The :attribute field is required when :other is :value.', 63 | 'required_unless' => 'The :attribute field is required unless :other is in :values.', 64 | 'required_with' => 'The :attribute field is required when :values is present.', 65 | 'required_with_all' => 'The :attribute field is required when :values is present.', 66 | 'required_without' => 'The :attribute field is required when :values is not present.', 67 | 'required_without_all' => 'The :attribute field is required when none of :values are present.', 68 | 'same' => 'The :attribute and :other must match.', 69 | 'size' => [ 70 | 'numeric' => 'The :attribute must be :size.', 71 | 'file' => 'The :attribute must be :size kilobytes.', 72 | 'string' => 'The :attribute must be :size characters.', 73 | 'array' => 'The :attribute must contain :size items.', 74 | ], 75 | 'string' => 'The :attribute must be a string.', 76 | 'timezone' => 'The :attribute must be a valid zone.', 77 | 'unique' => 'The :attribute has already been taken.', 78 | 'url' => 'The :attribute format is invalid.', 79 | 80 | /* 81 | |-------------------------------------------------------------------------- 82 | | Custom Validation Language Lines 83 | |-------------------------------------------------------------------------- 84 | | 85 | | Here you may specify custom validation messages for attributes using the 86 | | convention "attribute.rule" to name the lines. This makes it quick to 87 | | specify a specific custom language line for a given attribute rule. 88 | | 89 | */ 90 | 91 | 'custom' => [ 92 | 'attribute-name' => [ 93 | 'rule-name' => 'custom-message', 94 | ], 95 | ], 96 | 97 | /* 98 | |-------------------------------------------------------------------------- 99 | | Custom Validation Attributes 100 | |-------------------------------------------------------------------------- 101 | | 102 | | The following language lines are used to swap attribute place-holders 103 | | with something more reader friendly such as E-Mail Address instead 104 | | of "email". This simply helps us make messages a little cleaner. 105 | | 106 | */ 107 | 108 | 'attributes' => [], 109 | 110 | ]; 111 | -------------------------------------------------------------------------------- /resources/lang/zh-CN/auth.php: -------------------------------------------------------------------------------- 1 | '用户名或密码错误。', 17 | 'throttle' => '您的尝试登录次数过多. 请 :seconds 秒后再试。', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/zh-CN/pagination.php: -------------------------------------------------------------------------------- 1 | '« 上一页', 17 | 'next' => '下一页 »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/zh-CN/passwords.php: -------------------------------------------------------------------------------- 1 | '密码至少是六位字符并且匹配。', 17 | 'reset' => '密码重置成功!', 18 | 'sent' => '密码重置邮件已发送!', 19 | 'token' => '密码重置令牌无效。', 20 | 'user' => '找不到该邮箱对应的用户。', 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /resources/lang/zh-CN/validation.php: -------------------------------------------------------------------------------- 1 | ':attribute 必须接受。', 17 | 'active_url' => ':attribute 不是一个有效的网址。', 18 | 'after' => ':attribute 必须要晚于 :date。', 19 | 'after_or_equal' => ':attribute 必须要等于 :date 或更晚。', 20 | 'alpha' => ':attribute 只能由字母组成。', 21 | 'alpha_dash' => ':attribute 只能由字母、数字和斜杠组成。', 22 | 'alpha_num' => ':attribute 只能由字母和数字组成。', 23 | 'array' => ':attribute 必须是一个数组。', 24 | 'before' => ':attribute 必须要早于 :date。', 25 | 'before_or_equal' => ':attribute 必须要等于 :date 或更早。', 26 | 'between' => [ 27 | 'numeric' => ':attribute 必须介于 :min - :max 之间。', 28 | 'file' => ':attribute 必须介于 :min - :max kb 之间。', 29 | 'string' => ':attribute 必须介于 :min - :max 个字符之间。', 30 | 'array' => ':attribute 必须只有 :min - :max 个单元。', 31 | ], 32 | 'boolean' => ':attribute 必须为布尔值。', 33 | 'confirmed' => ':attribute 两次输入不一致。', 34 | 'date' => ':attribute 不是一个有效的日期。', 35 | 'date_format' => ':attribute 的格式必须为 :format。', 36 | 'different' => ':attribute 和 :other 必须不同。', 37 | 'digits' => ':attribute 必须是 :digits 位的数字。', 38 | 'digits_between' => ':attribute 必须是介于 :min 和 :max 位的数字。', 39 | 'dimensions' => ':attribute 图片尺寸不正确。', 40 | 'distinct' => ':attribute 已经存在。', 41 | 'email' => ':attribute 不是一个合法的邮箱。', 42 | 'exists' => ':attribute 不存在。', 43 | 'file' => ':attribute 必须是文件。', 44 | 'filled' => ':attribute 不能为空。', 45 | 'image' => ':attribute 必须是图片。', 46 | 'in' => '已选的属性 :attribute 非法。', 47 | 'in_array' => ':attribute 没有在 :other 中。', 48 | 'integer' => ':attribute 必须是整数。', 49 | 'ip' => ':attribute 必须是有效的 IP 地址。', 50 | 'json' => ':attribute 必须是正确的 JSON 格式。', 51 | 'max' => [ 52 | 'numeric' => ':attribute 不能大于 :max。', 53 | 'file' => ':attribute 不能大于 :max kb。', 54 | 'string' => ':attribute 不能大于 :max 个字符。', 55 | 'array' => ':attribute 最多只有 :max 个单元。', 56 | ], 57 | 'mimes' => ':attribute 必须是一个 :values 类型的文件。', 58 | 'mimetypes' => ':attribute 必须是一个 :values 类型的文件。', 59 | 'min' => [ 60 | 'numeric' => ':attribute 必须大于等于 :min。', 61 | 'file' => ':attribute 大小不能小于 :min kb。', 62 | 'string' => ':attribute 至少为 :min 个字符。', 63 | 'array' => ':attribute 至少有 :min 个单元。', 64 | ], 65 | 'not_in' => '已选的属性 :attribute 非法。', 66 | 'numeric' => ':attribute 必须是一个数字。', 67 | 'present' => ':attribute 必须存在。', 68 | 'regex' => ':attribute 格式不正确。', 69 | 'required' => ':attribute 不能为空。', 70 | 'required_if' => '当 :other 为 :value 时 :attribute 不能为空。', 71 | 'required_unless' => '当 :other 不为 :value 时 :attribute 不能为空。', 72 | 'required_with' => '当 :values 存在时 :attribute 不能为空。', 73 | 'required_with_all' => '当 :values 存在时 :attribute 不能为空。', 74 | 'required_without' => '当 :values 不存在时 :attribute 不能为空。', 75 | 'required_without_all' => '当 :values 都不存在时 :attribute 不能为空。', 76 | 'same' => ':attribute 和 :other 必须相同。', 77 | 'size' => [ 78 | 'numeric' => ':attribute 大小必须为 :size。', 79 | 'file' => ':attribute 大小必须为 :size kb。', 80 | 'string' => ':attribute 必须是 :size 个字符。', 81 | 'array' => ':attribute 必须为 :size 个单元。', 82 | ], 83 | 'string' => ':attribute 必须是一个字符串。', 84 | 'timezone' => ':attribute 必须是一个合法的时区值。', 85 | 'unique' => ':attribute 已经存在。', 86 | 'uploaded' => ':attribute 上传失败。', 87 | 'url' => ':attribute 格式不正确。', 88 | 89 | /* 90 | |-------------------------------------------------------------------------- 91 | | Custom Validation Language Lines 92 | |-------------------------------------------------------------------------- 93 | | 94 | | Here you may specify custom validation messages for attributes using the 95 | | convention 'attribute.rule' to name the lines. This makes it quick to 96 | | specify a specific custom language line for a given attribute rule. 97 | | 98 | */ 99 | 100 | 'custom' => [ 101 | 'attribute-name' => [ 102 | 'rule-name' => 'custom-message', 103 | ], 104 | ], 105 | 106 | /* 107 | |-------------------------------------------------------------------------- 108 | | Custom Validation Attributes 109 | |-------------------------------------------------------------------------- 110 | | 111 | | The following language lines are used to swap attribute place-holders 112 | | with something more reader friendly such as E-Mail Address instead 113 | | of 'email'. This simply helps us make messages a little cleaner. 114 | | 115 | */ 116 | 117 | 'attributes' => [ 118 | 'name' => '名称', 119 | 'username' => '用户名', 120 | 'email' => '邮箱', 121 | 'first_name' => '名', 122 | 'last_name' => '姓', 123 | 'password' => '密码', 124 | 'password_confirmation' => '确认密码', 125 | 'city' => '城市', 126 | 'country' => '国家', 127 | 'address' => '地址', 128 | 'phone' => '电话', 129 | 'mobile' => '手机', 130 | 'age' => '年龄', 131 | 'sex' => '性别', 132 | 'gender' => '性别', 133 | 'day' => '天', 134 | 'month' => '月', 135 | 'year' => '年', 136 | 'hour' => '时', 137 | 'minute' => '分', 138 | 'second' => '秒', 139 | 'title' => '标题', 140 | 'content' => '内容', 141 | 'description' => '描述', 142 | 'excerpt' => '摘要', 143 | 'date' => '日期', 144 | 'time' => '时间', 145 | 'available' => '可用的', 146 | 'size' => '大小', 147 | ], 148 | 149 | ]; 150 | -------------------------------------------------------------------------------- /resources/views/auth/password.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | @section('title', '重置密码') 3 | 4 | @section('content') 5 |
6 |
7 |
8 |
9 |
重置密码
10 |
11 | @include('shared.errors') 12 |
13 | {{ csrf_field() }} 14 | 15 |
16 | 17 |
18 | 19 |
20 |
21 | 22 |
23 |
24 | 27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | @stop 36 | -------------------------------------------------------------------------------- /resources/views/auth/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | @section('title', '更新密码') 3 | 4 | @section('content') 5 |
6 |
7 |
8 |
9 |
更新密码
10 |
11 | @include('shared.errors') 12 | 13 |
14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 |
22 |
23 | 24 |
25 | 26 |
27 | 28 |
29 |
30 | 31 |
32 | 33 |
34 | 35 |
36 |
37 | 38 |
39 |
40 | 43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | @stop 52 | -------------------------------------------------------------------------------- /resources/views/emails/confirm.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 注册确认链接 6 | 7 | 8 |

感谢您在 Sample 网站进行注册!

9 | 10 |

11 | 请点击下面的链接完成注册: 12 | 13 | {{ route('confirm_email', $user->activation_token) }} 14 | 15 |

16 | 17 |

18 | 如果这不是您本人的操作,请忽略此邮件。 19 |

20 | 21 | 22 | -------------------------------------------------------------------------------- /resources/views/emails/password.blade.php: -------------------------------------------------------------------------------- 1 |

点击下面链接重置密码:

2 | 3 | 4 | {{ route('password.update') . '/' . $token }} 5 | 6 | -------------------------------------------------------------------------------- /resources/views/errors/503.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Be right back. 5 | 6 | 7 | 8 | 39 | 40 | 41 |
42 |
43 |
Be right back.
44 |
45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /resources/views/layouts/_footer.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 15 |
16 | -------------------------------------------------------------------------------- /resources/views/layouts/_header.blade.php: -------------------------------------------------------------------------------- 1 | 37 | -------------------------------------------------------------------------------- /resources/views/layouts/default.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @yield('title', 'Sample App') - Laravel 入门教程 5 | 6 | 7 | 8 | @include('layouts._header') 9 | 10 |
11 |
12 | @include('shared.messages') 13 | @yield('content') 14 | @include('layouts._footer') 15 |
16 |
17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /resources/views/sessions/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | @section('title', '登录') 3 | 4 | @section('content') 5 |
6 |
7 |
8 |
登录
9 |
10 |
11 | @include('shared.errors') 12 | 13 |
14 | {{ csrf_field() }} 15 | 16 |
17 | 18 | 19 |
20 | 21 |
22 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 |
34 | 35 |

还没账号?现在注册!

36 |
37 |
38 |
39 | @stop 40 | -------------------------------------------------------------------------------- /resources/views/shared/errors.blade.php: -------------------------------------------------------------------------------- 1 | @if (count($errors) > 0) 2 |
3 | 8 |
9 | @endif 10 | -------------------------------------------------------------------------------- /resources/views/shared/feed.blade.php: -------------------------------------------------------------------------------- 1 | @if (count($feed_items)) 2 |
    3 | @foreach ($feed_items as $status) 4 | @include('statuses._status', ['user' => $status->user]) 5 | @endforeach 6 | {!! $feed_items->render() !!} 7 |
8 | @endif 9 | -------------------------------------------------------------------------------- /resources/views/shared/messages.blade.php: -------------------------------------------------------------------------------- 1 | @foreach (['danger', 'warning', 'success', 'info', 'status'] as $msg) 2 | @if(session()->has($msg)) 3 |
4 |

5 | {{ session()->get($msg) }} 6 |

7 |
8 | @endif 9 | @endforeach 10 | -------------------------------------------------------------------------------- /resources/views/shared/stats.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | {{ count($user->followings) }} 5 | 6 | 关注 7 | 8 | 9 | 10 | {{ count($user->followers) }} 11 | 12 | 粉丝 13 | 14 | 15 | 16 | {{ $user->statuses()->count() }} 17 | 18 | 微博 19 | 20 |
21 | -------------------------------------------------------------------------------- /resources/views/shared/status_form.blade.php: -------------------------------------------------------------------------------- 1 |
2 | @include('shared.errors') 3 | {{ csrf_field() }} 4 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /resources/views/shared/user_info.blade.php: -------------------------------------------------------------------------------- 1 | 2 | {{ $user->name }} 3 | 4 |

{{ $user->name }}

5 | -------------------------------------------------------------------------------- /resources/views/static_pages/about.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | @section('title', '关于') 3 | 4 | @section('content') 5 |

关于页

6 | @stop 7 | -------------------------------------------------------------------------------- /resources/views/static_pages/help.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | @section('title', '帮助') 3 | 4 | @section('content') 5 |

帮助页

6 | @stop 7 | -------------------------------------------------------------------------------- /resources/views/static_pages/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | 3 | @section('content') 4 | @if (Auth::check()) 5 |
6 |
7 |
8 | @include('shared.status_form') 9 |
10 |

微博列表

11 | @include('shared/feed') 12 |
13 | 21 |
22 | @else 23 |
24 |

Hello Laravel

25 |

26 | 你现在所看到的是 Laravel 入门教程 的项目主页。 27 |

28 |

29 | 一切,将从这里开始。 30 |

31 |

32 | 现在注册 33 |

34 |
35 | @endif 36 | @stop 37 | -------------------------------------------------------------------------------- /resources/views/statuses/_status.blade.php: -------------------------------------------------------------------------------- 1 |
  • 2 | 3 | {{ $user->name }} 4 | 5 | 6 | {{ $user->name }} 7 | 8 | 9 | {{ $status->created_at->diffForHumans() }} 10 | 11 | {{ $status->content }} 12 | @can('destroy', $status) 13 |
    14 | {{ csrf_field() }} 15 | {{ method_field('DELETE') }} 16 | 17 |
    18 | @endcan 19 |
  • 20 | -------------------------------------------------------------------------------- /resources/views/users/_follow_form.blade.php: -------------------------------------------------------------------------------- 1 | @if ($user->id !== Auth::user()->id) 2 |
    3 | @if (Auth::user()->isFollowing($user->id)) 4 |
    5 | {{ csrf_field() }} 6 | {{ method_field('DELETE') }} 7 | 8 |
    9 | @else 10 |
    11 | {{ csrf_field() }} 12 | 13 |
    14 | @endif 15 |
    16 | @endif 17 | -------------------------------------------------------------------------------- /resources/views/users/_user.blade.php: -------------------------------------------------------------------------------- 1 |
  • 2 | {{ $user->name }} 3 | {{ $user->name }} 4 | 5 | @can('destroy', $user) 6 |
    7 | {{ csrf_field() }} 8 | {{ method_field('DELETE') }} 9 | 10 |
    11 | @endcan 12 |
  • 13 | -------------------------------------------------------------------------------- /resources/views/users/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | @section('title', '注册') 3 | 4 | @section('content') 5 |
    6 |
    7 |
    8 |
    注册
    9 |
    10 |
    11 | @include('shared.errors') 12 | 13 |
    14 | {{ csrf_field() }} 15 | 16 |
    17 | 18 | 19 |
    20 | 21 |
    22 | 23 | 24 |
    25 | 26 |
    27 | 28 | 29 |
    30 | 31 |
    32 | 33 | 34 |
    35 | 36 | 37 |
    38 |
    39 |
    40 |
    41 | @stop 42 | -------------------------------------------------------------------------------- /resources/views/users/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | @section('title', '更新个人资料') 3 | 4 | @section('content') 5 |
    6 |
    7 |
    8 |
    更新个人资料
    9 |
    10 |
    11 | 12 | @include('shared.errors') 13 | 14 |
    15 | 16 | {{ $user->name }} 17 | 18 |
    19 | 20 |
    21 | {{ method_field('PATCH') }} 22 | {{ csrf_field() }} 23 | 24 |
    25 | 26 | 27 |
    28 | 29 |
    30 | 31 | 32 |
    33 | 34 |
    35 | 36 | 37 |
    38 | 39 |
    40 | 41 | 42 |
    43 | 44 | 45 |
    46 |
    47 |
    48 |
    49 | @stop 50 | -------------------------------------------------------------------------------- /resources/views/users/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | @section('title', '所有用户') 3 | 4 | @section('content') 5 |
    6 |

    所有用户

    7 | 12 | 13 | {!! $users->render() !!} 14 |
    15 | @stop 16 | -------------------------------------------------------------------------------- /resources/views/users/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | @section('title', $user->name) 3 | @section('content') 4 |
    5 |
    6 |
    7 |
    8 | 11 |
    12 | @include('shared.stats', ['user' => $user]) 13 |
    14 |
    15 |
    16 |
    17 | @if (Auth::check()) 18 | @include('users._follow_form') 19 | @endif 20 | 21 | @if (count($statuses) > 0) 22 |
      23 | @foreach ($statuses as $status) 24 | @include('statuses._status') 25 | @endforeach 26 |
    27 | {!! $statuses->render() !!} 28 | @endif 29 |
    30 |
    31 |
    32 | @stop 33 | -------------------------------------------------------------------------------- /resources/views/users/show_follow.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.default') 2 | @section('title', $title) 3 | 4 | @section('content') 5 |
    6 |

    {{ $title }}

    7 | 15 | 16 | {!! $users->render() !!} 17 |
    18 | @stop 19 | -------------------------------------------------------------------------------- /resources/views/vendor/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/summerblue/laravel-tutorial/761c049942eb0230d9449bda9f257e88ffa5d3b5/resources/views/vendor/.gitkeep -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | compiled.php 4 | services.json 5 | events.scanned.php 6 | routes.scanned.php 7 | down 8 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/ExampleTest.php: -------------------------------------------------------------------------------- 1 | visit('/') 17 | ->see('Laravel 5'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); 22 | 23 | return $app; 24 | } 25 | } 26 | --------------------------------------------------------------------------------