我有两个表,看起来(迁移):
Schema::create('sets', function(Blueprint $table)
{
    $table->increments('id');
    $table->string('key');
    $table->string('name');
    $table->string('set_type');
    $table->integer('belongs_to')->unsigned();
    $table->timestamps();
    $table->foreign('belongs_to')->references('id')->on('sets')->onDelete('cascade');
});
Schema::create('posts', function(Blueprint $table)
{
    $table->bigIncrements('id');
    $table->bigInteger('user_id')->unsigned();
    $table->bigInteger('set_id')->unsigned();
    $table->string('post_type', 25);
    $table->text('post');
    $table->boolean('is_reported')->default(false);
    $table->boolean('is_hidden')->default(false);
    $table->timestamps();
    $table->foreign('user_id')->references('id')->on('users');
    $table->foreign('set_id')->references('id')->on('sets');
});
Run Code Online (Sandbox Code Playgroud)
'set'表用于存储应该查看帖子的位置(国家,城市......)的数据.例如,让我们存储一些国家:
   id | key               | name        | belongs_to
   1  | europe            | Europe      | null
   2  | germany-all       | Germany     | 1
   3  | germany-berlin    | Berlin      | 2
   4  | germany-frankfurt | Frankfurt   | 2
   5  | poland-all        | Poland      | 1
   6  | poland-warsaw     | Warsaw      | 5
   7 …Run Code Online (Sandbox Code Playgroud) 我有两个集合,我想将它合并到一个变量(当然,通过一个collumn排序 - created_at).我怎样才能做到这一点?
我的控制器看起来:
$replies = Ticket::with('replies', 'replies.user')->find($id);
$logs = DB::table('logs_ticket')
        ->join('users', 'users.id', '=', 'mod_id')
        ->where('ticket_id', '=', $id)
        ->select('users.username', 'logs_ticket.created_at', 'action')
        ->get();
Run Code Online (Sandbox Code Playgroud)
我的输出查找示例:
回复:
ID | ticket_id | username | message | created_at
1  | 1         | somebody | asdfghj | 2014-04-12 12:12:12
2  | 1         | somebody | qwertyi | 2014-04-14 12:11:10
Run Code Online (Sandbox Code Playgroud)
日志:
ID | ticket_id | username | action | created_at
1  | 1         | somebody | close  | 2014-04-13 12:12:14
2  | 1         | somebody | …Run Code Online (Sandbox Code Playgroud) 我正在查看Google的Material Design指南,我想要添加动画操作栏.我的目标是做这样的事情:

如何为操作栏的内容添加转换?我正在使用Appcompat来保持向后兼容性.
我正在为应用程序进行活动.我想添加日历活动,列为空间,行为时间,单元格为吸引力.我尝试使用Android Week View包,但它有一些限制(列为白天,无法设置最大/最小日期),这就是我无法使用它的原因.
我在想我怎么能这样做.使用View课程从头开始构建它对我来说太难了(我认为存在更好的想法).那么,你能告诉我我可以使用哪个组件吗?TableView,RecyclerView?我正在寻找一个只有4个房间可见的解决方案(在智能手机上),但通过水平滚动你可以显示更多.
我将使用$ http和JSON响应从服务器获取一些数据.$http.get()路线改变后调用.但是在下载数据之前会更改模板.我的目标是:
$scope.init()(via ng-init="init()"),这也初始化从服务器获取数据我怎样才能做到这一点?我的应用程序查找示例:
使用Javascript:
var myApp = angular.module('myApp', []);
myApp.controller('MyCtrl', function($scope, $http) {
    $scope.init = function() {
       $http({method: 'GET', url: 'http://ip.jsontest.com/'}).success(function(data) {
           console.log(data);
               $scope.ip = data.ip;
           });
    }
});
myApp.config(function($routeProvider) {
    $routeProvider.when('/link', {
        controller: 'MyCtrl',
        templateUrl: 'embeded.tpl.html'
    });
});
Run Code Online (Sandbox Code Playgroud)
HTML:
<script type="text/ng-template" id="embeded.tpl.html">
    <div ng-controller="MyCtrl" ng-init="init()">
    Your IP Address is: {{ip}}
    </div>
</script>
<div>
    <ul>
        <li><a href="#/link">change route</a></li>
    </ul>
    <div ng-view></div>
</div>
Run Code Online (Sandbox Code Playgroud) 我正在使用带有Font Awesome图标的包,我可以将它用于Polymer.我想在<paper-menu-button>标签中使用它.这是可能的?我怎样才能做到这一点?我尝试添加icon="fa-save"参数,但它不起作用...
我的代码看起来:
      <core-toolbar id="mainheader">
        <paper-menu-button icon="fa-save" class="white" halign="left" valign="bottom">
          <core-item label="Visibility"></core-item>
          <core-item label="Extension"></core-item>
          <core-item label="Info"></core-item>
        </paper-menu-button>
      </core-toolbar>
Run Code Online (Sandbox Code Playgroud) 我有一个概念,用于创建具有多个参数的路由,当它的数量是动态的时,例如:
/v2/ModuleName/Method/Method2/
Run Code Online (Sandbox Code Playgroud)
在Express中我想把它解析为:Modules.v2.ModuleName.Method.Method2().何时只是一种方法,这当然应该是Modules.v2.ModuleName.Method().有可能这样做吗?
我需要在Ruby中键入后删除数组,例如:
=> ["Foo", "Bar", "Baz", "ooF", "raB", "zaB"] # Cut after "Baz"
=> ["Baz", "ooF", "raB", "zaB"] # result
Run Code Online (Sandbox Code Playgroud)
有可能吗?我怎样才能做到这一点?