Commit 88445195 by Aan Choesni Herlingga

auto translate page dan post harus karakter kurang dari 5000

parent de76d064
......@@ -2,11 +2,11 @@
namespace App\Http\Controllers\Webprofile\Backend;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\Webprofile\Categories;
use App\Repositories\Webprofile\En\PagesRepository as EnPagesRepository;
use App\Repositories\Webprofile\PagesRepository;
use Illuminate\Http\Request;
use Statickidz\GoogleTranslate;
class PageController extends Controller
......@@ -60,8 +60,6 @@ class PageController extends Controller
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
......@@ -73,7 +71,9 @@ class PageController extends Controller
if (webprofilesetting()['auto_translate'] == 1) {
// save translate
$this->createEn($data, $save);
if (strlen($fields['q']) < 5000) {
$this->createEn($data, $save);
}
}
return redirect()->route('pages.index');
......@@ -131,8 +131,7 @@ class PageController extends Controller
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @param int $id
*
* @return \Illuminate\Http\Response
*/
......
......@@ -91,7 +91,9 @@ class PostController extends Controller
if (webprofilesetting()['auto_translate'] == 1) {
// save translate
$this->createEn($data, $save);
if (strlen($fields['q']) < 5000) {
$this->createEn($data, $save);
}
}
$this->share($data, $request);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment