Skip to content

Commit

Permalink
Cleanup and update files to Laravel 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
austintoddj committed Sep 27, 2017
1 parent a9dcc72 commit e921b43
Show file tree
Hide file tree
Showing 14 changed files with 152 additions and 12 deletions.
24 changes: 24 additions & 0 deletions database/factories/ModelFactory.php
@@ -0,0 +1,24 @@
<?php

/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| Here you may define all of your model factories. Model factories give
| you a convenient way to create models for testing and seeding your
| database. Just tell the factory how a default model should look.
|
*/

/** @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(App\User::class, function (Faker\Generator $faker) {
static $password;

return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'password' => $password ?: $password = bcrypt('secret'),
'remember_token' => str_random(10),
];
});
Empty file removed database/migrations/.gitkeep
Empty file.
35 changes: 35 additions & 0 deletions database/migrations/2014_10_12_000000_create_users_table.php
@@ -0,0 +1,35 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}
@@ -0,0 +1,32 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}
2 changes: 1 addition & 1 deletion database/seeds/DatabaseSeeder.php
Expand Up @@ -13,4 +13,4 @@ public function run()
{
$this->call('Canvas\DatabaseSeeder');
}
}
}
2 changes: 1 addition & 1 deletion database/seeds/TestDatabaseSeeder.php
Expand Up @@ -13,4 +13,4 @@ public function run()
{
$this->call('Canvas\TestDatabaseSeeder');
}
}
}
4 changes: 4 additions & 0 deletions public/.htaccess
Expand Up @@ -13,4 +13,8 @@
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
7 changes: 4 additions & 3 deletions public/index.php
@@ -1,9 +1,10 @@
<?php

/**
* Laravel - A PHP Framework For Web Artisans.
* Laravel - A PHP Framework For Web Artisans
*
* @author Taylor Otwell <taylorotwell@gmail.com>
* @package Laravel
* @author Taylor Otwell <taylor@laravel.com>
*/

/*
Expand All @@ -14,7 +15,7 @@
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels nice to relax.
| loading any of our classes later on. It feels great to relax.
|
*/

Expand Down
23 changes: 23 additions & 0 deletions public/web.config
@@ -0,0 +1,23 @@
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
4 changes: 3 additions & 1 deletion resources/lang/en/validation.php
Expand Up @@ -16,11 +16,13 @@
'accepted' => 'The :attribute must be accepted.',
'active_url' => 'The :attribute is not a valid URL.',
'after' => 'The :attribute must be a date after :date.',
'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
'alpha' => 'The :attribute may only contain letters.',
'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.',
'alpha_num' => 'The :attribute may only contain letters and numbers.',
'array' => 'The :attribute must be an array.',
'before' => 'The :attribute must be a date before :date.',
'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
'between' => [
'numeric' => 'The :attribute must be between :min and :max.',
'file' => 'The :attribute must be between :min and :max kilobytes.',
Expand All @@ -39,7 +41,7 @@
'email' => 'The :attribute must be a valid email address.',
'exists' => 'The selected :attribute is invalid.',
'file' => 'The :attribute must be a file.',
'filled' => 'The :attribute field is required.',
'filled' => 'The :attribute field must have a value.',
'image' => 'The :attribute must be an image.',
'in' => 'The selected :attribute is invalid.',
'in_array' => 'The :attribute field does not exist in :other.',
Expand Down
4 changes: 2 additions & 2 deletions routes/api.php
Expand Up @@ -13,6 +13,6 @@
|
*/

Route::get('/user', function (Request $request) {
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
})->middleware('auth:api');
});
16 changes: 16 additions & 0 deletions routes/channels.php
@@ -0,0 +1,16 @@
<?php

/*
|--------------------------------------------------------------------------
| Broadcast Channels
|--------------------------------------------------------------------------
|
| Here you may register all of the event broadcasting channels that your
| application supports. The given channel authorization callbacks are
| used to check if an authenticated user can listen to the channel.
|
*/

Broadcast::channel('App.User.{id}', function ($user, $id) {
return (int) $user->id === (int) $id;
});
2 changes: 1 addition & 1 deletion routes/console.php
Expand Up @@ -15,4 +15,4 @@

Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
});
})->describe('Display an inspiring quote');
9 changes: 6 additions & 3 deletions routes/web.php
Expand Up @@ -5,9 +5,12 @@
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// Route::get('/', function () {
// return view('welcome');
// });

0 comments on commit e921b43

Please sign in to comment.