Artem Petrov 5 年之前
父节点
当前提交
d68d497397

+ 0 - 21
app/Http/Controllers/HelloWorldController.php

@@ -1,21 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: artem
- * Date: 16.05.18
- * Time: 21:24
- */
-
-namespace App\Http\Controllers;
-
-class HelloWorldController extends Controller
-{
-    /**
-     * @param $name
-     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
-     */
-    public function helloWorld(string $name)
-    {
-        return view('world', ['name' => $name]);
-    }
-}

+ 3 - 42
app/Http/Controllers/PostsController.php

@@ -2,53 +2,14 @@
 /**
  * Created by PhpStorm.
  * User: artem
- * Date: 19.05.18
- * Time: 13:11
+ * Date: 07.09.18
+ * Time: 21:45
  */
 
 namespace App\Http\Controllers;
 
-use App\Http\Requests\StorePostRequest;
-use App\Jobs\SendEmailJob;
-use App\Models\Post;
-use App\User;
-use Illuminate\Http\JsonResponse;
-use Illuminate\Http\Request;
 
-class PostsController extends Controller
+class PostsController
 {
 
-    public function __construct()
-    {
-        $this->middleware('api');
-    }
-
-    public function index(): JsonResponse
-    {
-        $posts = Post::all();
-
-        return response()->json($posts);
-    }
-
-
-    public function show($id)
-    {
-        echo $id;
-    }
-
-    public function destroy($id)
-    {
-        echo 123;
-    }
-
-    public function store(StorePostRequest $request)
-    {
-
-        $user = User::find(1);
-        $emailJob = new SendEmailJob($user);
-
-        dispatch($emailJob);
-
-//        dd($request->all());
-    }
 }

+ 0 - 20
app/Models/Post.php

@@ -1,20 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: artem
- * Date: 19.05.18
- * Time: 13:07
- */
-
-namespace App\Models;
-
-use App\User;
-use Illuminate\Database\Eloquent\Model;
-
-class Post extends Model
-{
-    public function user()
-    {
-        return $this->belongsTo(User::class);
-    }
-}

+ 15 - 0
app/Post.php

@@ -0,0 +1,15 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: artem
+ * Date: 07.09.18
+ * Time: 21:42
+ */
+
+namespace App;
+
+
+class Post
+{
+
+}

+ 0 - 33
database/migrations/2018_05_19_093942_create_posts_table.php

@@ -1,33 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreatePostsTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('posts', function (Blueprint $table) {
-            $table->increments('id');
-            $table->string('title', 100)->default('hello world');
-            $table->text('description');
-            $table->timestamps();
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('posts');
-    }
-}

+ 0 - 34
database/migrations/2018_05_19_104717_add_user_id_to_posts.php

@@ -1,34 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class AddUserIdToPosts extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::table('posts', function (Blueprint $table) {
-            $table->unsignedInteger('user_id')->nullable();
-
-            $table->foreign('user_id')->references('id')->on('users');
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::table('posts', function (Blueprint $table) {
-            $table->dropForeign('posts_user_id_foreign');
-        });
-    }
-}

+ 0 - 36
database/migrations/2018_05_23_184046_create_jobs_table.php

@@ -1,36 +0,0 @@
-<?php
-
-use Illuminate\Support\Facades\Schema;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Database\Migrations\Migration;
-
-class CreateJobsTable extends Migration
-{
-    /**
-     * Run the migrations.
-     *
-     * @return void
-     */
-    public function up()
-    {
-        Schema::create('jobs', function (Blueprint $table) {
-            $table->bigIncrements('id');
-            $table->string('queue')->index();
-            $table->longText('payload');
-            $table->unsignedTinyInteger('attempts');
-            $table->unsignedInteger('reserved_at')->nullable();
-            $table->unsignedInteger('available_at');
-            $table->unsignedInteger('created_at');
-        });
-    }
-
-    /**
-     * Reverse the migrations.
-     *
-     * @return void
-     */
-    public function down()
-    {
-        Schema::dropIfExists('jobs');
-    }
-}

+ 7 - 0
resources/views/posts/edit.blade.php

@@ -0,0 +1,7 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: artem
+ * Date: 11.09.18
+ * Time: 20:58
+ */

+ 7 - 0
resources/views/posts/index.blade.php

@@ -0,0 +1,7 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: artem
+ * Date: 11.09.18
+ * Time: 20:36
+ */

+ 7 - 0
resources/views/posts/view.blade.php

@@ -0,0 +1,7 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: artem
+ * Date: 11.09.18
+ * Time: 20:42
+ */