Session::put([
$data['title'] => 'title',
$data['url'] => 'url',
$data['keywords'] => 'keywords',
$data['description'] => 'description',
'step_one' => 'true'
]);
Session::put([
$data['theme'] => 'theme',
'step_free' => 'true'
]);
$addnews = \App\Site::add();
public static function add()
{
$site = new Site();
$site->title = Session::get('title');
$site->url = Session::get('url');
$site->keywords = Session::get('keywords');
$site->description = Session::get('description');
$site->author = Auth::user()->name;
$site->save();
}
preg_replace(): Parameter mismatch, pattern is a string while replacement is an array
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName lar.ru
ServerAlias *.lar.ru
DocumentRoot "C:\xampp\htdocs\lar.ru\public"
</VirtualHost>
public function index($domain)
{
$subdomain = \App\Domain::where('url', '=', $domain)->first();
if(!$subdomain)
{
return Response::make('Not Found', 404);
}
else
{
return view('sub.template')->with(['subdomain' => $subdomain]);
}
}
class Comments extends Eloquent {
public static function add($data) {
$comments = new Comments();
$comments->news_id = '2';
$comments->body = $data['description'];
$comments->author = 'fac450@mail.ru';
$comments->save();
}
}
class PostController extends BaseController {
public function getNews($id) {
$id = (int) $id;
$news = Post::get($id);
$comments = Post::find($id)->comments;
return View::make('template.full_news')->with(['news' => $news, 'comments' => $comments]);
}
public function addComments() {
$data = Input::all();
$rules = [
'description' => 'required|min:10'
];
$val = Validator::make($data, $rules);
if ($val->fails()) {
return Redirect::back()->withErrors($val, 'addticket');
}
Comments::add($data);
return Redirect::back();
}
}