Skip to content

Commit

Permalink
Update for Orchid Platform 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PSalador committed Jun 5, 2019
1 parent 00bedc3 commit 100bed7
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"require": {
"php": "^7.1",
"cviebrock/eloquent-sluggable": "^4.8",
"orchid/platform": "dev-master",
"orchid/platform": "~5.0.0|dev-master",
"orchids/xsetting": "dev-master"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion install-stubs/Orchid/Entities/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace App\Orchid\Entities;

use Orchid\Screen\TD;
use Orchid\Press\Screen\TD;
use Orchid\Screen\Field;
use Orchid\Screen\Fields\Map;
use Orchid\Screen\Fields\UTM;
Expand Down
4 changes: 4 additions & 0 deletions public/clean-blog/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"/js/app.js": "/js/app.js",
"/css/app.css": "/css/app.css"
}
2 changes: 1 addition & 1 deletion resources/stubs/many.stub
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace DummyNamespace;

use Orchid\Screen\Field;
use Orchid\Press\Entities\Many;
use Orchid\Platform\Filters\Filter;
use Orchid\Filters\Filter;

class DummyClass extends Many
{
Expand Down
4 changes: 3 additions & 1 deletion src/Screen/Fields/Tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,15 @@ public static function make(string $name = null): self
*
* @return \Orchid\Screen\Field|void
*/
public function modifyName($name)
public function modifyName($name) :Field
{
if (substr($name, -1) !== '.') {
$this->attributes['name'] = $name.'[]';
}

parent::modifyName($this->attributes['name']);

return $this;
}

/**
Expand Down
41 changes: 41 additions & 0 deletions src/Screen/TD.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

namespace Orchid\Press\Screen;

use Closure;
use Orchid\Screen\TD as BaseTD;

class TD extends BaseTD
{
/**
* @param string|null $text
*
* @return TD
*/
public function linkPost(string $text = null): self
{
return $this->link('platform.entities.type.edit', ['type', 'slug'], $text);
}

/**
* @param string|null $column
*
* @return TD
*/
public function column(string $column = null): self
{
if (! is_null($column)) {
$this->column = $column;
}

if ($this->locale && ! is_null($column)) {
$locale = '.'.app()->getLocale().'.';
$this->column = preg_replace('/'.preg_quote('.', '/').'/', $locale, $column);
}

return $this;
}

}

0 comments on commit 100bed7

Please sign in to comment.