<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCategoryableTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('categoryable', function (Blueprint $table) {
$table->integer('category_id');
$table->integer('categoryable_id');
$table->string('categoryable_type');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('categoryable');
}
}
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| 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');
});
Route::group(['middleware' => 'auth'], function(){
Route::get('/settings', 'SettingsController@edit');
// Route::get('/settings', function ($name = null){
// redirect()->route("settings");
// });
// dd("stop");
// Route::post("/settings/store", "SettingsController@store");
Route::post('settings/{name?}', "SettingsController@store")->name("settings.store");
});
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
в каком файле?