added some icons, small cleaning, create table page stub, table controller
This commit is contained in:
@@ -23,6 +23,8 @@ class HomeController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('home');
|
||||
$tables = \Auth::user()->tables()->paginate(10);
|
||||
|
||||
return view('home')->with(compact('tables'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TableController extends Controller
|
||||
{
|
||||
/**
|
||||
* SHow a form for creating a new table
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('table.create');
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
*/
|
||||
trait Reportable
|
||||
{
|
||||
public function bootReportable()
|
||||
public static function bootReportable()
|
||||
{
|
||||
static::deleting(function(Reportable $self) {
|
||||
$self->reportsOf()->delete();
|
||||
|
||||
@@ -7,6 +7,7 @@ use App\Models\Concerns\Reportable;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
/**
|
||||
* A user in the application
|
||||
@@ -126,4 +127,13 @@ class User extends Authenticatable
|
||||
{
|
||||
$this->followedDiscussions()->detach($table);
|
||||
}
|
||||
|
||||
public function fakeTables()
|
||||
{
|
||||
return [
|
||||
(object)['title' => 'Table 1'],
|
||||
(object)['title' => 'Table 2'],
|
||||
(object)['title' => 'Table 3']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user